Skip to content

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

@tenkoh

Description

@tenkoh

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions