We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
sql.NullBool
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.21.0
I've just done a few version bumps up to v1.21.0 and noticed that:
select -- ... db.engine || ' ' || db.engine_version as runtime
Ends up being converted to an sql.NullBool.
The upgrade diff for the generate structs can be found below:
// Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.17.0 +// sqlc v1.21.0 // source: queries.sql package db @@ -198,21 +198,11 @@ where ` type RetrieveAWSAdvisoriesRow struct { - Arn string - Name string - Runtime interface{} - AdvisoryType interface{} - Description interface{} - Arn_2 string - Name_2 string - Runtime_2 string - AdvisoryType_2 interface{} - Description_2 interface{} - Arn_3 string - Name_3 string - Runtime_3 interface{} - AdvisoryType_3 interface{} - Description_3 interface{} + Arn string + Name string + Runtime sql.NullBool + AdvisoryType interface{} + Description interface{} }
Previously it was an interface{} or a string, whereas now it's a sql.NullBool 🤔
interface{}
string
I've had a look back on the Playground as far back as v1.18.0 (link) and it affects that as well as up to v1.21.0 (with #2729 applied locally)
No response
https://play.sqlc.dev/p/4644276ab2d6a08adc69359a99b241c23a0ce108f0a01d9bb937a81d584501ef
Linux
SQLite
Go
The text was updated successfully, but these errors were encountered:
It looks like a workaround can be to use:
printf('%s %s', db.engine , db.engine_version) as r,
Which then outputs:
R sql.NullString
Sorry, something went wrong.
Any idea why it may be presenting a NullString instead of just a string?
NullString
In SQLite it is mistaken for a bool, but in PostgreSQL and MySQL it is also an interface{}.
Two problems are causing this issue.
fix(compiler): Improved type inference for concat operator
8f01b76
close sqlc-dev#2734 Fixed sqlite engine treating "||" as OR. MySQL does not have a concat operator, so there is no need to support it.
9138e99
Successfully merging a pull request may close this issue.
Version
1.21.0
What happened?
I've just done a few version bumps up to v1.21.0 and noticed that:
Ends up being converted to an
sql.NullBool
.The upgrade diff for the generate structs can be found below:
Previously it was an
interface{}
or astring
, whereas now it's asql.NullBool
🤔I've had a look back on the Playground as far back as v1.18.0 (link) and it affects that as well as up to v1.21.0 (with #2729 applied locally)
Relevant log output
No response
Database schema
No response
SQL queries
No response
Configuration
No response
Playground URL
https://play.sqlc.dev/p/4644276ab2d6a08adc69359a99b241c23a0ce108f0a01d9bb937a81d584501ef
What operating system are you using?
Linux
What database engines are you using?
SQLite
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: