-
Notifications
You must be signed in to change notification settings - Fork 923
Open
Labels
Description
What do you want to change?
Thank you for an awesome tool!
When I had tried a simple schema and a query for SQLite3, I got relation "users" does not exist"
error.
sqlc version: 1.25
CREATE TABLE `users` (
`id` Integer NOT NULL,
PRIMARY KEY(`id`)
);
-- name: ListUsers :many
SELECT * FROM users;
{
"version": "2",
"sql": [{
"schema": "schema.sql",
"queries": "query.sql",
"engine": "sqlite",
"gen": {
"go": {
"out": "db"
}
}
}]
}
playground:
https://play.sqlc.dev/p/70a186af745e44d972ae126b78f83a98443a3a70d8bc42462109703baf239ac0
- The schema file was generated by another tool (Atlas), which always backquotes table and column names.
- The query file was written by me and does not use backquotes.
This mismatch resulted in a relation "users" does not exist"
error. However, when I removed the backquotes, it worked.
As the example above shows, some SQL tools generate backquoted names, while in some cases, developers do not. Ignoring the difference in backquotes could simplify things. Is this possible?
What database engines need to be changed?
SQLite
What programming language backends need to be changed?
Go
schlauerlauer, Codebreaker101, unbiased-dev and xanderazuaje