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

Undocumented

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__ Undocumented
Instance Variable _cached_connections Undocumented
Instance Variable _connections Undocumented
Instance Variable _default Undocumented
def __init__(self, app: IApplication): (source)

Initialize the manager from the application configuration.

Parameters
app:IApplicationApplication container providing the database configuration.
Returns
NoneThis method does not return a 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 disconnect is called for that name.

Parameters
name:strConnection name to register.
config:dictDriver configuration for the connection.
Returns
NoneThis method does not return a 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, Any]The configuration dictionary for the requested connection.
Raises
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
IConnectionConnection bound to its configuration.
Raises
ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
async def disconnect(self, name: str | None = None): (source)

Dispose one or all cached connections.

Parameters
name:str or None, optionalConnection to dispose, or None to dispose every cached connection.
Returns
NoneThis method does not return a value.
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
NoneThis method does not return a value.
Raises
ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
_cached_connections: dict[str, IConnection] = (source)

Undocumented

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

Undocumented

_default: str = (source)

Undocumented