adapter

package
v3.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

type Handle interface {
	ReadWriter
	BeginTx(ctx context.Context, options *sql.TxOptions) (Transaction, error)
	io.Closer

	DBHandle() *sql.DB
}

func New

func New(value *sql.DB) Handle

func Open

func Open(driver, dataSource string) Handle

type QueryResult

type QueryResult interface {
	RowScanner
	Next() bool
	Err() error
	io.Closer
}

type ReadWriter

type ReadWriter interface {
	Reader
	Writer
}

type Reader

type Reader interface {
	QueryContext(ctx context.Context, statement string, args ...any) (QueryResult, error)
	QueryRowContext(ctx context.Context, statement string, args ...any) RowScanner
}

type RowScanner

type RowScanner interface {
	Scan(...any) error
}

type Transaction

type Transaction interface {
	ReadWriter
	Transactional

	TxHandle() *sql.Tx
}

type Transactional

type Transactional interface {
	Commit() error
	Rollback() error
}

type Writer

type Writer interface {
	ExecContext(ctx context.Context, statement string, args ...any) (sql.Result, error)
}

Jump to

Keyboard shortcuts

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