import { openDb } from "../server/src/db.js"; import { loadConfig } from "../server/src/config.js"; const db = openDb(loadConfig().dbPath); const p = db.prepare("SELECT id FROM products WHERE slug='oskar-lumo'").get() as {id:string}; const rows = db.prepare("SELECT id,source_id,ref_kind FROM shot_refs WHERE product_id=? AND shot_role='side'").all(p.id) as Array<{id:string;source_id:string;ref_kind:string}>; console.log(rows);