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

Resolve named database connections and manage their lifecycle.

Method __init__ Initialize the manager from the application configuration.
Method __unknownConnectionMessage Build the descriptive message for an unresolved connection name.
Method addConnection Register or replace a named connection configuration at runtime.
Method configFor Retrieve the configuration for a named connection.
Method connection Resolve the connection registered under the given name.
Async Method disconnect Dispose one or all cached connections.
Method getDefaultName Return the name of the default connection.
Method hasConnection Report whether a connection configuration exists.
Method setDefaultName Change the default connection name.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _cached_connections Cached connections value, computed on first access.
Instance Variable _connections Database configurations indexed by their case-sensitive registered name.
Instance Variable _default Exact registered default name, with the legacy lowercase fallback.
Instance Variable _lock Serialize publication and registry mutation without holding async cleanup.
def __init__(self, app: IApplication): (source)

Initialize the manager from the application configuration.

Parameters
app:orionis.IApplicationApplication container providing the database configuration.
Returns
NoneNo return value.
def __unknownConnectionMessage(self, name: str) -> str: (source)

Build the descriptive message for an unresolved connection name.

Parameters
name:strConnection name that failed to resolve.
Returns
strDescriptive message listing the declared connection names.
def addConnection(self, name: str, config: dict[str, Any]): (source)

Register or replace a named connection configuration at runtime.

A live connection built from a previous configuration keeps serving until orionis.database.ConnectionManager.disconnect is called for that name.

Parameters
name:strConnection name to register.
config:dictDriver configuration for the connection.
Returns
NoneNo return value.
Raises
ValueErrorIf the name is empty.
TypeErrorIf the configuration is not a mapping.
def configFor(self, name: str | None = None) -> dict[str, Any]: (source)

Retrieve the configuration for a named connection.

Parameters
name:str or None, optionalConnection name to look up, or None for the default.
Returns
dict[str, typing.Any]The configuration dictionary for the requested connection.
Raises
orionis.database.ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
def connection(self, name: str | None = None) -> IConnection: (source)

Resolve the connection registered under the given name.

The connection is built on first access and cached for reuse.

Parameters
name:str or None, optionalConnection name as declared in the database configuration, or None for the default connection.
Returns
orionis.database.contracts.IConnectionConnection bound to its configuration.
Raises
orionis.database.ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
async def disconnect(self, name: str | None = None): (source)

Dispose one or all cached connections.

Attempt every cached connection even if an earlier disconnect fails. Propagate cancellation in preference to ordinary errors; otherwise preserve the first failure and report additional errors centrally.

Parameters
name:str or None, optionalConnection to dispose, or None to dispose every cached connection.
Returns
NoneNo return value.
Raises
ExceptionThe first ordinary failure after all selected connections settle.
asyncio.CancelledErrorIf cancellation interrupts a disconnect, after remaining attempts.
def getDefaultName(self) -> str: (source)

Return the name of the default connection.

Returns
strDefault connection name as configured.
def hasConnection(self, name: str) -> bool: (source)

Report whether a connection configuration exists.

Parameters
name:strConnection name to look up.
Returns
boolTrue when the configuration is registered.
def setDefaultName(self, name: str): (source)

Change the default connection name.

Parameters
name:strConnection name to use as the default; must already be declared in the configuration.
Returns
NoneNo return value.
Raises
orionis.database.ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

_cached_connections: dict[str, IConnection] = (source)

Cached connections value, computed on first access.

_connections: dict[str, dict[str, Any]] = (source)

Database configurations indexed by their case-sensitive registered name.

_default: str = (source)

Exact registered default name, with the legacy lowercase fallback.

Serialize publication and registry mutation without holding async cleanup.