Skip to main content Module postgres Copy item path Source PostgresAdapter A Postgres storage adapter. Currently supports planning only.
No live connection — SQL generation and planning from manifest. INTROSPECT_COLUMNS_SQL SQL to list columns for a given table.
Use with parameter: table_name. INTROSPECT_INDEXES_SQL SQL to list indexes for a given table.
Use with parameter: table_name. INTROSPECT_TABLES_SQL SQL to list user tables in the public schema. add_column_sql Generate a Postgres ALTER TABLE ADD COLUMN statement.
NOT NULL is omitted on ADD COLUMN to avoid requiring DEFAULT values.
Required-ness is tracked in the manifest; enforcement deferred. build_insert_sql Build an INSERT SQL statement and collect string parameter values.
Returns (sql, values) where values[0] is the generated ID. build_update_sql Build an UPDATE SQL statement and collect string parameter values.
Returns (sql, values) where values[0] is the row ID. create_index_sql Generate a Postgres CREATE INDEX statement. create_table_sql Generate a Postgres CREATE TABLE statement. generate_id Generate a lex-sortable, monotonic-ish unique ID. json_value_to_string Convert a JSON value to its string representation for use as a SQL parameter. plan_from_snapshot Plan from a snapshot (reuses the shared plan_from_snapshot).
This allows Postgres to plan incrementally once introspection data is available. plan_to_sql Generate all SQL statements for a plan, in order.
Useful for dry-run preview of what Postgres DDL would be executed.