sqlite

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 18 Imported by: 0

README

sqlite

The fastest cgo-free SQLite driver for Go's database/sql.
It builds with CGO_ENABLED=0, and on most workloads it beats the cgo driver too.

English · 简体中文 · Benchmarks · How it works

Go Reference test

It is for Go programs that keep their data in SQLite and want to stay plain Go: one static binary, cross-compiled from any machine, no C compiler in the build or in the container. Until now that meant giving up speed. Here the cgo driver is the one that falls behind.

Benchmarks

Time per operation, lower is better, the median of 6 runs. The best of a row is in bold when its 95% confidence interval overlaps no other driver's. WAL, synchronous=NORMAL, the same settings checked on every driver.

linux/amd64 (AMD EPYC 7B13, Go 1.27.2, commit cc1ede5):

Workload this driver mattn (cgo) modernc ncruces
Insert one row 18.7 µs 19.6 µs 23.4 µs 21.5 µs
Insert 1000 rows in a transaction 1.30 ms 1.47 ms 1.94 ms 1.67 ms
Read one row by key 3.58 µs 6.70 µs 8.45 µs 6.54 µs
Read 100k rows 34.9 ms 73.4 ms 76.4 ms 50.2 ms
Join and group 2.87 ms 2.63 ms 4.51 ms 4.37 ms
Find a user with 400 comments 509 µs 830 µs 1.05 ms 762 µs
Read 100 rows of 200 KB text 8.85 ms 6.99 ms 8.13 ms 8.02 ms
Read by key, 8 threads 1.65 µs 2.00 µs 2.18 µs 2.29 µs
Insert, 8 goroutines at once 9.43 µs 19.4 µs 24.2 µs 21.9 µs
Insert, 64 goroutines at once 3.40 µs 20.2 µs 27.0 µs 27.0 µs
Insert, 64 goroutines, synchronous=FULL 21.0 µs 2.48 ms 5.31 ms 1.12 ms

darwin/arm64 (Apple M4, Go 1.27.2, commit 90e0e83, other work ran on the machine: read differences under 30% as noise):

Workload this driver mattn (cgo) modernc ncruces
Insert one row 6.32 µs 6.21 µs 7.96 µs 7.00 µs
Insert 1000 rows in a transaction 456 µs 594 µs 748 µs 583 µs
Read one row by key 1.12 µs 1.96 µs 2.86 µs 2.07 µs
Read 100k rows 14.4 ms 31.6 ms 30.1 ms 20.7 ms
Join and group 1.56 ms 1.19 ms 2.65 ms 1.90 ms
Find a user with 400 comments 236 µs 396 µs 594 µs 345 µs
Read 100 rows of 200 KB text 4.87 ms 3.58 ms 3.99 ms 3.64 ms
Read by key, 10 threads 1.29 µs 1.69 µs 1.79 µs 2.49 µs
Insert, 8 goroutines at once 3.30 µs 6.94 µs 8.12 µs 43.5 µs
Insert, 64 goroutines at once 1.37 µs 9.53 µs 8.28 ms 83.3 µs

Where another driver still wins: work that stays inside SQLite (the join), where this driver runs the same C but as Go assembly, and reading large text values. Why reads and many writers are faster, the versions of each driver, and how to run it all again are in docs/benchmarks.md.

Install

go get github.com/liustack/sqlite

Go 1.26.6 to 1.27 (see Moving to a new Go). linux and darwin on amd64 and arm64, windows on amd64.

Use

import (
	"database/sql"

	_ "github.com/liustack/sqlite"
)

db, err := sql.Open("sqlite", "file:app.db?_pragma=journal_mode(WAL)&_pragma=synchronous(NORMAL)")

The name is a file, :memory: or a SQLite URI. _pragma=name(value) runs a PRAGMA on every new connection, and _txlock=immediate makes BEGIN take the write lock at once. A connection waits 5 seconds for a lock unless busy_timeout says otherwise. The rest is on pkg.go.dev.

SQL functions, aggregates, window functions, collations and virtual tables written in Go go on the connector, so that every connection of the pool has them:

c, err := sqlite.NewConnector("file:app.db",
	sqlite.WithFunction("reverse", 1, reverse, sqlite.Deterministic),
	sqlite.WithAggregate("mode", 1, newMode),
	sqlite.WithCollation("fold", fold),
	sqlite.WithModule("files", connectFiles))
db := sql.OpenDB(c)

sqlite.Register gives them to every connector sql.Open makes after it. An error or a panic in a function or a virtual table fails its statement, not the connection.

Common functions come ready in packages under ext/: regexp (the REGEXP operator, regexp_like, regexp_substr, regexp_replace), uuid, hash (md5, sha1, sha256, sha512, crc32), stats (variance and standard deviation), unicode (upper and lower case and a case-blind collation for every script), csv (a CSV file as a table), series (generate_series) and vec (vector distances, to find the rows nearest to an embedding). Each is one option, and sqlite.Join hands several over as one:

sqlite.Register(sqlite.Join(regexp.Option(), uuid.Option()))

Full-text search (FTS5), the spatial index (R*Tree), the math functions and median and percentile (percentile) are built in, with nothing to import. The math functions give the same bits on every target.

The driver registers as sqlite, as modernc.org/sqlite and glebarez/go-sqlite do, so a program that imports one of them as well panics at start. Open the database with sql.OpenDB(sqlite.NewConnector(dsn)) then.

What changes for you

  • No C anywhere. CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build from a Mac works, and the binary runs in a scratch image.
  • Many writers stop waiting on each other. When goroutines write at the same time, the driver runs their autocommit INSERT, UPDATE and DELETE statements as one transaction and commits once. Each call still gets its own error, LastInsertId and RowsAffected, and returns only after the commit, so nothing is less durable. Transactions you open yourself are never merged. How it works
  • Writers queue instead of failing with database is locked. Inside the driver one connection of your program writes a file at a time, and the others queue for it, up to busy_timeout, instead of sleeping in SQLite's busy handler. A transaction that reads first and writes later can still fail when another wrote in between, so start such transactions with _txlock=immediate. Other processes still meet SQLite's own locks.
  • Reads cost less. A call into SQLite is a plain Go call, and on Go 1.27 scanning a number into your variable allocates nothing (a string costs one allocation, its own).

Why you can trust it

  • Safety comes first, speed second, memory third. A change that is faster but could lose a write, return a wrong result or weaken a commit is not taken. Group commit keeps a SAVEPOINT around every merged statement for this reason, though it costs speed.
  • The C is SQLite's, unchanged. engine/ holds the 3.54.1 amalgamation as released, checked against its hash (engine/vendor.sh --verify). The compile options sit in one file, each with its reason.
  • The Go assembly is made, never written. LLVM compiles the C, and a generator turns what LLVM writes into Go assembly. It stops on anything it has no rule for, and checks the linked binary. make check-gen fails when the checked-in assembly is not what the generator makes from engine/ today.
  • The numbers show where it loses. The tables above keep the rows where another driver is faster, and docs/benchmarks.md says how each run was taken and what else ran on the machine.
  • Every push is tested on linux/amd64, linux/arm64, darwin/arm64 and windows/amd64 (with the race detector, except on windows), with the sqlite3 shell writing the same database at the same time, and with processes killed while they write.

Not there yet

  • No loadable extensions: SQLite is built without load_extension.
  • No shared cache: cache=shared gives an error. For a memory database that all connections of a pool see, use file:/name?vfs=memdb.
  • Double-quoted strings are identifiers only (SQLITE_DQS=0, as SQLite advises): write string literals in single quotes.
  • windows/arm64 and other targets do not build.

Documentation

Doc Read it when
Benchmarks You want the full numbers, or to run them on your machine
Architecture You want to know how C becomes Go assembly, or how group commit works
Upstream You want to know which SQLite it is, or how it moves to a new one
Testing, Commits You are about to change the code

Thanks

To D. Richard Hipp and the SQLite developers for SQLite, and to musl for the string functions the engine links. To the authors of mattn/go-sqlite3, modernc.org/sqlite and ncruces/go-sqlite3, who showed the ways SQLite can live in Go and whose drivers this one is measured against.

License

MIT for the code of this repository. SQLite is in the public domain, and musl's code keeps its MIT license. NOTICE.md says which license covers which path.

Documentation

Overview

Package sqlite is a SQLite driver for database/sql that needs no cgo.

It registers itself as "sqlite":

db, err := sql.Open("sqlite", "file:app.db?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)")

modernc.org/sqlite and github.com/glebarez/go-sqlite register the same name, so a program that imports one of them as well panics at start. Use sql.OpenDB(sqlite.NewConnector(dsn)) to open a database without the registered name.

The data source name

A file name, ":memory:", or a URI ("file:app.db?mode=ro"), which SQLite reads itself (https://sqlite.org/uri.html). These parameters are the driver's and SQLite does not see them:

  • _pragma=name(value): a PRAGMA run on every new connection, in order. It may be given more than once.
  • _txlock=deferred, immediate or exclusive: how BEGIN starts a transaction (deferred by default). A read-only transaction always starts deferred.
  • _time_format=sqlite: how a time.Time is written. The only format, and the default, is "2006-01-02 15:04:05.999999999-07:00".

A connection waits 5 seconds for a lock unless a _pragma sets busy_timeout.

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrUnusablePlan = errors.New("sqlite: no usable plan for the virtual table")

ErrUnusablePlan is what BestIndex returns when the scan cannot work with the constraints it was given.

Functions

func Register

func Register(opts ...Option)

Register adds opts to every connector made after it, by sql.Open or by NewConnector, before the connector's own options. Call it before opening databases, as in an init function. An option it was given that is not valid fails those connectors.

Types

type Aggregate

type Aggregate interface {
	Step(args []driver.Value) error
	Final() (driver.Value, error)
}

Aggregate is the state of one group of an aggregate function written in Go. Step runs for each row of the group, with arguments as a Func gets them, then Final once, with a result as a Func gives it. An error or a panic in either is the error of the statement.

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

Connector opens connections to one database.

func NewConnector

func NewConnector(dsn string, opts ...Option) (*Connector, error)

NewConnector parses dsn, for sql.OpenDB. Its connections get what Register gave, then opts.

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context) (driver.Conn, error)

Connect opens a connection.

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

Driver is the driver of the connector.

type Driver

type Driver struct{}

Driver is the database/sql driver.

func (*Driver) Open

func (d *Driver) Open(dsn string) (driver.Conn, error)

Open opens a connection to the database named by dsn.

func (*Driver) OpenConnector

func (d *Driver) OpenConnector(dsn string) (driver.Connector, error)

OpenConnector parses dsn once for every connection of a pool.

type Func

type Func func(args []driver.Value) (driver.Value, error)

Func is a SQL function written in Go.

Its arguments are copies, each an int64, float64, string, []byte or nil, so it may keep them. It returns a value database/sql can bind (an integer, float, bool, string, []byte, time.Time, nil or a driver.Valuer), or an error, which becomes the error of the statement. A panic in it is recovered and becomes the error of the statement too: the connection stays good.

It may run on any connection of its connector, and from several goroutines at once. It must not use the database: it runs in the middle of a statement. It may also run more than once for the same row: SQLite does not promise how often it calls a function, and group commit runs a batch again when a failure of one statement ended its transaction. Keep side effects out of it, or make them safe to repeat.

type FuncFlag

type FuncFlag int

FuncFlag tells SQLite how a function behaves.

const (
	// Deterministic: the same arguments always give the same result, so
	// SQLite may compute it once, and use it in indexes and generated
	// columns.
	Deterministic FuncFlag = csqlite.FuncDeterministic
	// DirectOnly: the function may be called only from SQL the program
	// runs, never from a trigger, view, index or generated column of the
	// schema. Give it to a function with side effects, so that a database
	// file someone else made cannot call it.
	DirectOnly FuncFlag = csqlite.FuncDirectOnly
	// Innocuous: the function has no side effects and reveals nothing, so
	// it is safe wherever SQL comes from.
	Innocuous FuncFlag = csqlite.FuncInnocuous
)

type IndexConstraint added in v0.1.3

type IndexConstraint struct {
	Column int // -1 for the rowid
	Op     IndexOp
	Usable bool
}

IndexConstraint is a term of the WHERE clause: column Op value. A constraint that is not Usable may not get an ArgvIndex.

type IndexInfo added in v0.1.3

type IndexInfo struct {
	Constraints []IndexConstraint
	OrderBy     []IndexOrderBy
	// ColUsed has bit i set when the statement uses column i, and bit 63
	// for any column from 63 up.
	ColUsed uint64

	// Usage is as long as Constraints, one for each.
	Usage []IndexUsage
	// IdxNum and IdxStr name the plan for Filter.
	IdxNum int
	IdxStr string
	// OrderByConsumed says the scan gives its rows in the order of OrderBy.
	OrderByConsumed bool
	EstimatedCost   float64
	EstimatedRows   int64
	// Unique says the scan gives at most one row.
	Unique bool
}

IndexInfo is the question BestIndex answers. Constraints, OrderBy and ColUsed are the question. The rest is the answer, with SQLite's defaults in EstimatedCost and EstimatedRows.

type IndexOp added in v0.1.3

type IndexOp int

IndexOp is the operator of a constraint.

const (
	IndexEQ        IndexOp = csqlite.IndexEQ
	IndexGT        IndexOp = csqlite.IndexGT
	IndexLE        IndexOp = csqlite.IndexLE
	IndexLT        IndexOp = csqlite.IndexLT
	IndexGE        IndexOp = csqlite.IndexGE
	IndexMatch     IndexOp = csqlite.IndexMatch
	IndexLike      IndexOp = csqlite.IndexLike
	IndexGlob      IndexOp = csqlite.IndexGlob
	IndexRegexp    IndexOp = csqlite.IndexRegexp
	IndexNE        IndexOp = csqlite.IndexNE
	IndexIsNot     IndexOp = csqlite.IndexIsNot
	IndexIsNotNull IndexOp = csqlite.IndexIsNotNull
	IndexIsNull    IndexOp = csqlite.IndexIsNull
	IndexIs        IndexOp = csqlite.IndexIs
	IndexLimit     IndexOp = csqlite.IndexLimit
	IndexOffset    IndexOp = csqlite.IndexOffset
)

The operators of IndexConstraint.

type IndexOrderBy added in v0.1.3

type IndexOrderBy struct {
	Column int
	Desc   bool
}

IndexOrderBy is a term of the ORDER BY clause.

type IndexUsage added in v0.1.3

type IndexUsage struct {
	ArgvIndex int
	Omit      bool
}

IndexUsage is what BestIndex says of a constraint. ArgvIndex > 0 hands its value to Filter, at args[ArgvIndex-1]: give each used constraint its own number from 1 up. Omit says the scan only gives rows that meet it, so SQLite need not check them again.

type ModuleFlag added in v0.1.3

type ModuleFlag int

ModuleFlag tells SQLite how a module behaves.

const (
	// EponymousOnly: the module is only used by its name, as a function
	// whose arguments are its hidden columns (a table-valued function such
	// as generate_series). CREATE VIRTUAL TABLE with it fails. Without the
	// flag, the module serves only CREATE VIRTUAL TABLE.
	EponymousOnly ModuleFlag = csqlite.ModEponymousOnly
	// ModuleDirectOnly: its tables may be used only by SQL the program
	// runs and by temp triggers and views, never by a trigger or a view
	// stored in a database. Give it to a module that reaches
	// outside the database, such as one that reads files, so that a
	// database file someone else made cannot use it. It cannot go with
	// ModuleInnocuous: a table has one of the two.
	ModuleDirectOnly ModuleFlag = csqlite.ModDirectOnly
	// ModuleInnocuous: the module has no side effects and reveals nothing,
	// so its tables are safe wherever SQL comes from.
	ModuleInnocuous ModuleFlag = csqlite.ModInnocuous
	// ModuleWritable: its tables take INSERT, UPDATE and DELETE when they are
	// VUpdaters. Those statements never merge with others in group commit:
	// the table's own transaction is outside what a merged batch can undo.
	// It cannot go with EponymousOnly.
	ModuleWritable ModuleFlag = csqlite.ModWritable
)

type Option

type Option struct {
	// contains filtered or unexported fields
}

An Option adds something to the connections of a connector: give it to NewConnector, or to Register for the connectors sql.Open makes.

func Join

func Join(opts ...Option) Option

Join makes one Option of several, applied in order: how a package of functions hands them over.

func WithAggregate

func WithAggregate(name string, nArg int, newAggregate func() Aggregate, flags ...FuncFlag) Option

WithAggregate makes an aggregate function name of nArg arguments: for each group, newAggregate makes a state. A group of no rows gets one too, for Final alone.

func WithCollation

func WithCollation(name string, cmp func(a, b string) int) Option

WithCollation makes cmp the collation name, for COLLATE name in queries and in the schema. cmp returns a negative number, 0 or a positive number as a sorts before, with or after b, and must be a total order. A panic in cmp fails the statement with the panic, and SQLite undoes it as it does when memory runs out: it rolls back the statement, or the whole transaction. When the whole transaction is gone, the next statements of it and its Commit fail. The connection stays good.

func WithFunction

func WithFunction(name string, nArg int, fn Func, flags ...FuncFlag) Option

WithFunction makes fn the SQL function name of nArg arguments (-1 for any number) on every connection of the connector. A later option of the same name and nArg replaces an earlier one.

Example
//go:build ((linux || darwin) && (amd64 || arm64)) || (windows && amd64)

package main

import (
	"database/sql"
	"database/sql/driver"
	"fmt"
	"strings"

	"github.com/liustack/sqlite"
)

type longest struct{ s string }

func (l *longest) Step(args []driver.Value) error {
	if s, ok := args[0].(string); ok && len(s) > len(l.s) {
		l.s = s
	}
	return nil
}

func (l *longest) Final() (driver.Value, error) { return l.s, nil }

func main() {
	reverse := func(args []driver.Value) (driver.Value, error) {
		s, _ := args[0].(string)
		r := []rune(s)
		for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
			r[i], r[j] = r[j], r[i]
		}
		return string(r), nil
	}
	c, err := sqlite.NewConnector(":memory:",
		sqlite.WithFunction("reverse", 1, reverse, sqlite.Deterministic),
		sqlite.WithAggregate("longest", 1, func() sqlite.Aggregate { return &longest{} }),
		sqlite.WithCollation("nocase_go", func(a, b string) int {
			return strings.Compare(strings.ToLower(a), strings.ToLower(b))
		}))
	if err != nil {
		panic(err)
	}
	db := sql.OpenDB(c)
	defer db.Close()

	var r, l, first string
	err = db.QueryRow(`
		WITH w(word) AS (VALUES ('Banana'), ('apple'), ('cherry'))
		SELECT reverse('stressed'), longest(word),
			(SELECT word FROM w ORDER BY word COLLATE nocase_go LIMIT 1)
		FROM w`).Scan(&r, &l, &first)
	if err != nil {
		panic(err)
	}
	fmt.Println(r, l, first)
}
Output:
desserts Banana apple

func WithModule added in v0.1.3

func WithModule(name string, connect func(args []string) (VTable, error), flags ...ModuleFlag) Option

WithModule makes a virtual table module name on every connection of the connector. connect makes a table for CREATE VIRTUAL TABLE t USING name(args...), and when a connection first uses such a table, or, for an EponymousOnly module, for its name used as a table, with no args. args are the arguments as SQL wrote them, without quotes taken off. A later option of the same name replaces an earlier one.

func WithWindow added in v0.1.3

func WithWindow(name string, nArg int, newWindow func() Window, flags ...FuncFlag) Option

WithWindow makes an aggregate window function name of nArg arguments, which also works as an aggregate without OVER: for each partition or group, newWindow makes a state.

type VCursor added in v0.1.3

type VCursor interface {
	// Filter starts the scan with the plan BestIndex chose: idxNum and
	// idxStr as it set them, and args the values of the constraints it gave
	// an ArgvIndex, args[ArgvIndex-1] for each. The values are copies, as
	// a Func gets them. Filter may run again on the same cursor, to start
	// over.
	Filter(idxNum int, idxStr string, args []driver.Value) error
	// Next goes to the next row.
	Next() error
	// EOF says the scan is past its last row. It runs after Filter and
	// after each Next.
	EOF() bool
	// Column is column i of the row, a value as a Func returns.
	Column(i int) (driver.Value, error)
	// RowID is the rowid of the row.
	RowID() (int64, error)
	Close() error
}

VCursor is a scan of a VTable.

type VSavepointer added in v0.1.3

type VSavepointer interface {
	Savepoint(n int) error
	Release(n int) error
	RollbackTo(n int) error
}

VSavepointer is a VTransactor that keeps savepoints, so that a statement that fails inside a transaction is undone in the table too: Savepoint(n) marks the state, RollbackTo(n) goes back to the state at savepoint n, and Release(n) forgets the marks from n on. A table that joined the transaction after savepoint n was opened has no mark for it: RollbackTo(n) then goes back to the state at Begin.

type VTable added in v0.1.3

type VTable interface {
	// Schema is the CREATE TABLE statement of its columns, such as
	// "CREATE TABLE x(value, start HIDDEN)". The name of the table in it
	// is not used. A HIDDEN column is not in SELECT *, and when the module
	// is used by its name as a function, its arguments give the hidden
	// columns, in order: they reach BestIndex as constraints of EQ.
	Schema() string
	// BestIndex chooses how to scan the table under the constraints of
	// info, and says what the scan costs. SQLite may ask several times
	// with different constraints and runs the cheapest. It returns
	// ErrUnusablePlan when the scan cannot work with the constraints that
	// are usable, such as when an argument it needs is missing.
	BestIndex(info *IndexInfo) error
	// Open makes a cursor for a scan.
	Open() (VCursor, error)
	// Disconnect ends the table on its connection.
	Disconnect() error
}

VTable is a table of a virtual table module, written in Go, on one connection. It only reads, unless its module is ModuleWritable and it is also a VUpdater.

Each connection connects a table of its own, and uses it from one goroutine at a time. Something the tables of several connections share is used from several goroutines at once. Like a Func, a table must not use the database.

type VTransactor added in v0.1.3

type VTransactor interface {
	Begin() error
	Sync() error
	Commit() error
	Rollback() error
}

VTransactor is a VUpdater that takes part in the transactions of its connection. Begin runs before the first write of the table in a transaction, and as CREATE VIRTUAL TABLE makes the table. Sync, then Commit, run at the commit, or Rollback at the rollback. A failed Sync fails the commit. Commit runs after the database committed, so its error is lost: write what must last in Sync. Without VTransactor, a statement that fails leaves what it wrote to the table.

type VUpdater added in v0.1.3

type VUpdater interface {
	// Insert adds a row of the values cols. rowid is nil when the
	// statement gave none, and Insert chooses one. It returns the rowid of
	// the row, which last_insert_rowid() and LastInsertId give. In a table
	// declared WITHOUT ROWID, rowid is always nil, the key is in cols, and
	// the number returned only goes to last_insert_rowid().
	Insert(rowid driver.Value, cols []driver.Value) (int64, error)
	// Update changes the row oldRowid to newRowid and cols.
	Update(oldRowid, newRowid driver.Value, cols []driver.Value) error
	Delete(rowid driver.Value) error
}

VUpdater is a VTable that takes INSERT, UPDATE and DELETE, of a module made with ModuleWritable. A rowid is an int64, or in a table declared WITHOUT ROWID the value of its PRIMARY KEY. Column values come as a Func's arguments. The table does not learn the statement's ON CONFLICT clause: an error fails the statement, also in INSERT OR IGNORE.

type Window added in v0.1.3

type Window interface {
	Aggregate
	Value() (driver.Value, error)
	Inverse(args []driver.Value) error
}

Window is the state of one partition of an aggregate window function written in Go, used with OVER. As the frame moves, Step adds a row that came into it and Inverse takes out a row that left it, with the arguments Step had for that row. Value gives the result for the rows in the frame, and may be asked when the frame has no rows. Final runs once at the end of the partition, and gives the result when the function is used without OVER.

Directories

Path Synopsis
ext
csv
Package csv gives SQLite the csv virtual table of SQLite's csv extension (ext/misc/csv.c), ported to Go:
Package csv gives SQLite the csv virtual table of SQLite's csv extension (ext/misc/csv.c), ported to Go:
hash
Package hash gives SQLite hash functions:
Package hash gives SQLite hash functions:
internal/arg
Package arg reads the arguments of the functions of ext/.
Package arg reads the arguments of the functions of ext/.
internal/sqltest
Package sqltest runs the queries of the tests of ext/.
Package sqltest runs the queries of the tests of ext/.
regexp
Package regexp gives SQLite the REGEXP operator and regexp functions, with Go's regexp syntax (RE2: no backreferences, and time linear in the text).
Package regexp gives SQLite the REGEXP operator and regexp functions, with Go's regexp syntax (RE2: no backreferences, and time linear in the text).
series
Package series gives SQLite generate_series, the table-valued function of SQLite's series extension (ext/misc/series.c), ported to Go:
Package series gives SQLite generate_series, the table-valued function of SQLite's series extension (ext/misc/series.c), ported to Go:
stats
Package stats gives SQLite the variance and the standard deviation as aggregate functions:
Package stats gives SQLite the variance and the standard deviation as aggregate functions:
unicode
Package unicode gives SQLite case rules for every script, where SQLite's own upper, lower and NOCASE know only ASCII:
Package unicode gives SQLite case rules for every script, where SQLite's own upper, lower and NOCASE know only ASCII:
uuid
Package uuid gives SQLite the functions of SQLite's own uuid extension:
Package uuid gives SQLite the functions of SQLite's own uuid extension:
vec
Package vec gives SQLite vector functions, for similarity search over vectors kept in ordinary tables:
Package vec gives SQLite vector functions, for similarity search over vectors kept in ordinary tables:
internal
extapi
Package extapi gives the packages of ext/ what the driver does not offer its users.
Package extapi gives the packages of ext/ what the driver does not offer its users.
goversion
Package goversion stops a build with a Go newer than the one the engine was checked with.
Package goversion stops a build with a Go newer than the one the engine was checked with.
replhook
Package replhook gives the replicator (replica/internal/capture) what it needs of the driver and the driver does not offer its users.
Package replhook gives the replicator (replica/internal/capture) what it needs of the driver and the driver does not offer its users.
vfs
Package vfs is the operating system layer of SQLite, in Go: the files, locks and shared memory that os_unix.c gives a normal build.
Package vfs is the operating system layer of SQLite, in Go: the files, locks and shared memory that os_unix.c gives a normal build.
Package replica copies a database of the driver to S3 (AWS S3, Cloudflare R2, MinIO and the other stores that speak its API) as it changes, so that it can be restored after the machine is lost.
Package replica copies a database of the driver to S3 (AWS S3, Cloudflare R2, MinIO and the other stores that speak its API) as it changes, so that it can be restored after the machine is lost.
internal/capture
Package capture copies each change of a database in WAL mode into LTX files in a local staging folder, from which the replicator uploads them, and runs the database's checkpoints, so that no frame is checkpointed before it is copied.
Package capture copies each change of a database in WAL mode into LTX files in a local staging folder, from which the replicator uploads them, and runs the database's checkpoints, so that no frame is checkpointed before it is copied.
internal/s3
Package s3 is the small client of the S3 protocol the replicator uses: PUT, multipart upload, ranged GET, ListObjectsV2 and DELETE, signed with SigV4, against AWS S3 and the stores that speak its protocol (Cloudflare R2, MinIO and the like).
Package s3 is the small client of the S3 protocol the replicator uses: PUT, multipart upload, ranged GET, ListObjectsV2 and DELETE, signed with SigV4, against AWS S3 and the stores that speak its protocol (Cloudflare R2, MinIO and the like).
internal/s3test
Package s3test gives tests an S3 store:
Package s3test gives tests an S3 store:

Jump to

Keyboard shortcuts

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