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.
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.Readandsqx.Writecan be called with an additional parameter, passing the *sql.DB database connection directly, without relying on the internal global variabledefaultQueryable.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.