legacy

package
v3.95.5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownQueryMode = QueryMode(iota)
	DataQueryMode
	ScanQueryMode
	SchemeQueryMode
	ScriptingQueryMode
)

Variables

View Source
var (
	ErrUnsupported = driver.ErrSkip

	ErrWrongQueryMode = errors.New("wrong query mode")
)

Functions

func WithQueryMode

func WithQueryMode(ctx context.Context, mode QueryMode) 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 struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, parent Parent, s table.ClosableSession, opts ...Option) *Conn

func (*Conn) BeginTx

func (c *Conn) BeginTx(ctx context.Context, txOptions driver.TxOptions) (iface.Tx, error)

func (*Conn) CheckNamedValue

func (c *Conn) CheckNamedValue(*driver.NamedValue) error

func (*Conn) Close

func (c *Conn) Close() (finalErr error)

func (*Conn) Exec

func (c *Conn) Exec(ctx context.Context, sql string, params *params.Params) (result driver.Result, err error)

func (*Conn) Explain

func (c *Conn) Explain(ctx context.Context, sql string, _ *params.Params) (ast string, plan string, err error)

func (*Conn) ID

func (c *Conn) ID() string

func (*Conn) IsValid

func (c *Conn) IsValid() bool

func (*Conn) Ping

func (c *Conn) Ping(ctx context.Context) (finalErr error)

func (*Conn) Query

func (c *Conn) Query(ctx context.Context, sql string, params *params.Params) (
	result driver.RowsNextResultSet, finalErr error,
)

type Option

type Option func(*Conn)

func WithDataOpts

func WithDataOpts(dataOpts ...options.ExecuteDataQueryOption) Option

func WithDefaultQueryMode

func WithDefaultQueryMode(mode QueryMode) Option

func WithDefaultTxControl

func WithDefaultTxControl(defaultTxControl *table.TransactionControl) Option

func WithFakeTxModes

func WithFakeTxModes(modes ...QueryMode) Option

func WithIdleThreshold

func WithIdleThreshold(idleThreshold time.Duration) Option

func WithOnClose

func WithOnClose(onCLose func()) Option

func WithScanOpts

func WithScanOpts(scanOpts ...options.ExecuteScanQueryOption) Option

type Parent

type Parent interface {
	Table() table.Client
	Scripting() scripting.Client
}

type QueryMode

type QueryMode int

func (QueryMode) String

func (t QueryMode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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