Reference¶
elefast ¶
AsyncDatabase ¶
AsyncDatabase(
engine: AsyncEngine,
server: AsyncDatabaseServer,
sessionmaker_factory: Callable[
[AsyncEngine], Callable[[], AsyncSession]
] = async_sessionmaker,
)
AsyncDatabaseServer ¶
AsyncDatabaseServer(
engine: CanBeTurnedIntoAsyncEngine,
schema: AsyncMigrator | None = None,
)
AsyncMetadataMigrator ¶
Bases: AsyncMigrator
Database ¶
Database(
engine: Engine,
server: DatabaseServer,
sessionmaker_factory: Callable[
[Engine], Callable[[], Session]
] = sessionmaker,
)
Bases: AbstractContextManager
A Postgres database.
Note that this is usually obtained from DatabaseServer.create_database()
and you should not need to construct it yourself.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
engine
|
Engine
|
the engine holding the connections to the specific database. |
required |
server
|
DatabaseServer
|
a reference to the database server that created the database. |
required |
sessionmaker_factory
|
Callable[[Engine], Callable[[], Session]]
|
allows you to set custom options for the |
sessionmaker
|
DatabaseServer ¶
DatabaseServer(
engine: CanBeTurnedIntoEngine,
schema: Migrator | None = None,
debug=False,
)