Repository navigation
Extending Catalogs
github-actions[bot] edited this page Nov 24, 2026
·
1 revision
A catalog is two methods: does a table exist, and what columns does it have. Return
Nonewhen you cannot answer, so FactLang reports "could not verify" instead of a false error. Wrap yours inCachedCatalogand never enumerate the whole warehouse.
class MyCatalog:
def table_exists(self, ref): # True / False / None (unknown)
...
def columns(self, ref): # {"name": "native type"} or None
...Use a catalog by passing it to the checker: fl.Checker(connector, catalog=MyCatalog()).
- Be lazy: answer only for the table asked about. Do not load a full schema listing at start-up.
-
Be honest:
Falsemeans definitely not there. If a lookup failed or you lack permission, returnNone. -
Keep native types: return the engine's own type text (
NUMBER(38,0)); the dialect's type-family table maps it tointeger,stringand so on. -
Cache: wrap with
fl.CachedCatalog(inner, ttl_s=300, max_tables=1000).
A schema registry that already holds column metadata, a data catalog service, or a static JSON export (for which StaticCatalog is already enough).
Check three cases: a known table, a missing table, and an unknown (None). Confirm that unknown leads to FL313 info and that a definite miss leads to FL311.
FactLang
Using it
Components
Extending
Help