-
Notifications
You must be signed in to change notification settings - Fork 863
Relation does not exist on update only #3852
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
Comments
Just to follow up on this one, I went back a version to v1.27.0 and it works as expected. Seems v1.28.0 might have an issue with UPDATE statements? Would also explain why there are no issues on the playground. |
I can confirm the bug, and provide a minimal example schema.sql: CREATE TABLE IF NOT EXISTS table_A(
id integer primary key,
info text
); query.sql -- name: Update_table :one
UPDATE table_A SET info=? WHERE id=? RETURNING *; with version 1.28.0 gives query.sql:1:1: relation "table_A" does not exist with 1.27.0 it works (it is a regression). Strangely enough, it seems to depend on the table name. Change table_A to table and it works! On the other hand, sqlite considers table_A to be a valid table name. sqlite> CREATE TABLE IF NOT EXISTS table_A( so it seems to be a parsing error... |
@dimmerz92 When testing somehing in the playground, you should set sqlc-version.txt to the version that you want to test. https://play.sqlc.dev/p/0fa9a40b4593ee2b4dd899dd126591b50bf92961b5f13c41372b4eab4d0ea668 |
My previous playground link was wrong. Here is the correct one (I hope!) https://play.sqlc.dev/p/7c0742c55d8324ff22e4fbf5a287dab51b513e6b12f2940551f08c4d7797e414 |
@pdenapo 1.28 was not available in the playground at the time and it caused errors. |
Version
1.28.0
What happened?
Expected
sqlc generate
to generate all queries.I tried removing queries one by one and found that generating worked for everything except for
UPDATE
statements.No issues in sqlc playground.
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/0fa9a40b4593ee2b4dd899dd126591b50bf92961b5f13c41372b4eab4d0ea668
What operating system are you using?
macOS
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: