Open Nigel2392 opened 1 week ago
I would allow that as an option, but prefer to user pointers myself.
I would allow that as an option, but prefer to user pointers myself.
I would also prefer to use pointers.
This is however only supported with the postgres engine, sql.Null[T]
would provide a uniform way to adress values across multiple database engines with ease, allowing for more null types such as the uint types (and more).
I am not sure if this should be indeed an option:
What do you want to change?
Present
Currently all nullable types are generated as sql.NullInt, sql.NullBool, etc.
sql.Null
Using the
sql.Null[T]
generic type might be a relatively small, but very notable way to adress nullable SQL values.Uniform Internals
This would likely also clean up the internals of SQLC for code- generation a bit, seeing as then values can simply be adressed with
sql.Null.V
, as opposed tosql.NullInt64.Int64
, etc.What database engines need to be changed?
PostgreSQL, MySQL, SQLite
What programming language backends need to be changed?
Go