import sqlite3 from config import DB_PATH def get_db(): """Get database connection (staging or prod).""" conn = sqlite3.connect(DB_PATH) conn.row_factory = sqlite3.Row return conn def init_db(): """Initialize tables (safe to run multiple times).""" conn = get_db() # Create tables if they don't exist # Documents table, events table, maintenance table conn.close()