package config

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/query/config"

Index

Constants

const (
	DefaultSessionDeleteTimeout = 500 * time.Millisecond
	DefaultSessionCreateTimeout = 500 * time.Millisecond
	DefaultPoolMaxSize          = pool.DefaultLimit
)

Types

type Config

type Config struct {
	config.Common
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Config

func (*Config) LazyTx

func (c *Config) LazyTx() bool

func (*Config) PoolLimit

func (c *Config) PoolLimit() int

PoolLimit is an upper bound of pooled sessions. If PoolLimit is less than or equal to zero then the DefaultPoolMaxSize variable is used as a pool limit.

func (*Config) PoolSessionUsageLimit

func (c *Config) PoolSessionUsageLimit() uint64

func (*Config) PoolSessionUsageTTL

func (c *Config) PoolSessionUsageTTL() time.Duration

func (*Config) SessionCreateTimeout

func (c *Config) SessionCreateTimeout() time.Duration

SessionCreateTimeout limits maximum time spent on Create session request

func (*Config) SessionDeleteTimeout

func (c *Config) SessionDeleteTimeout() time.Duration

SessionDeleteTimeout limits maximum time spent on Delete request

If SessionDeleteTimeout is less than or equal to zero then the DefaultSessionDeleteTimeout is used.

func (*Config) SessionIdleTimeToLive

func (c *Config) SessionIdleTimeToLive() time.Duration

SessionIdleTimeToLive limits maximum time to live of idle session If idleTimeToLive is less than or equal to zero then sessions will not be closed by idle

func (*Config) Trace

func (c *Config) Trace() *trace.Query

Trace defines trace over table client calls

type Option

type Option func(*Config)

func With

func With(config config.Common) Option

With applies common configuration params

func WithLazyTx

func WithLazyTx(lazyTx bool) Option

func WithPoolLimit

func WithPoolLimit(size int) Option

WithPoolLimit defines upper bound of pooled sessions. If poolLimit is less than or equal to zero then the DefaultPoolMaxSize variable is used as a poolLimit.

func WithSessionCreateTimeout

func WithSessionCreateTimeout(createSessionTimeout time.Duration) Option

WithSessionCreateTimeout limits maximum time spent on Create session request If sessionCreateTimeout is less than or equal to zero then no used timeout on create session request

func WithSessionDeleteTimeout

func WithSessionDeleteTimeout(deleteTimeout time.Duration) Option

WithSessionDeleteTimeout limits maximum time spent on Delete request If sessionDeleteTimeout is less than or equal to zero then the DefaultSessionDeleteTimeout is used.

func WithSessionIdleTimeToLive

func WithSessionIdleTimeToLive(idleTimeToLive time.Duration) Option

WithSessionIdleTimeToLive limits maximum time to live of idle session If idleTimeToLive is less than or equal to zero then sessions will not be closed by idle

func WithSessionPoolSessionUsageLimit

func WithSessionPoolSessionUsageLimit[T interface{ uint64 | time.Duration }](limit T) Option

WithSessionPoolSessionUsageLimit set pool session max usage: - if argument type is uint64 - WithSessionPoolSessionUsageLimit limits max usage count of pool session - if argument type is time.Duration - WithSessionPoolSessionUsageLimit limits max time to live of pool session

func WithTrace

func WithTrace(trace *trace.Query, opts ...trace.QueryComposeOption) Option

WithTrace appends table trace to early defined traces

Source Files

config.go options.go

Version
v3.108.0 (latest)
Published
Apr 21, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
9 minutes ago

Tools for package owners.