sql

package
v0.0.0-...-c70c80c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRows = s.ErrNoRows
View Source
var MemoryDB = ":memory:"

Functions

This section is empty.

Types

type Args

type Args map[string]any

func Map

func Map(v any) Args

type DB

type DB struct {
	DbPath string
	Db     *sql.DB
	// contains filtered or unexported fields
}
var Default *DB

func NewTestDB

func NewTestDB(t *testing.T, persistent bool) DB

func Open

func Open(dbPath string) (DB, error)

func (*DB) Close

func (db *DB) Close() error

func (DB) Define

func (db DB) Define(version float32, ddl string) error

func (*DB) Delete

func (db *DB) Delete() error

func (DB) Exec

func (db DB) Exec(key string, m Args) (s.Result, error)

func (*DB) GetConnection

func (db *DB) GetConnection() *sql.DB

func (DB) GetVersion

func (db DB) GetVersion(key string) float32

func (DB) Keys

func (db DB) Keys() []string

func (DB) Query

func (db DB) Query(key string, m Args) (Rows, error)

func (DB) QueryExt

func (db DB) QueryExt(key, sql string, m Args) (Rows, error)

func (DB) QueryRow

func (db DB) QueryRow(key string, m Args, dest ...any) error

type Rows

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

func (*Rows) Close

func (rw *Rows) Close() error

func (*Rows) Next

func (rw *Rows) Next() bool

func (*Rows) Scan

func (rw *Rows) Scan(dest ...interface{}) (err error)

Jump to

Keyboard shortcuts

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