db
azure_bootstrap.db
¶
Relational database access layer — SQLAlchemy 2 engine/session factory.
Modules:
| Name | Description |
|---|---|
migrations |
Alembic migration conventions — env-driven harness. |
outbox |
Transactional outbox — reliable send with idempotency and claim/drain. |
Functions:
| Name | Description |
|---|---|
create_engine_from_env |
Build a SQLAlchemy engine from |
get_engine |
Lazy singleton engine. |
get_db |
FastAPI-style session dependency — yields and always closes. |
db_health |
Return |
postgres_rls_statements |
Idempotent RLS DDL for multi-tenant Postgres tables. |
create_engine_from_env
¶
Build a SQLAlchemy engine from DATABASE_URL (or custom env var).
Source code in azure_bootstrap/db/__init__.py
get_engine
¶
Lazy singleton engine.
Source code in azure_bootstrap/db/__init__.py
get_db
¶
FastAPI-style session dependency — yields and always closes.
Source code in azure_bootstrap/db/__init__.py
db_health
¶
Return {status, latency_ms} for health probes.
Source code in azure_bootstrap/db/__init__.py
postgres_rls_statements
¶
Idempotent RLS DDL for multi-tenant Postgres tables.