sqlite

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sqlite is the SQLite record source for `ds:table` (docs/SPEC.md §9.5, §37.1): rows of a table become records with one field per column. Filtering, sorting, projection, and limits are applied by the root records package, so every source answers the same query language; the database only supplies rows.

The driver is modernc.org/sqlite, pure Go, so a `ds` binary with this source needs no C toolchain.

Index

Constants

View Source
const DriverName = "sqlite"

DriverName is the database/sql driver this package registers.

Variables

View Source
var ErrBadTable = errors.New("sqlite records: table must be an identifier")

ErrBadTable rejects a table name that is not a plain identifier. Table names cannot be bound as parameters, so they are validated instead of quoted; a `ds:table kind=` in a doc is user input.

View Source
var ErrNoTable = errors.New("sqlite records: no table: set kind= on the directive or table in [records]")

ErrNoTable is returned when neither kind= nor a default table names one.

Functions

func Open

func Open(path, defaultTable string) (records.Source, io.Closer, error)

Open opens the database file read-only and returns a source over it plus the handle to close when done. defaultTable answers queries without a kind=; "" means kind= is required.

func Source

func Source(db *sql.DB, defaultTable string) records.Source

Source wraps an open handle. kind= selects the table; the rest of the query is applied to the rows in memory by records.Apply.

Types

This section is empty.

Jump to

Keyboard shortcuts

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