connect

package
v2.12.10 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectOption

type ConnectOption func(client *Connection) error

func WithAccessTokenCredentials added in v2.3.0

func WithAccessTokenCredentials(accessToken string) ConnectOption

func WithAnonymousCredentials added in v2.3.0

func WithAnonymousCredentials() ConnectOption

func WithCredentials

func WithCredentials(credentials ydb.Credentials) ConnectOption

func WithDriverConfig

func WithDriverConfig(config *ydb.DriverConfig) ConnectOption

func WithMetadataCredentials added in v2.3.0

func WithMetadataCredentials(ctx context.Context) ConnectOption

func WithServiceAccountKeyFileCredentials added in v2.3.0

func WithServiceAccountKeyFileCredentials(serviceAccountKeyFile string) ConnectOption

func WithSessionPoolBusyCheckInterval deprecated

func WithSessionPoolBusyCheckInterval(busyCheckInterval time.Duration) ConnectOption

Deprecated: has no effect now

func WithSessionPoolCreateSessionTimeout

func WithSessionPoolCreateSessionTimeout(createSessionTimeout time.Duration) ConnectOption

func WithSessionPoolDeleteTimeout

func WithSessionPoolDeleteTimeout(deleteTimeout time.Duration) ConnectOption

func WithSessionPoolIdleThreshold

func WithSessionPoolIdleThreshold(idleThreshold time.Duration) ConnectOption

func WithSessionPoolKeepAliveBatchSize deprecated

func WithSessionPoolKeepAliveBatchSize(keepAliveBatchSize int) ConnectOption

Deprecated: has no effect now

func WithSessionPoolKeepAliveMinSize

func WithSessionPoolKeepAliveMinSize(keepAliveMinSize int) ConnectOption

func WithSessionPoolKeepAliveTimeout

func WithSessionPoolKeepAliveTimeout(keepAliveTimeout time.Duration) ConnectOption

func WithSessionPoolSizeLimit

func WithSessionPoolSizeLimit(sizeLimit int) ConnectOption

type ConnectParams

type ConnectParams interface {
	Endpoint() string
	Database() string
	UseTLS() bool
}

func ConnectionString

func ConnectionString(uri string) (ConnectParams, error)

func EndpointDatabase

func EndpointDatabase(endpoint string, database string, tls bool) ConnectParams

func MustConnectionString

func MustConnectionString(uri string) ConnectParams

type Connection

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

func New

func New(ctx context.Context, params ConnectParams, opts ...ConnectOption) (c *Connection, err error)

New connects to database and return database connection

func (*Connection) CleanupDatabase

func (c *Connection) CleanupDatabase(ctx context.Context, prefix string, names ...string) error

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) Driver

func (c *Connection) Driver() ydb.Driver

func (*Connection) EnsurePathExists

func (c *Connection) EnsurePathExists(ctx context.Context, path string) error

func (*Connection) Scheme

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

func (*Connection) Table

func (c *Connection) Table() *tableWrapper

Jump to

Keyboard shortcuts

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