#!/bin/bash
# Usage: scripts/intel-q.sh "select ... from details ..."   (live query over the growing Mahally intel)
cd /root/ultron
D=data/mahally
VIEWS="create or replace view products as select * from read_json_auto(\"$D/products.jsonl\", ignore_errors=true, union_by_name=true);"
[ -s "$D/details.jsonl" ] && VIEWS="$VIEWS create or replace view details as select * from read_json_auto(\"$D/details.jsonl\", ignore_errors=true, union_by_name=true);"
duckdb -c "$VIEWS $1"
