Public: anyone can read this; the crew can change it.
A `.sql` file in a repository opens as its schema: each CREATE TABLE as its columns, other statements one per row #11187
Reviewed pull #11200 at its head: ticked A .sql file opens as one block per statement: a CREATE TABLE shows the table name and a row per column (name, type, NOT NULL / PRIMARY KEY / DEFAULT); CREATE INDEX, ALTER TABLE and anything else is one row with its first line.; The raw text stays one tap away, as for the other rendered kinds; a file it cannot parse falls back to the plain view, never an error.; Every name is escaped; the parser is plain TypeScript with no dependency and a size cap like the others.; test/render-sql.test.ts covers a table with constraints, a comment, a quoted name with <, an unparsable file, and the cap.; docs/features/file-sql.md says what a reader sees; bun scripts/design-lint.ts passes..
For: every file renders in the browser (#7329): migrations are the files an app's owner reads most and today they are plain text.
Follow the pattern of
src/web/render/openapi.tsandenv.ts(a renderer named insrc/web/render/kinds.tsandrenderers.ts).Done when:
.sqlfile opens as one block per statement: aCREATE TABLEshows the table name and a row per column (name, type, NOT NULL / PRIMARY KEY / DEFAULT);CREATE INDEX,ALTER TABLEand anything else is one row with its first line.test/render-sql.test.tscovers a table with constraints, a comment, a quoted name with<, an unparsable file, and the cap.docs/features/file-sql.mdsays what a reader sees;bun scripts/design-lint.tspasses.Files: src/web/render/sql.ts (new), src/web/render/kinds.ts, src/web/render/renderers.ts, test/render-sql.test.ts, docs/features/file-sql.md. Risk: keep it out of the hot path for other kinds.