Skip to content

Quote identifiers that SQLite reserves - #148

Merged
LucaCappelletti94 merged 1 commit into
mainfrom
fix/sqlite-keyword-identifiers
Oct 24, 2026
Merged

LucaCappelletti94 merged 1 commit into
mainfrom
fix/sqlite-keyword-identifiers

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Collaborator

PostgreSQL lets a source name a table, column or alias with words such as set, values or a bare not, and the forward output kept them bare, which SQLite rejects as a syntax error. CREATE TABLE t (id int, set int, values int) already failed in its own DDL.

The finished script now double-quotes every unquoted identifier among the keywords SQLite 3.51.1 refuses as a bare name, lowercased the way PostgreSQL folds it. Function names stay bare because the translator emits RAISE(IGNORE), and DEFAULT stays bare because SQLite would read it as a string once quoted. The pass runs once over the whole script, so replayed and rebound forms are covered too.

PostgreSQL lets a source name a table, column or alias with words such as `set`, `values` or a bare `not`, and the forward output kept them bare, which SQLite rejects as a syntax error. `CREATE TABLE t (id int, set int, values int)` already failed in its own DDL.

The finished script now double-quotes every unquoted identifier among the keywords SQLite 3.51.1 refuses as a bare name, lowercased the way PostgreSQL folds it. Function names stay bare because the translator emits `RAISE(IGNORE)`, and `DEFAULT` stays bare because SQLite would read it as a string once quoted. The pass runs once over the whole script, so replayed and rebound forms are covered too.
@LucaCappelletti94 LucaCappelletti94 added the bug Something isn't working label Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LucaCappelletti94
LucaCappelletti94 merged commit dec97ef into main Oct 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant