module
Prostore::Drift::SchemaTable
Overview
CRUD for the prostore_schema bookkeeping table (ADR-0010).
The metadata used to live in a single definition JSON column. As of
internal schema version 2 it is promoted to typed columns; only the
three small identifier arrays (index columns, FK source/target columns)
remain JSON-encoded because neither SQLite nor Postgres expose a
portable native array type that fits a single-table layout.
All operations run on a caller-supplied executor (DB::Database, DB::Connection, or DB::Transaction).
Extended Modules
Defined in:
prostore/drift/schema_table.crConstant Summary
-
COLUMNS =
["table_name", "kind", "tag", "current_name", "portable_type", "nullable", "is_primary", "auto_increment", "has_default", "default_sql", "has_backfill", "backfill_sql", "has_lazy", "enum_members", "enum_is_flags", "index_columns", "index_unique", "index_where_sql", "fk_columns", "fk_references_table", "fk_references_columns", "fk_on_delete", "fk_on_update"] of ::String -
KIND_COLUMN =
"column" -
KIND_FOREIGN_KEY =
"foreign_key" -
KIND_INDEX =
"index"
Instance Method Summary
- #all(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor) : Array(Row)
- #delete(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, kind : String, tag : Int32) : Nil
- #for_table(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String) : Array(Row)
- #upsert_field(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, field : Schema::Field) : Nil
- #upsert_foreign_key(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, fk : Schema::ForeignKey) : Nil
- #upsert_index(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, index : Schema::Index) : Nil
Instance Method Detail
def all(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor) : Array(Row)
#
def delete(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, kind : String, tag : Int32) : Nil
#
def for_table(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String) : Array(Row)
#
def upsert_field(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, field : Schema::Field) : Nil
#
def upsert_foreign_key(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, fk : Schema::ForeignKey) : Nil
#
def upsert_index(adapter : Prostore::Adapter::Base, executor : Prostore::Adapter::Base::Executor, table : String, index : Schema::Index) : Nil
#