module
Prostore::Adapter::Postgres::DDL
Overview
PostgreSQL DDL builders (ADR-0014). Mirrors SQLite::DDL but emits PG idiomatic syntax: GENERATED BY DEFAULT AS IDENTITY, real BOOLEAN, ALTER TABLE ADD CONSTRAINT, etc.
Extended Modules
Defined in:
prostore/adapter/postgres/ddl.crInstance Method Summary
- #quote_ident(name : String) : String
- #quote_string(s : String) : String
- #render_action(action : Symbol) : String
- #render_column(field : Schema::Field, table : String | Nil = nil) : String
- #render_create_index(table : String, idx : Schema::Index, concurrently : Bool = false) : String
- #render_create_table(definition : Schema::Definition, pk_lookup : Hash(String, Array(String))) : String
-
#render_enum_check(field : Schema::Field, table : String | Nil = nil) : String | Nil
Render the
CHECK (...)clause that constrains an enum column to its declared member set (ADR-0016). - #render_foreign_key_clause(fk : Schema::ForeignKey, target_pk_columns : Array(String)) : String
Instance Method Detail
def render_create_index(table : String, idx : Schema::Index, concurrently : Bool = false) : String
#
def render_create_table(definition : Schema::Definition, pk_lookup : Hash(String, Array(String))) : String
#
Render the CHECK (...) clause that constrains an enum column to
its declared member set (ADR-0016). Returns nil for non-enum fields.
When a table name is supplied the constraint is emitted in named
form so the AlterEnumMembers step can drop and re-add it by name
at migration time.
def render_foreign_key_clause(fk : Schema::ForeignKey, target_pk_columns : Array(String)) : String
#