conn

package
v3.92.6 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

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

	DefaultQueryMode = DataQueryMode
)

Variables

View Source
var (
	ErrUnsupported = driver.ErrSkip
)

Functions

func WithQueryMode

func WithQueryMode(ctx context.Context, m QueryMode) context.Context

WithQueryMode returns a copy of context with given QueryMode

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) Begin

func (c *Conn) Begin() (driver.Tx, error)

func (*Conn) BeginTx

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

func (*Conn) CheckNamedValue

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

func (*Conn) Close

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

func (*Conn) ExecContext

func (c *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (_ driver.Result, _ error)

func (*Conn) ID

func (c *Conn) ID() string

func (*Conn) IsValid

func (c *Conn) IsValid() bool

func (*Conn) LastUsage

func (c *Conn) LastUsage() time.Time

func (*Conn) Ping

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

func (*Conn) Prepare

func (c *Conn) Prepare(string) (driver.Stmt, error)

func (*Conn) PrepareContext

func (c *Conn) PrepareContext(ctx context.Context, query string) (_ driver.Stmt, finalErr error)

func (*Conn) QueryContext

func (c *Conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (_ driver.Rows, _ error)

func (*Conn) WithDataQueryOptions

func (c *Conn) WithDataQueryOptions(ctx context.Context, opts ...options.ExecuteDataQueryOption) context.Context

func (*Conn) WithScanQueryOptions

func (c *Conn) WithScanQueryOptions(ctx context.Context, opts ...options.ExecuteScanQueryOption) context.Context

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

	Trace() *trace.DatabaseSQL
	TraceRetry() *trace.Retry
	RetryBudget() budget.Budget
	Bindings() bind.Bindings
	Clock() clockwork.Clock
}

type QueryMode

type QueryMode int

func QueryModeFromString

func QueryModeFromString(s string) QueryMode

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