Skip to content

fix(sqlite): emit STORED for generated columns instead of PERSISTED - #8123

Merged
georgesittas merged 2 commits into
tobymao:mainfrom
dgvj-work:fix/sqlite-stored-generated-columns
Aug 11, 2026
Merged

fix(sqlite): emit STORED for generated columns instead of PERSISTED#8123
georgesittas merged 2 commits into
tobymao:mainfrom
dgvj-work:fix/sqlite-stored-generated-columns

Conversation

@dgvj-work

Copy link
Copy Markdown
Contributor

SQLite rejects T-SQL's PERSISTED keyword. Parse GENERATED ALWAYS AS (expr) [STORED|VIRTUAL] as computed columns so they are not rewritten to AUTOINCREMENT, and generate STORED/VIRTUAL correctly.

SQLite rejects T-SQL's PERSISTED keyword. Parse GENERATED ALWAYS AS
(expr) [STORED|VIRTUAL] as computed columns so they are not rewritten
to AUTOINCREMENT, and generate STORED/VIRTUAL correctly.

Co-authored-by: Digvijay <dgvj-work@users.noreply.github.com>
Comment thread sqlglot/parsers/sqlite.py
Comment thread sqlglot/parsers/sqlite.py Outdated
Comment thread tests/dialects/test_sqlite.py Outdated
Parse STORED/VIRTUAL for typeless AS (expr) columns, only consume
storage keywords on expression-bearing generated columns, and map
identity through PRIMARY KEY AUTOINCREMENT.
@georgesittas
georgesittas merged commit 353d0ff into tobymao:main Aug 11, 2026
8 checks passed
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.

3 participants