connectors

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PgxConnType  = "pgx"
	SqlxConnType = "sqlx"
)
View Source
const (
	DefaultDBConn = "master"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectDB added in v1.0.7

type ConnectDB interface {
	*sqlx.DB | *goqu.Database | types.PgxConn
}

type ConnectTx added in v1.0.7

type ConnectTx interface {
	*sqlx.Tx | *goqu.TxDatabase | types.PgxTx
}

type DBConnector added in v1.0.7

type DBConnector[T ConnectDB, M ConnectTx] interface {
	CallContext(
		ctx context.Context,
		queryName string,
		callFunc func(ctx context.Context, db T) error,
	) error
	CallTransaction(
		ctx context.Context,
		txName string,
		callFunc func(ctx context.Context, tx M) error,
	) error
}

Jump to

Keyboard shortcuts

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