Skip to content

Conversation

JoeriAben
Copy link

@JoeriAben JoeriAben commented Oct 1, 2025

Fixes #3350
Fixes #3684
Fixes #3800

In sqlite there is a quirky behavior where backticks are included in table and column names. This causes errors like relation "x" does not exist, even when the column or table is actually present.

The changes in this PR ensure that identifiers no longer include backticks as part of their names.

Steps to reproduce the issues this solves

schema.sql

CREATE TABLE `foo` (`bar` text);

queries.sql

-- name: GetFoo :many
SELECT bar FROM foo;

sqlc.yaml

version: "2"
sql:
  - engine: "sqlite"
    queries: "queries.sql"
    schema: "schema.sql"
    gen:
      go:
        package: "db"
        out: "db"

output

> sqlc generate    
# package db
queries.sql:1:1: relation "foo" does not exist

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 🔧 golang labels Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files. 🔧 golang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relation does not exists when name is surrounded by ` character Backticks are not supported Basic usage - relation "x" does not exist
1 participant