Database readiness API¶
Readiness checks are explicit, read-only startup gates for the official PostgreSQL and MySQL adapters. They verify that migration history is current and that the connected credential matches either the runtime or retention lane. They never migrate, grant privileges, or write action data.
Call the adapter-specific function after creating the application's pool and
before accepting work. Stop startup when ready is false and surface issues
to operators. Do not silently continue with a migrator credential.
MySQL readiness intentionally requires the direct grants emitted by
render_mysql_grants. Assigned roles or additional grants fail the exact
posture check, even if they happen to produce similar effective access. This
keeps the boot-time result deterministic; qualify a custom role-based profile
separately instead of weakening the official one.
readiness ¶
Framework-neutral database startup readiness results.
DatabaseAdapter ¶
DatabaseAccessLane ¶
DatabaseReadiness
dataclass
¶
DatabaseReadiness(adapter: DatabaseAdapter, lane: DatabaseAccessLane, applied_versions: tuple[int, ...], pending_versions: tuple[int, ...], schema_current: bool, privilege_boundary_valid: bool, issues: tuple[str, ...])
Read-only schema and privilege readiness for one application lane.