database
Standard SQLAlchemy models and different ways to open databases.
Package Contents
Classes
An SQLAlchemy mixin that provides an id column. |
|
Describes the way a database should be opened. |
Functions
Open an SQLAlchemy SQLite async database. |
|
|
Open an SQLAlchemy SQLite database. |
- class HasId
Bases:
sqlalchemy.orm.MappedAsDataclass
An SQLAlchemy mixin that provides an id column.
- id: sqlalchemy.orm.Mapped[int]
- class OpenMethod(*args, **kwds)
Bases:
enum.Enum
Describes the way a database should be opened.
- OPEN_IF_EXISTS
- OPEN_OR_CREATE
- NOT_EXISTS_AND_CREATE
- OVERWITE_IF_EXISTS
- open_async_database_sqlite(db_file: str, open_method: experimentation.database._open_method.OpenMethod = OpenMethod.OPEN_IF_EXISTS) sqlalchemy.ext.asyncio.AsyncEngine
Open an SQLAlchemy SQLite async database.
- Parameters:
db_file – File for the database.
open_method – The way the database should be opened.
- Returns:
The opened database.
- open_database_sqlite(db_file: str, open_method: experimentation.database._open_method.OpenMethod = OpenMethod.OPEN_IF_EXISTS) sqlalchemy.engine.Engine
Open an SQLAlchemy SQLite database.
- Parameters:
db_file – File for the database.
open_method – The way the database should be opened.
- Returns:
The opened database.