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.

class documentation

Apply new seeders exactly once on the selected database connection.

Files under database/seeders are discovered in lexical filename order. The application container builds each seeder so constructors can receive dependencies. Each seeder and its tracking row commit in the same transaction. The unique tracking key acts as a database-level claim when runs overlap.

Method __discover Find local Seeder subclasses in deterministic filename order.
Async Method __ensureTrackingTable Create the tracking table, tolerating a concurrent creator.
Async Method __getRan Read committed tracking rows in insertion order.
Method __init__ Initialize the runner with the application and connection manager.
Async Method __isRecorded Check whether another transaction committed this seeder.
Async Method __runStep Claim, run and commit one seeder and its tracking row.
Method __seedersPath Return the application's configured seeder directory.
Async Method seed Run every discovered seeder that has no committed tracking row.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable __app Application providing the seeder directory.
Instance Variable __conn_manager Manager resolving configured database connections.
Instance Variable __discovered_cache Cached results of filesystem discovery.
def __discover(self) -> dict[str, type[Seeder]]: (source)

Find local Seeder subclasses in deterministic filename order.

Returns
dict of str to type of orionis.database.seeders.SeederSeeder classes keyed by persisted filename stem.
Raises
ValueErrorIf more than one class resolves to the same persisted name.
async def __ensureTrackingTable(self, connection: IConnection): (source)

Create the tracking table, tolerating a concurrent creator.

Parameters
connection:orionis.database.contracts.IConnectionSelected database connection.
Returns
NoneNo return value.
async def __getRan(self, connection: IConnection) -> list[dict[str, Any]]: (source)

Read committed tracking rows in insertion order.

Parameters
connection:orionis.database.contracts.IConnectionConnection holding the tracking table.
Returns
list of dictTracking rows ordered by primary key.
def __init__(self, app: IApplication, conn_manager: IConnectionManager): (source)

Initialize the runner with the application and connection manager.

Parameters
app:orionis.IApplicationApplication providing the seeder directory.
conn_manager:orionis.database.contracts.IConnectionManagerManager resolving configured database connections.
Returns
NoneNo return value.
async def __isRecorded(self, connection: IConnection, name: str) -> bool: (source)

Check whether another transaction committed this seeder.

Observe a failed recovery read without replacing the pending claim error. The caller propagates that original error when recovery is unconfirmed. Return False after observing a QueryException that prevents the lookup.

Parameters
connection:orionis.database.contracts.IConnectionConnection holding the tracking table.
name:strSeeder filename stem.
Returns
boolWhether a committed tracking row was confirmed by the recovery read.
async def __runStep(self, connection: IConnection, name: str, seeder_cls: type[Seeder], batch: int, events: SeederEvents) -> bool: (source)

Claim, run and commit one seeder and its tracking row.

Parameters
connection:orionis.database.contracts.IConnectionConnection shared by the seeder and tracking transaction.
name:strPersisted seeder filename stem.
seeder_cls:type of orionis.database.seeders.SeederClass to instantiate and execute.
batch:intBatch assigned to this invocation.
events:orionis.database.seeders.events.SeederEventsProgress callbacks.
Returns
boolWhether this call executed the seeder.
def __seedersPath(self) -> Path: (source)

Return the application's configured seeder directory.

Returns
pathlib.PathAbsolute path under database/seeders.
async def seed(self, *, connection: str | None = None, events: SeederEvents | None = None) -> list[str]: (source)

Run every discovered seeder that has no committed tracking row.

Parameters
connection:str or None, optionalNamed database connection, or the configured default.
events:orionis.database.seeders.events.SeederEvents or None, optionalProgress callbacks for executed seeders.
Returns
list of strSeeder names completed by this call, in execution order.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Application providing the seeder directory.

__conn_manager = (source)

Manager resolving configured database connections.

__discovered_cache: dict[str, type[Seeder]] | None = (source)

Cached results of filesystem discovery.