Documentation
¶
Index ¶
Constants ¶
View Source
const EnvBackend = "HERDR_SQLITE_BACKEND"
EnvBackend is the relay env var that selects the SQLite query backend.
Variables ¶
View Source
var ( // ErrOutputLimit means the query result exceeded the caller max byte budget. ErrOutputLimit = errors.New("sqlite query output limit exceeded") ErrUnavailable = errors.New("sqlite query backend unavailable") )
Functions ¶
func NormalizeJSONArray ¶
NormalizeJSONArray turns empty CLI stdout into a JSON array so callers can always json.Unmarshal into a slice.
Types ¶
type Backend ¶
type Backend string
Backend selects how conversation readers execute SQL against agent SQLite files.
func ParseBackend ¶
ParseBackend normalizes env / config values. Empty means auto.
type Executor ¶
type Executor interface {
// Ready reports whether this executor can run queries without a further
// install step (native is always ready; CLI needs LookPath success).
Ready() bool
QueryJSON(ctx context.Context, database, query string, maxBytes int) ([]byte, error)
}
Executor runs read-only SQL and returns sqlite3 -json shaped bytes (a JSON array).
func MustFromEnv ¶
func MustFromEnv() Executor
MustFromEnv returns FromEnv or a CLI fallback that reports not Ready when nothing works. Callers still check Ready/databases().
Click to show internal directories.
Click to hide internal directories.