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 ThreadedConnection: (source)
Constructors: ThreadedConnection.open(engine), ThreadedConnection(connection, worker)
Execute one Core checkout and buffer its results on a reserved thread.
| Async Class Method | open |
Open a checkout and release late resources if the caller is cancelled. |
| Method | __init__ |
Retain an open Core connection and the worker that opened it. |
| Method | _closed |
Release the completed coordinator and its copied execution context. |
| Method | _execute |
Consume the live cursor before the worker completes its operation. |
| Async Method | _release |
Return the native checkout before joining its reserved worker. |
| Async Method | begin |
Begin a root transaction on the reserved worker. |
| Async Method | close |
Return the checkout and join its worker, including during cancellation. |
| Async Method | execute |
Execute and materialize a statement entirely outside the event loop. |
| Async Method | invalidate |
Discard a connection whose transaction could not be settled. |
| Async Method | run |
Execute a Core schema callback on the connection's reserved worker. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _close |
Shared checkout release coordinator while cleanup remains pending. |
| Instance Variable | _closed |
Whether checkout release has started or already completed. |
| Instance Variable | _connection |
Open blocking Core connection. |
| Instance Variable | _worker |
Worker reserved for this checkout. |
Open a checkout and release late resources if the caller is cancelled.
| Parameters | |
engine:sqlalchemy.engine.Engine | Blocking engine supplying the checkout. |
| Returns | |
typing.Self | Connection with an independently reserved worker. |
Retain an open Core connection and the worker that opened it.
| Parameters | |
connection:sqlalchemy.engine.Connection | Open blocking Core connection. |
worker:orionis.database.threaded.worker.ThreadedWorker | Worker reserved for this checkout. |
| Returns | |
None | No return value. |
Release the completed coordinator and its copied execution context.
| Parameters | |
pending:asyncio.Task[None] | Shared checkout release task that has reached a terminal state. |
| Returns | |
None | No return value. |
Executable, parameters: Mapping[ str, Any] | Sequence[ Mapping[ str, Any]] | None) -> ThreadedResult:
(source)
¶
Consume the live cursor before the worker completes its operation.
| Parameters | |
statement:sqlalchemy.sql.expression.Executable | Core statement to execute. |
parameters:Mapping | Sequence[Mapping] | None | Statement or batch bindings. |
| Returns | |
orionis.database.threaded.result.ThreadedResult | Fully buffered rows and result metadata. |
Begin a root transaction on the reserved worker.
| Returns | |
orionis.database.threaded.transaction.ThreadedTransaction | Transaction adapter retaining the same worker. |
Return the checkout and join its worker, including during cancellation.
Concurrent close callers wait for the same native release and shutdown.
| Returns | |
None | No return value. |
Executable, parameters: Mapping[ str, Any] | Sequence[ Mapping[ str, Any]] | None = None) -> ThreadedResult:
(source)
¶
Execute and materialize a statement entirely outside the event loop.
| Parameters | |
statement:sqlalchemy.sql.expression.Executable | Compiled Core statement or parameterized textual query. |
parameters:Mapping | Sequence[Mapping] | None, optional | Bindings for one statement or a batch. |
| Returns | |
orionis.database.threaded.result.ThreadedResult | Memory-only result safe to consume after checkout release. |
Callable[ ..., T], *args: object, **kwargs: object) -> T:
(source)
¶
Execute a Core schema callback on the connection's reserved worker.
| Parameters | |
callback:collections.abc.Callable[..., T] | Callback receiving the blocking Core connection first. |
*args:object | Additional callback arguments. |
**kwargs:object | Additional callback options. |
| Returns | |
T | Callback result after the blocking work completes. |