I am curious if you would accept a change like this. We are thinking of ways to do canary style rollouts of the new driver version. Currently, we can pull two different versions of the driver into our code base with changes to go.mod that look like this:
However, both versions of the driver will call init, and those call sql.Register which says If Register is called twice with the same name or if driver is nil, it panics. so we cannot run this code if the two versions are running on the same service.
Having this would allow us to bypass registration. If you don't like this method I am happy to experiment with some different methods, and if you are interested in it I will extend the readme so others can use this configuration as well, as this would require us to use sql.OpenDB rather than sql.Open. Thanks!
Checklist
[X] Created tests which fail without the change (if possible)
[X] Extended the README / documentation, if necessary
Description
I am curious if you would accept a change like this. We are thinking of ways to do canary style rollouts of the new driver version. Currently, we can pull two different versions of the driver into our code base with changes to go.mod that look like this:
However, both versions of the driver will call init, and those call sql.Register which says
If Register is called twice with the same name or if driver is nil, it panics.
so we cannot run this code if the two versions are running on the same service.Having this would allow us to bypass registration. If you don't like this method I am happy to experiment with some different methods, and if you are interested in it I will extend the readme so others can use this configuration as well, as this would require us to use
sql.OpenDB
rather thansql.Open
. Thanks!Checklist