Skip to content

JSON-lines output of correlated statements (the records the TUI renders) #1

Description

@tejusarora

Great work — the zSql offset recovery is a genuinely clever trick, and attaching to the library rather than the app is the right call.

I noticed the standalone probe mode (yeet run src/probes/sqlite.js) dumps raw events for debugging — but those are uncorrelated (separate PREPARE/BIND/STEP lines tied by stmt pointer), so a consumer would have to re-implement the correlation your TUI layer already does in finalize().

Request: a mode that emits each completed, correlated statement as one JSON line on stdout — essentially the objects the dashboard renders: {process, pid, sql, params, rows, latency_ns, rc}. TUI stays the default; --json (or a second entry point) streams instead of rendering.

Use case: I maintain sqlsure, a deterministic semantic checker for SQL (~0.1 ms/check — validates statements against declared schema facts: join cardinality, aggregation safety, sensitive columns). sqlitefeed --json | sqlsure tail would be live semantic monitoring of every SQLite-backed process on a box, with zero app cooperation — your no-instrumentation property is exactly what makes that possible.

Happy to PR it — looks like the seam is where finalize() freezes a record before it lands in the statements signal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions