Db
Database access utilities for the dashboard.
Provides functions for accessing the runs database and security master database, including path resolution from environment variables and common query operations.
CHILD_TABLES = ['bars', 'bars_processed', 'order_submissions', 'order_cancellations', 'order_modifications', 'orders_accepted', 'orders_rejected', 'cancellations_accepted', 'cancellations_rejected', 'modifications_accepted', 'modifications_rejected', 'fills', 'expirations']
module-attribute
get_runs_db_path()
Return the path to the runs database from environment or default.
Returns:
| Type | Description |
|---|---|
str
|
Path to the runs SQLite database file. |
get_secmaster_path()
Return the path to the security master database from environment or default.
Returns:
| Type | Description |
|---|---|
str
|
Path to the security master SQLite database file. |
Source code in src/onesecondtrader/dashboard/db.py
get_runs(limit=50)
Fetch recent runs from the runs database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Maximum number of runs to return. |
50
|
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of run dictionaries with run_id, name, timestamps, status, config, and metadata. |