xsql

package
v3.80.13 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 33 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 ConnAlreadyHaveTxError

type ConnAlreadyHaveTxError struct {
	// contains filtered or unexported fields
}

func (*ConnAlreadyHaveTxError) As

func (err *ConnAlreadyHaveTxError) As(target interface{}) bool

func (*ConnAlreadyHaveTxError) Error

func (err *ConnAlreadyHaveTxError) Error() string

type Connector

type Connector struct {
	Bindings bind.Bindings
	// contains filtered or unexported fields
}

Connector is a producer of database/sql connections

func Open

func Open(parent ydbDriver, opts ...ConnectorOption) (_ *Connector, err error)

func Unwrap

func Unwrap[T *sql.DB | *sql.Conn](v T) (connector *Connector, err error)

func (*Connector) Close

func (c *Connector) Close() (err error)

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context) (_ driver.Conn, err error)

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

type ConnectorOption

type ConnectorOption interface {
	Apply(c *Connector) error
}

func WithDefaultDataQueryOptions

func WithDefaultDataQueryOptions(opts ...options.ExecuteDataQueryOption) ConnectorOption

func WithDefaultQueryMode

func WithDefaultQueryMode(mode QueryMode) ConnectorOption

func WithDefaultScanQueryOptions

func WithDefaultScanQueryOptions(opts ...options.ExecuteScanQueryOption) ConnectorOption

func WithDefaultTxControl

func WithDefaultTxControl(txControl *table.TransactionControl) ConnectorOption

func WithDisableServerBalancer

func WithDisableServerBalancer() ConnectorOption

func WithFakeTx

func WithFakeTx(m QueryMode) ConnectorOption

WithFakeTx returns a copy of context with given QueryMode

func WithIdleThreshold

func WithIdleThreshold(idleThreshold time.Duration) ConnectorOption

func WithOnClose

func WithOnClose(f func(connector *Connector)) ConnectorOption

func WithTraceRetry

func WithTraceRetry(t *trace.Retry) ConnectorOption

func WithretryBudget

func WithretryBudget(b budget.Budget) ConnectorOption

type QueryBindConnectorOption

type QueryBindConnectorOption interface {
	ConnectorOption
	bind.Bind
}

func WithQueryBind

func WithQueryBind(bind bind.Bind) QueryBindConnectorOption

func WithTablePathPrefix

func WithTablePathPrefix(tablePathPrefix string) QueryBindConnectorOption

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