sqlitejson

package
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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

View Source
var ErrArguments = errors.New("sqlitejson: expected -readonly -json <database> <query>")

ErrArguments means Run was not given `-readonly -json <path> <query>`.

Functions

func Run

func Run(ctx context.Context, args ...string) ([]byte, error)

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.

func RunInProcess

func RunInProcess(ctx context.Context, args ...string) ([]byte, error)

RunInProcess answers a Run request without the sqlite3 command line tool.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL