sqlitecore

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sqlitecore is the plugin's SQLite: a native module implemented in Zig, which compiles SQLite's amalgamation into the module's library for every platform. Package sqlite wraps it in its connections, which serialize and validate the calls; nothing else uses it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	io.Closer
	// Run prepares sql, which must hold exactly one statement and no
	// transaction control or ATTACH, binds args to its parameters, and
	// steps it to the end, returning its rows when query is true.
	Run(sql string, args []Value, query bool) (Outcome, error)
	// Control runs a statement of transaction control, such as BEGIN
	// IMMEDIATE, COMMIT or ROLLBACK.
	Control(sql string) error
	// Autocommit reports whether the connection is outside a transaction.
	Autocommit() bool
	// Interrupt stops the statement running, and its wait for another
	// connection's lock, from any goroutine: the call running fails with
	// SQLite's SQLITE_INTERRUPT, or SQLITE_BUSY.
	Interrupt()
}

Conn is a connection. Its methods other than Interrupt are called one at a time.

type Engine

type Engine interface {
	// Open opens path, or ":memory:", creating a missing file unless
	// readOnly, with extended result codes on. busyMillis is how long an
	// operation waits for another connection's lock.
	Open(path string, readOnly bool, busyMillis int) (Conn, error)
	// Version is SQLite's version, as 3.53.4.
	Version() string
}

Engine opens connections.

func NewEngine

func NewEngine() (Engine, error)

NewEngine makes the implementation of Engine on this platform. It returns errors.ErrUnsupported where the module has none, or the system lacks what it needs.

type Outcome

type Outcome struct {
	Changes      int64
	LastInsertID int64
	Columns      []string
	Values       []Value
}

Outcome is what a statement did. Values holds the rows one after the other, each the length of Columns.

type Type

type Type int

Type is the type of a Value, by SQLite's fundamental datatype codes.

const (
	Null    Type = 5
	Integer Type = 1
	Real    Type = 2
	Text    Type = 3
	Blob    Type = 4
)

type Value

type Value struct {
	Type Type
	Int  int64
	Real float64
	Text string
	Blob []byte
}

Value is a value of SQLite: a parameter, or a column of a row.

Jump to

Keyboard shortcuts

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