easydb

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func Open

func Open(ctx context.Context, path string, busyTimeout time.Duration, schema string) (*DB, error)

func (*DB) Check

func (db *DB) Check(ctx context.Context) error

Check verifies database integrity. Check runs in O(N log N) time, where N is the database size.

func (*DB) Close

func (db *DB) Close() error

func (*DB) Exec

func (db *DB) Exec(ctx context.Context, query string, args ...interface{}) error

Exec executes a query without returning any rows.

func (*DB) Get

func (db *DB) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) (bool, error)

Get executes a query that is expected to return at most one row.

func (*DB) Select

func (db *DB) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error

Select executes a query that is expected to return any number of rows.

func (*DB) Tx

func (db *DB) Tx(ctx context.Context, fn func(*Tx) error) error

Tx executes fn in a transaction.

type Tx

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

func (*Tx) Exec

func (tx *Tx) Exec(query string, args ...interface{}) error

Exec executes a query without returning any rows.

func (*Tx) Get

func (tx *Tx) Get(dest interface{}, query string, args ...interface{}) (bool, error)

Get executes a query that is expected to return at most one row.

func (*Tx) Select

func (tx *Tx) Select(dest interface{}, query string, args ...interface{}) error

Select executes a query that is expected to return any number of rows.

Jump to

Keyboard shortcuts

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