table

package
v3.99.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeTable added in v3.99.0

func DescribeTable(
	ctx context.Context,
	sessionID string,
	client describeTableClient,
	path string,
	opts ...options.DescribeTableOption,
) (desc options.Description, err error)

DescribeTable describes table at given path.

func NewTimeToLiveSettings added in v3.40.1

func NewTimeToLiveSettings(settings *Ydb_Table.TtlSettings) *options.TimeToLiveSettings

Types

type Client

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

Client is a set of session instances that may be reused. A Client is safe for use by multiple goroutines simultaneously.

func New

func (*Client) BulkUpsert added in v3.83.0

func (c *Client) BulkUpsert(
	ctx context.Context,
	tableName string,
	data table.BulkUpsertData,
	opts ...table.Option,
) (finalErr error)

func (*Client) Close

func (c *Client) Close(ctx context.Context) (err error)

Close deletes all stored sessions inside Client. It also stops all underlying timers and goroutines. It returns first error occurred during stale sessions' deletion. Note that even on error it calls Close() on each session.

func (*Client) CreateSession added in v3.24.1

func (c *Client) CreateSession(ctx context.Context, opts ...table.Option) (_ table.ClosableSession, err error)

func (*Client) Do added in v3.24.1

func (c *Client) Do(ctx context.Context, op table.Operation, opts ...table.Option) (finalErr 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

func (*Client) DoTx added in v3.24.1

func (c *Client) DoTx(ctx context.Context, op table.TxOperation, opts ...table.Option) (finalErr error)

type Query added in v3.99.0

type Query interface {
	String() string
	ID() string
	YQL() string
	// contains filtered or unexported methods
}

type Session

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

Session represents a single table API session.

session methods are not goroutine safe. Simultaneous execution of requests are forbidden within a single session.

Note that after session is no longer needed it should be destroyed by Close() call.

func (*Session) AlterTable added in v3.99.0

func (s *Session) AlterTable(
	ctx context.Context,
	path string,
	opts ...options.AlterTableOption,
) (err error)

AlterTable modifies schema of table at given path with given options.

func (*Session) BeginTransaction added in v3.99.0

func (s *Session) BeginTransaction(
	ctx context.Context,
	txSettings *table.TransactionSettings,
) (x table.Transaction, err error)

BeginTransaction begins new transaction within given session with given settings.

func (*Session) BulkUpsert added in v3.99.0

func (s *Session) BulkUpsert(ctx context.Context, table string, rows value.Value,
	opts ...options.BulkUpsertOption,
) (err error)

BulkUpsert uploads given list of ydb struct values to the table.

func (*Session) Close

func (s *Session) Close(ctx context.Context) (err error)

func (*Session) CopyTable added in v3.99.0

func (s *Session) CopyTable(
	ctx context.Context,
	dst, src string,
	opts ...options.CopyTableOption,
) (err error)

CopyTable creates copy of table at given path.

func (*Session) CopyTables added in v3.99.0

func (s *Session) CopyTables(
	ctx context.Context,
	opts ...options.CopyTablesOption,
) (err error)

CopyTables creates copy of table at given path.

func (*Session) CreateTable added in v3.99.0

func (s *Session) CreateTable(
	ctx context.Context,
	path string,
	opts ...options.CreateTableOption,
) (err error)

CreateTable creates table at given path with given options.

func (*Session) DescribeTable added in v3.99.0

func (s *Session) DescribeTable(
	ctx context.Context,
	path string,
	opts ...options.DescribeTableOption,
) (options.Description, error)

DescribeTable describes table at given path.

func (*Session) DescribeTableOptions added in v3.99.0

func (s *Session) DescribeTableOptions(ctx context.Context) (
	desc options.TableOptionsDescription,
	err error,
)

DescribeTableOptions describes supported table options.

func (*Session) DropTable added in v3.99.0

func (s *Session) DropTable(
	ctx context.Context,
	path string,
	opts ...options.DropTableOption,
) (err error)

DropTable drops table at given path with given options.

func (*Session) Execute added in v3.99.0

func (s *Session) Execute(ctx context.Context, txControl *table.TransactionControl, sql string, params *params.Params,
	opts ...options.ExecuteDataQueryOption,
) (
	txr table.Transaction, r result.Result, err error,
)

Execute executes given data query represented by text.

func (*Session) ExecuteSchemeQuery added in v3.99.0

func (s *Session) ExecuteSchemeQuery(ctx context.Context, sql string,
	opts ...options.ExecuteSchemeQueryOption,
) (err error)

ExecuteSchemeQuery executes scheme query.

func (*Session) Explain added in v3.99.0

func (s *Session) Explain(ctx context.Context, sql string) (exp table.DataQueryExplanation, err error)

Explain explains data query represented by text.

func (*Session) ID added in v3.99.0

func (s *Session) ID() string

func (*Session) IsAlive added in v3.99.0

func (s *Session) IsAlive() bool

func (*Session) KeepAlive

func (s *Session) KeepAlive(ctx context.Context) (err error)

KeepAlive keeps idle session alive.

func (*Session) LastUsage added in v3.99.0

func (s *Session) LastUsage() time.Time

func (*Session) NodeID added in v3.99.0

func (s *Session) NodeID() uint32

func (*Session) Prepare added in v3.99.0

func (s *Session) Prepare(ctx context.Context, queryText string) (_ table.Statement, err error)

Prepare prepares data query within session s.

func (*Session) ReadRows added in v3.99.0

func (s *Session) ReadRows(
	ctx context.Context,
	path string,
	keys value.Value,
	opts ...options.ReadRowsOption,
) (_ result.Result, err error)

func (*Session) RenameTables added in v3.99.0

func (s *Session) RenameTables(
	ctx context.Context,
	opts ...options.RenameTablesOption,
) (err error)

RenameTables renames tables.

func (*Session) SetStatus added in v3.99.0

func (s *Session) SetStatus(status table.SessionStatus)

func (*Session) Status

func (s *Session) Status() table.SessionStatus

func (*Session) StreamExecuteScanQuery added in v3.99.0

func (s *Session) StreamExecuteScanQuery(ctx context.Context, sql string, parameters *params.Params,
	opts ...options.ExecuteScanQueryOption,
) (_ result.StreamResult, err error)

StreamExecuteScanQuery scan-reads table at given path with given options.

Note that given ctx controls the lifetime of the whole read, not only this StreamExecuteScanQuery() call; that is, the time until returned result is closed via Close() call or fully drained by sequential NextResultSet() calls.

func (*Session) StreamReadTable added in v3.99.0

func (s *Session) StreamReadTable(
	ctx context.Context,
	path string,
	opts ...options.ReadTableOption,
) (_ result.StreamResult, err error)

StreamReadTable reads table at given path with given options.

Note that given ctx controls the lifetime of the whole read, not only this StreamReadTable() call; that is, the time until returned result is closed via Close() call or fully drained by sequential NextResultSet() calls.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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