Skip to main content

Module sql_source_check

Module sql_source_check 

Source
Expand description

Opt-in fail-fast sql_source existence check at server boot (#487).

Turns a declared-but-unbacked sql_source from a silent-until-hit per-request 500 into a loud-early boot failure. Default OFF — when disabled the boot path is byte-for-byte unchanged.

Postgres-only. It executes the shared fraiseql_core::schema::sql_source_probes work-list — the same definition of “backed” the CLI validate --against-db gate uses — through the live DatabaseAdapter, so the two cannot drift. The probe SQL embeds quoted identifiers (the adapter’s raw-SQL entry point takes no bind parameters) and resolves them verbatim, exactly as the runtime does.

Functions§

find_unbacked_sources
Probe every declared sql_source and return the ones not backed by a live database object, in declaration order — empty means every source is backed.
format_unbacked
Render an unbacked-source list as a boot diagnostic. Shape is kept stable so the release-smoke harness can assert on it.