Many settings need to be set for all Conns every time they are opened. Some examples are per connection PRAGMAs or running CREATE VIEW. This is a tad cumbersome to do for all connections in a Pool.
This sqlitex.OpenInit adds the ability to provide an initScript to be run on all Conns when opening a pool. A context.Context can be provided so that a timeout on the initScript can be enforced.
Now sqlitex.Open is a wrapper of sqlitex.OpenInit with an empty script and nil context.
Many settings need to be set for all Conns every time they are opened. Some examples are per connection
PRAGMA
s or runningCREATE VIEW
. This is a tad cumbersome to do for all connections in a Pool.This
sqlitex.OpenInit
adds the ability to provide an initScript to be run on all Conns when opening a pool. A context.Context can be provided so that a timeout on the initScript can be enforced.Now
sqlitex.Open
is a wrapper ofsqlitex.OpenInit
with an empty script and nil context.fix #101