# sqlite — query-result dashboard from pipe-separated sqlite3 output
# sqlite3 app.db 'SELECT level,msg FROM logs' | arb -p sqlite
bars .levels
source .levels { in; nonempty; cut | 1; tally }
gauge .rows -max 1000
source .rows { in; nonempty; count }
tail .out
source .out { in; nonempty }
test "level tally from pipe-separated rows" {
given "" "INFO|started" "ERROR|boom" "INFO|ok"
run { in; nonempty; cut | 1; tally }
want "INFO\t2" "ERROR\t1"
}
test "row count skips blank lines" {
given "" "INFO|a" "ERROR|b"
run { in; nonempty; count }
want "2"
}