On this page
API reference for the services.src.orxtra.services._generated.schema_executor module — auto-generated documentation covering public functions, classes, and type signatures.
#services.src.orxtra.services._generated.schema_executor
#services.src.orxtra.services._generated.schema_executor
#AsyncConnection
#execute
async def execute(self, query: str) -> None#fetch
async def fetch(self, query: str) -> list[dict[str, Any]]#transaction
async def transaction(self) -> AsyncTransaction#AsyncTransaction
#execute
async def execute(self, query: str) -> None#Section
#exists
async def exists(self, conn: AsyncConnection, op: DDLOp) -> boolCheck if the object described by op already exists.
#ExecutionResult
| Field | Type | Default |
|---|---|---|
executed | list[tuple[str, str]] | field(default_factory=list) |
skipped | list[tuple[str, str]] | field(default_factory=list) |
errors | list[tuple[str, str, str]] | field(default_factory=list) |
#VerifyResult
| Field | Type | Default |
|---|---|---|
present | list[tuple[str, str]] | field(default_factory=list) |
missing | list[tuple[str, str]] | field(default_factory=list) |
#execute
async def execute(conn: AsyncConnection, sections: Sequence[str] | None=None, exclude_sections: Sequence[str] | None=None, idempotent: bool=True, dry_run: bool=False, extension_stubs: dict[str, str] | None=None) -> ExecutionResultExecute DDL sections.
Two-phase execution: transactional sections run inside a single transaction, non-transactional sections run outside afterward.
Ops with idempotent_sql=None are inherently re-runnable statements (COMMENT ON, SET STATISTICS, OWNER TO, ENABLE/FORCE ROW LEVEL SECURITY, partman config UPDATE); for those, executing op.sql again is harmless, so idempotent=True falls back to op.sql. Exception: partman create_parent has no idempotent form and errors if re-run.
#verify
async def verify(conn: AsyncConnection, sections: Sequence[str] | None=None, exclude_sections: Sequence[str] | None=None) -> VerifyResultCheck which ops across selected sections exist in the database.
#create_schema
async def create_schema(conn: AsyncConnection) -> ExecutionResultExecute all DDL, failing on conflicts.
#ensure_schema
async def ensure_schema(conn: AsyncConnection) -> ExecutionResultExecute all DDL idempotently, safe to run on existing databases.