driver

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDBIsClosed          = errors.New("any-store: db is closed")
	ErrDBIsNotOpened       = errors.New("any-store: db is not opened")
	ErrIncompatibleVersion = errors.New("any-store: incompatible version")
	ErrStmtIsClosed        = errors.New("any-store: stmt is closed")
)

Functions

func StmtExecNoResults

func StmtExecNoResults(stmt *sqlite.Stmt) (err error)

Types

type Config added in v0.2.0

type Config struct {
	Pragma                    map[string]string
	ReadCount                 int
	PreAllocatedPageCacheSize int
	SortRegistry              *registry.SortRegistry
	FilterRegistry            *registry.FilterRegistry
	Version                   int
	ReadConnTTL               time.Duration

	// WriteObservers will be called synchronously on acquire and release of the write connection
	WriteObservers []WriteObserver
}

type Conn

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

func (*Conn) Backup added in v0.1.4

func (c *Conn) Backup(ctx context.Context, path string) (err error)

func (*Conn) Begin

func (c *Conn) Begin(ctx context.Context) (err error)

func (*Conn) BeginImmediate added in v0.1.6

func (c *Conn) BeginImmediate(ctx context.Context) (err error)

func (*Conn) Close

func (c *Conn) Close() (err error)

func (*Conn) Commit

func (c *Conn) Commit(ctx context.Context) (err error)

func (*Conn) Exec

func (c *Conn) Exec(ctx context.Context, query string, bind func(stmt *sqlite.Stmt), result func(stmt *sqlite.Stmt) error) (err error)

func (*Conn) ExecCached

func (c *Conn) ExecCached(ctx context.Context, query string, bind func(stmt *sqlite.Stmt), result func(stmt *sqlite.Stmt) error) (err error)

func (*Conn) ExecNoResult

func (c *Conn) ExecNoResult(ctx context.Context, query string) (err error)

func (*Conn) Fsync added in v0.4.0

func (c *Conn) Fsync(ctx context.Context) error

func (*Conn) Prepare

func (c *Conn) Prepare(query string) (*Stmt, error)

func (*Conn) Query

func (c *Conn) Query(ctx context.Context, query string) (*Stmt, error)

func (*Conn) Rollback

func (c *Conn) Rollback(ctx context.Context) (err error)

type ConnManager

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

func NewConnManager

func NewConnManager(path string, conf Config) (*ConnManager, error)

func (*ConnManager) Close

func (c *ConnManager) Close() (err error)

func (*ConnManager) GetRead

func (c *ConnManager) GetRead(ctx context.Context) (conn *Conn, err error)

func (*ConnManager) GetWrite

func (c *ConnManager) GetWrite(ctx context.Context) (conn *Conn, err error)

func (*ConnManager) ReleaseRead

func (c *ConnManager) ReleaseRead(conn *Conn)

func (*ConnManager) ReleaseWrite

func (c *ConnManager) ReleaseWrite(conn *Conn)

func (*ConnManager) ReleaseWriteWithOptions added in v0.4.0

func (c *ConnManager) ReleaseWriteWithOptions(conn *Conn, noChanges bool)

ReleaseWriteWithOptions releases the write connection with options noChanges: if true, means no changes has been made withing the write conn

func (*ConnManager) StalledConnections added in v0.1.13

func (c *ConnManager) StalledConnections(threshold time.Duration) (stalledTraces []string)

StalledConnections returns a list of stalled connections works only if stalledConnDetectorEnabled is true

type EventType added in v0.4.0

type EventType int
const (
	EventAcquireWrite EventType = iota
	EventReleaseWriteWithChanges
	EventReleaseWriteWithoutChanges
)

type Stmt

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

func (*Stmt) BindBytes added in v0.2.0

func (s *Stmt) BindBytes(param int, value []byte)

func (*Stmt) Close

func (s *Stmt) Close() error

func (*Stmt) ColumnBytes added in v0.2.0

func (s *Stmt) ColumnBytes(col int, buf []byte) (int, error)

func (*Stmt) ColumnLen added in v0.2.0

func (s *Stmt) ColumnLen(col int) (int, error)

func (*Stmt) Exec

func (s *Stmt) Exec(ctx context.Context, bind func(stmt *sqlite.Stmt), result func(stmt *sqlite.Stmt) error) (err error)

func (*Stmt) Step added in v0.2.0

func (s *Stmt) Step() (rowReturned bool, err error)

type WriteObserver added in v0.4.0

type WriteObserver func(eventType EventType)

Jump to

Keyboard shortcuts

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