Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unquote backticks in sqlite identifiers #4120

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

Open
JoeriAben wants to merge 1 commit into sqlc-dev:main
base: main
Choose a base branch
Loading
from JoeriAben:fix/sqlite-backtick-relation-does-not-exist

Conversation

Copy link

@JoeriAben JoeriAben commented Oct 1, 2025
edited
Loading

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
Reviewers
No reviews
Assignees
No one assigned
Labels
size:S This PR changes 10-29 lines, ignoring generated files. 🔧 golang
Projects
None yet
Milestone
No milestone
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

AltStyle によって変換されたページ (->オリジナル) /