db_connector
Helper class to connect to local SQLite database.
Classes
DbConnector
class DbConnector(pod_db_path: Path | None = None):Database connector to local SQLite database.
Arguments
pod_db_path: Optional path to the directory where the SQLite database files are stored. Defaults to None.
Subclasses
Variables
- static
db_files_location : pathlib.Path | None
ProjectDbConnector
class ProjectDbConnector(pod_db_path: Path | None = None):Database connector to local project SQLite database.
Arguments
pod_db_path: Optional path to the directory where the SQLite database files for the project are stored. Defaults to None.
Ancestors
Methods
get_project_db_connection
def get_project_db_connection(self, project_id: str) ‑> SqliteConnection:Establishes a connection to the database given a project id.
Opened through the connection layer, so the database is plaintext or SQLCipher by its header, and a new one is encrypted when cache encryption is on and a key is found.
Returns
The connection to the SQLite DB. Catch its errors with
SQLITE_ERRORS.
Raises
EncryptedStoreKeyError: If the database is encrypted and can't be opened with the cache key.