Skip to content

Unable to interface with more than one database in a single go program #43

Description

@Morpheus0x

Because global variables are shared within the whole go program, it is currently impossible to use sqx with more than one database in a single go program.

I would propose a change or addition to sqx, where the functions sqx.Read and sqx.Write can be called with an additional parameter, passing the *sql.DB database connection directly, without relying on the internal global variable defaultQueryable.

My use case requires that I connect to more than one database. I really enjoy working with sqx and feel that this change greatly improves the usefulness of this library for everyone.

I am going to fork this project and implement this for myself since it seems to be a straightforward change. Please let me know if this is something interesting to be upstreamed to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions