table

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 54

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextIdempotentOperation added in v3.2.1

func ContextIdempotentOperation(ctx context.Context) bool

func WithIdempotentOperation added in v3.2.1

func WithIdempotentOperation(ctx context.Context) context.Context

Types

type Client

type Client interface {
	// Close closes table client
	Close(ctx context.Context) error

	// Do provide the best effort for execute operation
	// Do implements internal busy loop until one of the following conditions is met:
	// - deadline was canceled or deadlined
	// - retry operation returned nil as error
	// Warning: if deadline without deadline or cancellation func Retry will be worked infinite
	Do(ctx context.Context, op Operation, opts ...Option) (err error)
}

type DataQuery

type DataQuery interface {
	String() string
	ID() string
	YQL() string
}

DataQuery only for tracers

type DataQueryExplanation

type DataQueryExplanation struct {
	AST  string
	Plan string
}

DataQueryExplanation is a result of ExplainDataQuery call.

type Operation added in v3.2.1

type Operation func(context.Context, Session) (err error)

Operation is the interface that holds an operation for retry.

type Option added in v3.2.1

type Option func(o *Options)

func WithIdempotent added in v3.2.1

func WithIdempotent() Option

type Options added in v3.2.1

type Options struct {
	Idempotent bool
}

type ParameterOption

type ParameterOption func(queryParams)

func ValueParam

func ValueParam(name string, v types.Value) ParameterOption

type QueryParameters

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

func NewQueryParameters

func NewQueryParameters(opts ...ParameterOption) *QueryParameters

func (*QueryParameters) Add

func (q *QueryParameters) Add(opts ...ParameterOption)

func (*QueryParameters) Each

func (q *QueryParameters) Each(it func(name string, v types.Value))

func (*QueryParameters) Params

func (q *QueryParameters) Params() queryParams

func (*QueryParameters) String

func (q *QueryParameters) String() string

type Session

type Session interface {
	SessionInfo

	CreateTable(ctx context.Context, path string, opts ...options.CreateTableOption) (err error)
	DescribeTable(ctx context.Context, path string, opts ...options.DescribeTableOption) (desc options.Description, err error)
	DropTable(ctx context.Context, path string, opts ...options.DropTableOption) (err error)
	AlterTable(ctx context.Context, path string, opts ...options.AlterTableOption) (err error)
	CopyTable(ctx context.Context, dst, src string, opts ...options.CopyTableOption) (err error)
	Explain(ctx context.Context, query string) (exp DataQueryExplanation, err error)
	Prepare(ctx context.Context, query string) (stmt Statement, err error)
	Execute(ctx context.Context, tx *TransactionControl, query string, params *QueryParameters, opts ...options.ExecuteDataQueryOption) (txr Transaction, r resultset.Result, err error)
	ExecuteSchemeQuery(ctx context.Context, query string, opts ...options.ExecuteSchemeQueryOption) (err error)
	DescribeTableOptions(ctx context.Context) (desc options.TableOptionsDescription, err error)
	StreamReadTable(ctx context.Context, path string, opts ...options.ReadTableOption) (r resultset.Result, err error)
	StreamExecuteScanQuery(ctx context.Context, query string, params *QueryParameters, opts ...options.ExecuteScanQueryOption) (_ resultset.Result, err error)
	BulkUpsert(ctx context.Context, table string, rows types.Value) (err error)
	BeginTransaction(ctx context.Context, tx *TransactionSettings) (x Transaction, err error)
	KeepAlive(ctx context.Context) error
}

type SessionInfo

type SessionInfo interface {
	ID() string
}

type Statement

type Statement interface {
	Execute(ctx context.Context, tx *TransactionControl, params *QueryParameters, opts ...options.ExecuteDataQueryOption) (txr Transaction, r resultset.Result, err error)
	NumInput() int
	Text() string
}

type Transaction

type Transaction interface {
	ID() string
	Execute(ctx context.Context, query string, params *QueryParameters, opts ...options.ExecuteDataQueryOption) (resultset.Result, error)
	ExecuteStatement(ctx context.Context, stmt Statement, params *QueryParameters, opts ...options.ExecuteDataQueryOption) (resultset.Result, error)
	CommitTx(ctx context.Context, opts ...options.CommitTransactionOption) (r resultset.Result, err error)
	Rollback(ctx context.Context) (err error)
}

type TransactionControl

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

func TxControl

func TxControl(opts ...TxControlOption) *TransactionControl

func (*TransactionControl) Desc

type TransactionSettings

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

func TxSettings

func TxSettings(opts ...TxOption) *TransactionSettings

func (*TransactionSettings) Settings

type TxControlOption

type TxControlOption func(*txControlDesc)

func BeginTx

func BeginTx(opts ...TxOption) TxControlOption

func CommitTx

func CommitTx() TxControlOption

func WithTx

func WithTx(t Transaction) TxControlOption

type TxOnlineReadOnlyOption

type TxOnlineReadOnlyOption func(*txOnlineReadOnly)

func WithInconsistentReads

func WithInconsistentReads() TxOnlineReadOnlyOption

type TxOption

type TxOption func(*txDesc)

Transaction control options

func WithOnlineReadOnly

func WithOnlineReadOnly(opts ...TxOnlineReadOnlyOption) TxOption

func WithSerializableReadWrite

func WithSerializableReadWrite() TxOption

func WithStaleReadOnly

func WithStaleReadOnly() TxOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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