Skip to content
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

Want not to distinguish between table names with backquotes and ones without backquotes. #3550

Open
tenkoh opened this issue Aug 15, 2024 · 0 comments
Labels

Comments

@tenkoh
Copy link

tenkoh commented Aug 15, 2024

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

@tenkoh tenkoh added the enhancement New feature or request label Aug 15, 2024
@tenkoh tenkoh changed the title Want not to distinguish table names like model and model Want not to distinguish table names like <code></code>model<code></code> and model Aug 15, 2024
@tenkoh tenkoh changed the title Want not to distinguish table names like <code></code>model<code></code> and model Want not to distinguish between table names with backquotes and ones without backquotes. Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant