You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug actually appears here where we fail to check for notNull in json fields.
In my testing, it seems if we output *.json.RawMessage for nullable fields, the Scan operation succeeds successfully for null values.
I don't see any other references of pointers inside of sqlc-generated code (vs. explicit NullRawMessage types as exist in the postgres implementation) so I'm uncertain pointers would be acceptable. In any case I'll spin up a PR shortly for discussion.
Version
1.26.0
What happened?
I have a MariaDB table with a nullable JSON column but selecting it when the value is NULL fails to Scan() it into the field.
I'm using the
github.com/go-sql-driver/mysql
driver.Relevant log output
SQL queries
Configuration
No response
Playground URL
https://play.sqlc.dev/p/8e1085762b38b90fb51da2bdac5fe4d2b37d6b89cfae5562063e295d3a829a18
What operating system are you using?
Linux
What database engines are you using?
MySQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: