Documentation ¶
Index ¶
- func DescribeTable(ctx context.Context, sessionID string, client describeTableClient, path string, ...) (desc options.Description, err error)
- func NewTimeToLiveSettings(settings *Ydb_Table.TtlSettings) *options.TimeToLiveSettings
- type Client
- func (c *Client) BulkUpsert(ctx context.Context, tableName string, data table.BulkUpsertData, ...) (finalErr error)
- func (c *Client) Close(ctx context.Context) (err error)
- func (c *Client) CreateSession(ctx context.Context, opts ...table.Option) (_ table.ClosableSession, err error)
- func (c *Client) Do(ctx context.Context, op table.Operation, opts ...table.Option) (finalErr error)
- func (c *Client) DoTx(ctx context.Context, op table.TxOperation, opts ...table.Option) (finalErr error)
- type Query
- type Session
- func (s *Session) AlterTable(ctx context.Context, path string, opts ...options.AlterTableOption) (err error)
- func (s *Session) BeginTransaction(ctx context.Context, txSettings *table.TransactionSettings) (x table.Transaction, err error)
- func (s *Session) BulkUpsert(ctx context.Context, table string, rows value.Value, ...) (err error)
- func (s *Session) Close(ctx context.Context) (err error)
- func (s *Session) CopyTable(ctx context.Context, dst, src string, opts ...options.CopyTableOption) (err error)
- func (s *Session) CopyTables(ctx context.Context, opts ...options.CopyTablesOption) (err error)
- func (s *Session) CreateTable(ctx context.Context, path string, opts ...options.CreateTableOption) (err error)
- func (s *Session) DescribeTable(ctx context.Context, path string, opts ...options.DescribeTableOption) (options.Description, error)
- func (s *Session) DescribeTableOptions(ctx context.Context) (desc options.TableOptionsDescription, err error)
- func (s *Session) DropTable(ctx context.Context, path string, opts ...options.DropTableOption) (err error)
- func (s *Session) Execute(ctx context.Context, txControl *table.TransactionControl, sql string, ...) (txr table.Transaction, r result.Result, err error)
- func (s *Session) ExecuteSchemeQuery(ctx context.Context, sql string, opts ...options.ExecuteSchemeQueryOption) (err error)
- func (s *Session) Explain(ctx context.Context, sql string) (exp table.DataQueryExplanation, err error)
- func (s *Session) ID() string
- func (s *Session) IsAlive() bool
- func (s *Session) KeepAlive(ctx context.Context) (err error)
- func (s *Session) LastUsage() time.Time
- func (s *Session) NodeID() uint32
- func (s *Session) Prepare(ctx context.Context, queryText string) (_ table.Statement, err error)
- func (s *Session) ReadRows(ctx context.Context, path string, keys value.Value, ...) (_ result.Result, err error)
- func (s *Session) RenameTables(ctx context.Context, opts ...options.RenameTablesOption) (err error)
- func (s *Session) SetStatus(status table.SessionStatus)
- func (s *Session) Status() table.SessionStatus
- func (s *Session) StreamExecuteScanQuery(ctx context.Context, sql string, parameters *params.Params, ...) (_ result.StreamResult, err error)
- func (s *Session) StreamReadTable(ctx context.Context, path string, opts ...options.ReadTableOption) (_ result.StreamResult, err error)
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 (*Client) BulkUpsert ¶ added in v3.83.0
func (*Client) Close ¶
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 (*Client) Do ¶ added in v3.24.1
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
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) 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
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) 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.