db

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 1 Imported by: 8

README

Documentation

Index

Constants

View Source
const (
	LevelSerializable    = "serializable"
	LevelRepeatableRead  = "repeatable read"
	LevelReadCommitted   = "read committed"
	LevelReadUncommitted = "read uncommitted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvertParameters

type ConvertParameters interface {
	ConvertParameters(string, []interface{}) (string, []interface{})
}

type DB

type DB interface {
	Close() error
	Exec(query string, args ...interface{}) (Result, error)
	ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
	Query(query string, args ...interface{}) (Rows, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error)
	QueryRow(query string, args ...interface{}) Row
	QueryRowContext(ctx context.Context, query string, args ...interface{}) Row
	BeginTx(ctx context.Context, isolationLevel string, readOnly bool) (Tx, error)
	DriverName() string
	ErrNoRows() error
	ErrGetCode(err error) string
}

type Result

type Result interface {
	RowsAffected() (int64, error)
}

type Row

type Row interface {
	Scan(dest ...interface{}) error
}

type Rows

type Rows interface {
	Close() error
	Columns() ([]string, error)
	Err() error
	Next() bool
	Scan(dest ...interface{}) error
}

type Scannable

type Scannable interface {
	Scan(dest ...interface{}) error
}

type Tx

type Tx interface {
	ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...interface{}) Row
	Commit(ctx context.Context) error
	Rollback(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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