SQLite
- class korus.database.backend.sqlite.sqlite.SQLiteBackend(path: str, new: bool = False, **kwargs)[source]
Bases:
DatabaseBackend,Connection- property annotation: SQLiteTableBackend
- property deployment: SQLiteTableBackend
- property file: SQLiteTableBackend
- property granularity: SQLiteTableBackend
- property job: SQLiteTableBackend
- property korus_version: str
Get Korus version used to create the database.
- Returns:
- version: str
The Korus version in the form x.y.z
- property label: SQLiteTableBackend
- property storage: SQLiteTableBackend
- property tag: SQLiteTableBackend
- property taxonomy: SQLiteTableBackend
- class korus.database.backend.sqlite.sqlite.SQLiteJobBackend(conn: Connection, codec: Codec)[source]
Bases:
SQLiteTableBackend
- class korus.database.backend.sqlite.sqlite.SQLiteTableBackend(conn: Connection, name: str, codec: Codec)[source]
Bases:
TableBackendGeneric SQLite table backend.
Note: The SQLite table and its associated _field table must be created before instantiating this class.
- Args:
- conn: sqlite3.Connection
The database connection
- name: str
The table name
- codec: korus.database.backend.sqlite.encode.Codec
Encoder-decoder for inserting and retrieving data from the database
- add_codec(field_name: str, field_type: Any)[source]
Add default encoding and decoding rules for the specified field.
- Args:
- field_name: str
The field’s name
- field_type:
The field’s type
- get(indices: int | list[int] | None = None, fields: str | list[str] | None = None, return_indices: bool = False) list[tuple][source]
- get_fields() list[dict][source]
Get custom field descriptions saved to the database
- Returns:
- field_attrs: list[dict]
The field attributes