connector

package
v3.92.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	QUERY_SERVICE = iota + 1 //nolint:revive,stylecheck
	TABLE_SERVICE            //nolint:revive,stylecheck
)

Variables

View Source
var (
	ErrUnsupported = driver.ErrSkip
)

Functions

This section is empty.

Types

type Connector

type Connector struct {
	TableOpts []tableSql.Option
	QueryOpts []querySql.Option
	// contains filtered or unexported fields
}

func Open

func Open(parent ydbDriver, balancer grpc.ClientConnInterface, opts ...Option) (_ *Connector, err error)

func Unwrap

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

func (*Connector) Bindings

func (c *Connector) Bindings() bind.Bindings

func (*Connector) Clock

func (c *Connector) Clock() clockwork.Clock

func (*Connector) Close

func (c *Connector) Close() error

func (*Connector) Connect

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

func (*Connector) Driver

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

func (*Connector) Name

func (c *Connector) Name() string

func (*Connector) Open

func (c *Connector) Open(name string) (driver.Conn, error)

func (*Connector) Parent

func (c *Connector) Parent() ydbDriver

func (*Connector) Query

func (c *Connector) Query() *query.Client

func (*Connector) RetryBudget

func (c *Connector) RetryBudget() budget.Budget

func (*Connector) Scheme

func (c *Connector) Scheme() scheme.Client

func (*Connector) Scripting

func (c *Connector) Scripting() scripting.Client

func (*Connector) Table

func (c *Connector) Table() table.Client

func (*Connector) Trace

func (c *Connector) Trace() *trace.DatabaseSQL

func (*Connector) TraceRetry

func (c *Connector) TraceRetry() *trace.Retry

type Option

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

func OverQueryService

func OverQueryService() Option

func OverTableService

func OverTableService() Option

func WithDefaultQueryMode

func WithDefaultQueryMode(mode tableSql.QueryMode) Option

func WithDisableServerBalancer

func WithDisableServerBalancer() Option

func WithFakeTx

func WithFakeTx(modes ...tableSql.QueryMode) Option

func WithIdleThreshold

func WithIdleThreshold(idleThreshold time.Duration) Option

func WithOnClose

func WithOnClose(onClose func(*Connector)) Option

func WithQueryOptions

func WithQueryOptions(opts ...querySql.Option) Option

func WithRetryBudget

func WithRetryBudget(budget budget.Budget) Option

func WithTableOptions

func WithTableOptions(opts ...tableSql.Option) Option

func WithTrace

func WithTrace(
	t *trace.DatabaseSQL,
	opts ...trace.DatabaseSQLComposeOption,
) Option

func WithTraceRetry

func WithTraceRetry(
	t *trace.Retry,
	opts ...trace.RetryComposeOption,
) Option

type QueryBindOption

type QueryBindOption interface {
	Option
	bind.Bind
}

func WithQueryBind

func WithQueryBind(bind bind.Bind) QueryBindOption

func WithTablePathPrefix

func WithTablePathPrefix(tablePathPrefix string) QueryBindOption

Jump to

Keyboard shortcuts

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