Introspection needs broad pg_catalog access and adds cold-start latency.
The schema cache removes both:
$ pdbq schema dump -o schema.cache # at build/deploy time
$ pdbq serve --schema.cache_path schema.cache # at runtimeThe cache is gzipped JSON of the introspected catalog with a format version
and a content hash; serve refuses mismatched versions and corrupted files.
Booting from cache never touches pg_catalog, so the runtime role only
needs privileges on the actual data.
$ pdbq schema check --cache schema.cache # exit 1 when live DB driftedTypical pipeline:
- Migrations run.
pdbq schema check— fails the build if the committed cache no longer matches the migrated database.- On failure, regenerate (
pdbq schema dump), review the diff ofpdbq schema printoutput, commit both.
watch.enabledandschema.cache_pathare mutually exclusive (validated at startup): watch mode exists to chase a changing schema, the cache exists to freeze one.- The cache stores the catalog, not the GraphQL schema — plugins and naming config still apply at boot, so changing plugin config does not require a new dump.