You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fmt: print type names and DDL as the author wrote them
Two-word type names printed squashed (VARYING CHARACTER(32) came back
as VARYINGCHARACTER(32)): the converter folds the spaces out of type
names for catalog matching, and the printer had nothing else to show.
ast.TypeName now carries the authored spelling alongside the folded
name — the sqlite converter fills it for column types and casts from
meyer's token-joined name — and the printer prefers it.
Fixing that surfaced how much of a CREATE TABLE the reprint silently
destroyed: PRIMARY KEY came back as NOT NULL, DEFAULT, UNIQUE, CHECK
and every other constraint vanished, a typeless column grew an 'any',
and IF NOT EXISTS was dropped. Column PRIMARY KEY, typeless columns
and IF NOT EXISTS are now modeled and print faithfully. Everything the
node still cannot carry — other column constraints, table constraints,
table options, TEMP, AS SELECT, and a NOT NULL next to a PRIMARY KEY
(which does not imply it in SQLite) — marks the statement Incomplete:
it renders as nothing, no verification accepts that, and sqlc fmt keeps
the statement exactly as written. ALTER TABLE ADD COLUMN gets the same
treatment. TestFormat learns that an empty rendering is that signal,
and the fmt endtoend case pins the new behavior.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MTvpHqNMadH12pTtsgUq2
0 commit comments