Skip to content

Fix Lexer string regex to support ansi-sql quoting#740

Merged
JakeWharton merged 4 commits intosqldelight:masterfrom
griffio:fix-lexer-string-regex
Mar 13, 2026
Merged

Fix Lexer string regex to support ansi-sql quoting#740
JakeWharton merged 4 commits intosqldelight:masterfrom
griffio:fix-lexer-string-regex

Conversation

@griffio
Copy link
Copy Markdown
Contributor

@griffio griffio commented Feb 13, 2026

fixes sqldelight/sqldelight#3747

  • Add regex pattern that supports quote-escaping used by Ansi-Sql
  • Add fixture test can be run by all dialects

The current regex doesn't support this.

e.g INSERT INTO foo VALUES ('It''s a string');

Fixes the SqlLexer as this is the actual tokenizer used by the parser at build time.

sql.bnf is updated for consistency as is used by GrammarKit tooling.

Tested integration with SqlDelight


  • CHANGELOG.md's "Unreleased" section has been updated, if applicable.

@griffio griffio marked this pull request as ready for review February 13, 2026 12:10
@griffio
Copy link
Copy Markdown
Contributor Author

griffio commented Mar 13, 2026

@dellisd
If you are planning another SqlDelight release we could update the sqlpsi dependency.
Including this (needs 🧜‍♂️) , I know I have fixed some other bits and pieces since last time.
https://github.com/sqldelight/sql-psi/blob/master/CHANGELOG.md

@JakeWharton
Copy link
Copy Markdown
Collaborator

I can do a release and Renovate will do the rest. I forgot you can't merge your own PRs in here.

@JakeWharton JakeWharton merged commit 6019ac6 into sqldelight:master Mar 13, 2026
2 checks passed
@griffio griffio deleted the fix-lexer-string-regex branch March 13, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two single quotes ('') not understood inside a string surrounded by single quotes

2 participants