common

package
v3.100.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPreparedStatement

func IsPreparedStatement(ctx context.Context) bool

func TxControl

func TxControl(ctx context.Context, defaultTxControl *table.TransactionControl) (txControl *table.TransactionControl)

func WithPreparedStatement

func WithPreparedStatement(ctx context.Context) context.Context

func WithTxControl

func WithTxControl(ctx context.Context, txc *table.TransactionControl) context.Context

func WithTxControlHook

func WithTxControlHook(ctx context.Context, hook txControlHook) context.Context

Types

type Conn

type Conn interface {
	driver.Validator
	driver.Pinger

	ID() string
	NodeID() uint32

	Exec(ctx context.Context, sql string, params *params.Params) (result driver.Result, err error)
	Query(ctx context.Context, sql string, params *params.Params) (result driver.RowsNextResultSet, err error)
	Explain(ctx context.Context, sql string, params *params.Params) (ast string, plan string, err error)
	BeginTx(ctx context.Context, opts driver.TxOptions) (Tx, error)

	Close() error
}

type Tx

type Tx interface {
	ID() string

	Exec(ctx context.Context, sql string, params *params.Params) (driver.Result, error)
	Query(ctx context.Context, sql string, params *params.Params) (driver.RowsNextResultSet, error)

	Rollback(ctx context.Context) error
	Commit(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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