# `Ithibati.Catalogue`
[🔗](https://github.com/oliverandrich/ithibati/blob/v0.6.2/lib/ithibati/catalogue.ex#L1)

Reads PostgreSQL, SQLite and MySQL 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. SQLite uses the unprefixed main database; MySQL uses the repo's
selected database without schema prefixes.

# `column`

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.

# `key_column`

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.

# `qualified`

Returns the table name, qualified with `prefix` when one is supplied, for diagnostic text.

# `table`

Returns an opaque table reference, or nil when the table is absent.

# `types`

Database column types compatible with a supported Ecto storage type.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
