ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Provide database migrations operations.

Includes current_migration_connection, migration_connection_scope.

Class _MigrationBinding Invalidate inherited connection selection when its owning scope ends.
Function current_migration_connection Return the connection selected by the current migration step.
Function migration_connection_scope Bind unqualified migration operations to their tracking transaction.
Constant _MIGRATION_CONNECTION Context-local migration connection isolated between asynchronous tasks.
def current_migration_connection() -> IConnection | None: (source)

Return the connection selected by the current migration step.

Returns
orionis.database.contracts.IConnection or NoneConnection inherited by unqualified schema and ORM operations.
def migration_connection_scope(connection: IConnection) -> Generator[None]: (source)

Bind unqualified migration operations to their tracking transaction.

Parameters
connection:orionis.database.contracts.IConnectionConnection selected by the migration runner.
Yields
NoneNo yielded value. Restore the previous binding on exit and invalidate the completed binding in child contexts that inherited it.
_MIGRATION_CONNECTION: ContextVar[_MigrationBinding | None] = (source)

Context-local migration connection isolated between asynchronous tasks.

Value
ContextVar('orionis_migration_connection',
           default=None)