sqlitex

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MPL-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// In zombiezen this can be done with ExecOption parameter to Execute. In crawshaw this is a
	// noop for now. Here is how it was done for zombiezen:
	// https://github.com/zombiezen/go-sqlite/commit/754b7de62e83f3bc7fd226d0e9e1ab2bbe0f6916.
	Transaction = Save
)

Functions

func Exec

func Exec(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) error, args ...interface{}) error

func ExecChecked

func ExecChecked(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) error, args ...interface{}) error

TODO: Actually implement checked for crawshaw.

func ExecScript

func ExecScript(conn *sqlite.Conn, queries string) error

func ExecTransient

func ExecTransient(conn *sqlite.Conn, query string, resultFn func(stmt *sqlite.Stmt) error, args ...interface{}) (err error)

func Execute

func Execute(conn *sqlite.Conn, query string, opts *ExecOptions) error

func ExecuteScript

func ExecuteScript(conn *sqlite.Conn, queries string, opts *ExecOptions) (err error)

func Save

func Save(conn *sqlite.Conn) (releaseFn func(*error))

func WithTransactionRollbackOnError

func WithTransactionRollbackOnError(conn *sqlite.Conn, level string, inside func() error) (err error)

Types

type ExecOptions

type ExecOptions = sqlitex.ExecOptions

type Pool

type Pool struct {
	*sqlitex.Pool
}

func Open

func Open(uri string, flags sqlite.OpenFlags, poolSize int) (*Pool, error)

func (Pool) Get

func (me Pool) Get(ctx context.Context) *sqlite.Conn

func (Pool) Put

func (me Pool) Put(conn *sqlite.Conn)

Jump to

Keyboard shortcuts

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