Documentation
¶
Overview ¶
Package sqlitejson runs one read-only SQLite query and returns its rows as JSON, in the shape of `sqlite3 -readonly -json`.
Firekeeper reads provider databases through the sqlite3 command line tool where it exists. Windows does not ship one, and asking users to install it would break the "download and run" setup, so Run falls back to an in-process read-only connection when sqlite3 is not on PATH. Both paths take the same arguments and produce the same JSON, so callers do not care which one ran.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrArguments = errors.New("sqlitejson: expected -readonly -json <database> <query>")
ErrArguments means Run was not given `-readonly -json <path> <query>`.
Functions ¶
func Run ¶
Run runs the sqlite3 command line tool with args when it is on PATH, and answers the same request in-process otherwise. args must be exactly "-readonly", "-json", the database path, and the query. A query that returns no rows produces no output, like sqlite3.
With the command line tool, a failure is the *exec.ExitError sqlite3 produced. In-process failures are sanitized: they never include the query.
Types ¶
This section is empty.