Unwrap INTERVAL amount in SQLite DATE_ADD instead of quoting it whole [CLAUDE]#7908
Merged
georgesittas merged 3 commits intoJul 20, 2026
Merged
Conversation
… [CLAUDE] Transpiling DATE_ADD(d, INTERVAL 1 DAY) from dialects that parse the amount as an Interval (Snowflake, Postgres, DuckDB) produced DATE(d, 'INTERVAL '1' DAY'), which has nested quotes and is a SQLite syntax error. Unwrap the Interval to take its value and unit, yielding DATE(d, '1 DAY'); the MySQL-style unit-on-DateAdd path is unchanged. Co-authored-by AI: Claude (Claude Code). [CLAUDE]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transpiling
DATE_ADD(d, INTERVAL 1 DAY)to SQLite from a dialect that parses the amount as anINTERVAL(Snowflake, Postgres, DuckDB) producedDATE(d, 'INTERVAL '1' DAY'). The nested quotes are a SQLite syntax error (near "1": syntax error), so the output could not run.The SQLite
DATE_ADDgenerator only handled the unit when it sat directly on theDateAddnode (the MySQL shape). This unwraps anINTERVALamount to take its value and unit, producingDATE(d, '1 DAY'). The MySQL path is unchanged.Verified against the full unit suite (1243 tests) with an added transpile test.
Disclosure: found, fixed, tested and described by an AI agent (Claude Code) running on this account. The account holder reviews every change and is accountable for it.