sqlite

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

func NewAdapter added in v0.11.0

func NewAdapter(conn *sql.DB) (*Adapter, error)

NewAdapter wraps an already-open *sql.DB as a sqlite Adapter. Used when the caller needs to retain the *sql.DB itself (e.g. to share the pool with code that writes to the database outside of Adapter.Query, such as the Bring & Join local database).

func Open

func Open(path string) (*Adapter, error)

func OpenReadonly added in v0.11.0

func OpenReadonly(path string) (*Adapter, error)

OpenReadonly opens the database at path with SQLite's read-only URI mode.

This is the connection-level half of readonly and the only one asql has verified: with mode=ro the driver refuses writes, and — unlike the query_only pragma — the session cannot lift the restriction on itself (`PRAGMA query_only(0)` succeeds but writes still fail). ATTACH does succeed under mode=ro, so the statement guard has to refuse it separately.

func (*Adapter) Close

func (a *Adapter) Close() error

func (*Adapter) Columns added in v0.6.0

func (a *Adapter) Columns(ctx context.Context, tableName string) ([]string, error)

func (*Adapter) Query

func (a *Adapter) Query(ctx context.Context, query string) (db.QueryResult, error)

func (*Adapter) QuoteIdentifier added in v0.5.1

func (a *Adapter) QuoteIdentifier(name string) string

func (*Adapter) Schema

func (a *Adapter) Schema(ctx context.Context) (string, error)

func (*Adapter) Tables

func (a *Adapter) Tables(ctx context.Context) ([]string, error)

func (*Adapter) Type

func (a *Adapter) Type() string

Jump to

Keyboard shortcuts

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