aimbat.db
Database engine for the AIMBAT project file.
The engine is created from Settings.db_url (see aimbat._config), which
defaults to a SQLite database at aimbat.db in the current working directory.
The path can be overridden via environment variable or .env file:
AIMBAT_PROJECT=/path/to/project.db # derives db_url automatically
AIMBAT_DB_URL=sqlite+pysqlite:///absolute/path/to/project.db # explicit override
For SQLite connections, PRAGMA foreign_keys=ON is set automatically on every
new connection to enforce referential integrity.
Attributes:
| Name | Type | Description |
|---|---|---|
engine |
AIMBAT database engine. |
set_sqlite_pragma
set_sqlite_pragma(
dbapi_connection: Connection,
connection_record: ConnectionPoolEntry,
) -> None
Enable foreign key support for each new SQLite connection.