korbase.korvex
The Korvex integration: connect a korbase database to a Korvex app.
korvex ¶
Korvex integration: open the pool at startup and inject it into handlers.
KorvexDatabase ¶
KorvexDatabase(app: Any)
The database of a Korvex app, with dependencies for handlers.
Use Depends(kdb.database) for the Database and
Depends(kdb.transaction) for a Transaction per request.
Bind to app; use install() instead.
transaction
async
¶
transaction() -> AsyncIterator[Transaction]
Dependency: a Transaction that commits unless the handler raises.
install ¶
install(
app: Any, dsn: str, **db_opts: Any
) -> KorvexDatabase
Open a Database on dsn when app starts and close it when it stops.