Push Tracker
ria-ran--sim-drop/scripts/init_db.py

23 lines
557 B
Python
Raw Normal View History

#!/usr/bin/env python3
"""Initialize the SQLite subscriber database."""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from server.database import init_db
from server.utils import ensure_parent_dir, load_config
def main():
config_path = os.environ.get("CONFIG_PATH", "config.yaml")
cfg = load_config(config_path)
db_path = cfg["database"]["path"]
ensure_parent_dir(db_path)
init_db(db_path)
print(f"Database initialized at {db_path}")
if __name__ == "__main__":
main()