Utils
create_secmaster_db(db_path, schema_version=1)
Create a new security master SQLite database using a selected schema version.
The database file is created at the given path and initialized by executing the SQL script located in the schema_versions directory adjacent to this module.
The function expects the schema script to set PRAGMA user_version to the corresponding schema version and verifies this after execution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
Path
|
Filesystem path at which the SQLite database file will be created. |
required |
schema_version
|
int
|
Version number selecting the schema script to apply. |
1
|
Returns:
| Type | Description |
|---|---|
Path
|
The path to the created database file. |
Raises:
| Type | Description |
|---|---|
FileExistsError
|
If a file already exists at |
FileNotFoundError
|
If the schema script for |
DatabaseError
|
If the applied schema does not set the expected |