driver

package
v0.3.72 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVClient

type KVClient interface {
	PingContext(ctx context.Context) error
	Close() error
}

type KVReader

type KVReader interface {
	GetContext(ctx context.Context, key string) (any, error)
}

type KVWriter

type KVWriter interface {
	SetContext(ctx context.Context, key string, value any) error
}

type SQL

type SQL map[string]*sql.DB

func NewSQL

func NewSQL(config map[string]config.SQL) (SQL, error)

func (SQL) Get

func (d SQL) Get(name ...string) some.Some[*sql.DB]

func (SQL) GetNoDefault

func (d SQL) GetNoDefault(name ...string) some.Some[*sql.DB]

type SQLExecutor

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

type SQLPreparation

type SQLPreparation interface {
	PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
}

type SQLQuerier

type SQLQuerier interface {
	PingContext(ctx context.Context) error
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
}

type SQLTx

type SQLTx interface {
	SQLQuerier
	SQLExecutor
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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