Expand description
IR → SQL emitter.
Produces source-style CREATE statements for each Catalog object.
Used by pgevolve dump and by future regression-capture tooling.
§Output contract
- Schemas first, then tables (with their inline constraints, excluding FKs),
then FK
ALTER TABLE ... ADD CONSTRAINTstatements (to handle FK cycles), then standalone indexes, then sequences. - Output is deterministic: for equal
Cataloginputs, byte-identical SQL is produced. Objects are emitted in their iteration order (callers wanting canonical sort should callCatalog::canonicalizefirst). - Comments are emitted as
COMMENT ON ...statements immediately after the object they describe.
§v0.1 limitations
- Views / materialized views / functions / triggers are not emitted (they are not modelled in the v0.1 IR).
- The output does NOT include pgevolve source directives (e.g.
-- pgevolve: intent = ...), so a directory written bypgevolve dumpcannot be fed directly topgevolve lintorparse_directorywithout first adding those directives. Users runningpgevolve initagainst the dump output should add directives manually, or use a futurepgevolve annotatehelper.
Modules§
- index
- Index renderer.
- schema
- Schema renderer.
- sequence
- Sequence renderer.
- table
- Table renderer.
- view
- View and materialized-view renderer.
Functions§
- render_
catalog - Render an entire
Catalogas a single SQL string with oneCREATEstatement per object, in dependency-correct order.