Open orisano opened 1 year ago
In this case I think string
would be the correct option, but it's not always going to be the right answer. It depends on a query-by-query basis.
What is the case of a constant-only comparison where the parameter type is sql.NullString? What is the difference between sqlc.narg and sqlc.arg?
What do you want to change?
We would like to improve the type inference of parameters compared to constants only. Currently, it is absolutely inferred that
interface{}
.https://play.sqlc.dev/p/9ba65e1196da80daf0543327f12974275bf7d83b6ae5ce32a0c0f75034d2528d
query:
generated:
What type of param should be inferred,
sql.NullString
orstring
?What database engines need to be changed?
PostgreSQL, MySQL, SQLite
What programming language backends need to be changed?
Go