operations
Create an empty sqlite database.
get_demo_db()
Return an initialized SQLiteDB object with default settings.
Returns:
| Type | Description |
|---|---|
SQLiteDB
|
An initialized |
Raises:
| Type | Description |
|---|---|
Exception
|
When SQLite database initialization is unsuccessful |
Source code in src/red_utils/std/sqlite_utils/operations.py
get_sqlite_db(name=None, location=None)
Initialize a SQLiteDB object.
This is the same as simply instantiating a SQLiteDB object, like:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of the SQLite database. This will be used for the filename. |
None
|
location |
str | Path
|
The directory location to save the database. Note that Path values will be converted to string, then |
None
|
Returns:
| Type | Description |
|---|---|
SQLiteDB
|
An initialized |
Raises:
| Type | Description |
|---|---|
ValueError
|
When input value validation fails |
Exception
|
When SQLite database initialization fails |
Source code in src/red_utils/std/sqlite_utils/operations.py
init_sqlite_db(db_definition=None)
Initialize an empty SQLite database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_definition |
SQLiteDB
|
An initialized SQLiteDB object defining the SQLite database to create. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
|
Raises:
| Type | Description |
|---|---|
Exception
|
When initializing empty SQLite database fails |