package legacy

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql/legacy"

Index

Constants

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

Variables

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

Source Files

conn.go context.go errors.go isolation.go mode.go options.go rows.go tx.go tx_fake.go valuer.go

Directories

PathSynopsis
internal/xsql/legacy/badconn
Version
v3.98.0
Published
Jan 20, 2025
Platform
linux/amd64
Imports
23 packages
Last checked
20 seconds ago

Tools for package owners.