Reads PostgreSQL table, column and uniqueness metadata.
Ithibati.Migration and Ithibati.Doctor use these queries to apply the same checks during
migration and setup diagnosis. Functions receive the repo explicitly; table lookup also takes
a PostgreSQL schema prefix.
Summary
Functions
Returns {database_type, unique?} for a column, or nil if it does not exist.
Returns {:ok, description} when the column meets the configured account-key requirements.
Returns the table name, qualified with prefix when one is supplied, for diagnostic text.
Returns the relation OID for table, or nil if the name does not resolve.
Functions
Returns {database_type, unique?} for a column, or nil if it does not exist.
Domains resolve to their underlying type. unique? requires a non-partial unique index whose
only key column is this column. Additional included columns are allowed; for example,
PRIMARY KEY (id) INCLUDE (email) qualifies.
Returns {:ok, description} when the column meets the configured account-key requirements.
Returns {:error, description} for a missing column, an incompatible database type or missing
uniqueness. Both migration and doctor checks use this result so they agree on the schema
Ithibati can reference.
Returns the table name, qualified with prefix when one is supplied, for diagnostic text.
Returns the relation OID for table, or nil if the name does not resolve.
With a prefix, lookup uses that PostgreSQL schema. With nil, it uses the connection's search
path. Identifiers are quoted in PostgreSQL so mixed-case names retain their meaning.