store

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBusyTimeoutMillis = 5000

Variables

This section is empty.

Functions

func QuoteIdent

func QuoteIdent(name string) string

Types

type Options

type Options struct {
	Path          string
	Schema        string
	SchemaVersion int
	MaxOpenConns  int
	MaxIdleConns  int
}

type QueryResult

type QueryResult struct {
	Columns []string         `json:"columns"`
	Rows    [][]any          `json:"rows"`
	Values  []map[string]any `json:"values,omitempty"`
}

type Store

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

func Open

func Open(ctx context.Context, opts Options) (*Store, error)

func OpenReadOnly

func OpenReadOnly(ctx context.Context, path string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) DB

func (s *Store) DB() *sql.DB

func (*Store) EnsureSchemaVersion

func (s *Store) EnsureSchemaVersion(ctx context.Context, version int) error

func (*Store) Path

func (s *Store) Path() string

func (*Store) Query

func (s *Store) Query(ctx context.Context, query string, args ...any) (QueryResult, error)

func (*Store) SchemaVersion

func (s *Store) SchemaVersion(ctx context.Context) (int, error)

func (*Store) WithTx

func (s *Store) WithTx(ctx context.Context, fn func(*sql.Tx) error) error

Jump to

Keyboard shortcuts

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