This PR adds a method, With, to the database. It also changes Query to accept strings as well as prepared statements. If a query has no output expressions then it can be prepared only using the input arguments, if there are output expressions type samples can be passed to With.
The type samples are stored indefinitely alongside the database in the typeSamples slice.
Note that ideally we would use Generics here for the type of the Statement/string instead of any in DB.Query but Go does not allow generics in methods on structs.
This PR adds a method,
With
, to the database. It also changesQuery
to accept strings as well as prepared statements. If a query has no output expressions then it can be prepared only using the input arguments, if there are output expressions type samples can be passed toWith
.The type samples are stored indefinitely alongside the database in the
typeSamples
slice.Note that ideally we would use Generics here for the type of the
Statement
/string
instead ofany
inDB.Query
but Go does not allow generics in methods on structs.