mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-30 11:12:58 +00:00
Turso stores schema SQL by re-rendering the statement from the AST, and the AST did not record whether the user wrote GENERATED ALWAYS AS or the bare AS form, so the keywords vanished from sqlite_master. SQLite keeps the original spelling, and tools that round-trip schema text depend on it. Record the spelling on the generated-column constraint, emit it from both renderers (the AST token stream used by RENAME, and the column metadata renderer used by ADD COLUMN), and only where the user actually wrote it — bare AS stays bare. Tests: spelling round-trip coverage through CREATE and the ALTER paths in gencol.sqltest. Fixes #6155 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>