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 ConnectionManager(IConnectionManager): (source)
Constructor: ConnectionManager(app)
Resolve named database connections and manage their lifecycle.
| Method | __init__ |
Initialize the manager from the application configuration. |
| Method | __unknown |
Build the descriptive message for an unresolved connection name. |
| Method | add |
Register or replace a named connection configuration at runtime. |
| Method | config |
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 | get |
Return the name of the default connection. |
| Method | has |
Report whether a connection configuration exists. |
| Method | set |
Change the default connection name. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _cached |
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. |
Initialize the manager from the application configuration.
| Parameters | |
app:orionis.IApplication | Application container providing the database configuration. |
| Returns | |
None | No return value. |
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:str | Connection name to register. |
config:dict | Driver configuration for the connection. |
| Returns | |
None | No return value. |
| Raises | |
ValueError | If the name is empty. |
TypeError | If the configuration is not a mapping. |
Retrieve the configuration for a named connection.
| Parameters | |
name:str or None, optional | Connection name to look up, or None for the default. |
| Returns | |
dict[str, typing.Any] | The configuration dictionary for the requested connection. |
| Raises | |
orionis.database.ConnectionNotFoundException | If the connection is not declared in the configuration. |
Resolve the connection registered under the given name.
The connection is built on first access and cached for reuse.
| Parameters | |
name:str or None, optional | Connection name as declared in the database configuration, or None for the default connection. |
| Returns | |
orionis.database.contracts.IConnection | Connection bound to its configuration. |
| Raises | |
orionis.database.ConnectionNotFoundException | If the connection is not declared in the configuration. |
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, optional | Connection to dispose, or None to dispose every cached connection. |
| Returns | |
None | No return value. |
| Raises | |
Exception | The first ordinary failure after all selected connections settle. |
asyncio.CancelledError | If cancellation interrupts a disconnect, after remaining attempts. |
Change the default connection name.
| Parameters | |
name:str | Connection name to use as the default; must already be declared in the configuration. |
| Returns | |
None | No return value. |
| Raises | |
orionis.database.ConnectionNotFoundException | If the connection is not declared in the configuration. |