-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
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
Column overrides have no effect when using SQLite engine #1985
Comments
gregoryjjb
added
bug
Something isn't working
triage
New issues that hasn't been reviewed
labels
Dec 4, 2022
mcdoker18
added a commit
to mcdoker18/sqlc
that referenced
this issue
Dec 5, 2022
We should not assume that a table has a default schema name in the override config. Because different sql databases can have different default schemas. Fixes: sqlc-dev#1985
For those of you that want a "workaround", you need to explicitly specify the schema in the column override: overrides:
- column: "main.mytable.mycolumn"
go_type: "github.com/gofrs/uuid.UUID"
This worked for me on sqlc v1.17.0. |
danderson
pushed a commit
to danderson/sqlc
that referenced
this issue
May 7, 2023
We should not assume that a table has a default schema name in the override config. Because different sql databases can have different default schemas. Fixes: sqlc-dev#1985 Signed-off-by: David Anderson <[email protected]>
andrewmbenton
added
🔧 golang
💻 windows
📚 sqlite
and removed
triage
New issues that hasn't been reviewed
labels
Jun 6, 2023
This is still an issue in v1.18.0: https://play.sqlc.dev/p/37eff07be350564fde55c4916c4c00df23e4dc524d09a06d5abe77e9ef087851 It looks like we should probably merge #1986 to resolve this |
andrewmbenton
pushed a commit
that referenced
this issue
Jun 7, 2023
We should not assume that a table has a default schema name in the override config. Because different sql databases can have different default schemas. Fixes: #1985
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
1.15.0
What happened?
Type overrides specified by column name have no effect when using SQLite as the engine. The same config works with MySQL.
Check out the UUID column in the following playgrounds (snippets pasted below as well):
SQLite playground showing bugged result
MySQL playground showing desired result
The resulting struct with SQLite (no type override applied, it uses the default
sql.NullString
):And with MySQL (it used UUID this time correctly):
Relevant log output
No response
Database schema
SQL queries
No response
Configuration
Playground URL
https://play.sqlc.dev/p/2c63b17ce6f6fe25e987ef9af4175641d1c9d3607be33cf4a86188b08a09f4dd
What operating system are you using?
Windows
What database engines are you using?
No response
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: