PostgresReflector is the runtime entry point for PostgreSQL projects.
planReflect(...) if you want a preview of what will happen.reflect(...) to apply the approved changes.StoreProcedurePostgresReflectorStoreProcedurePostgresQueryBuilderPostgresInsertBuilderPostgresUpdateBuilderPostgresDeleteBuilderinspectPostgresSchemageneratePostgresSchemaOutputIf your workflow has operational controls, start with planReflect(...) and inspect the returned preview types before calling reflect(...).
That is the safest way to understand:
PostgreSQL rebuild plans can preserve data for explicit renames when you approve the mapping up front.
const db = new PostgresReflector(connectionString, {
approvedColumnRenames: [
{ table: "public.accounts", from: "name", to: "display_name" },
],
approvedDestructiveTableChanges: ["public.accounts"],
changeTicketId: "CHG-3108",
});
planReflect(...) exposes the mapping in preview.tables[].columnRenames, and reflect(...) copies data with explicit SELECT old_column AS new_column projections during the rebuild.
Use StoreProcedure when you want procedural PostgreSQL logic to live in versioned TypeScript classes instead of ad hoc SQL files.
The current PostgreSQL inspector preserves standard indexes, expression indexes, and partial index predicates in generated entity classes.
That means generated metadata can now round-trip patterns such as:
WHERE ...index([], { expressions: [...] })Some PostgreSQL-specific index details still require manual review during legacy onboarding.
index(...) metadataINCLUDE (...) columns are not reconstructed in the generated entity layerUse DATABASE_ENGINE.md as the stricter compatibility contract when you need exact cross-engine status for orchestration depth, returning(...), routines, triggers, views, and governance features.