package table
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/table"
Index ¶
- func DescribeTable( ctx context.Context, sessionID string, client describeTableClient, path string, opts ...options.DescribeTableOption, ) (desc options.Description, err error)
- func NewTimeToLiveSettings(settings *Ydb_Table.TtlSettings) *options.TimeToLiveSettings
- type Client
- func New(ctx context.Context, cc grpc.ClientConnInterface, config *config.Config) *Client
- func (c *Client) BulkUpsert( ctx context.Context, tableName string, data table.BulkUpsertData, opts ...table.Option, ) (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)
- func (c *Client) ReadRows( ctx context.Context, path string, keys value.Value, readRowOpts []options.ReadRowsOption, retryOptions ...table.Option, ) (_ result.Result, err 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, opts ...options.BulkUpsertOption, ) (err error)
- func (s *Session) Close(ctx context.Context) (finalErr 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, params *params.Params, opts ...options.ExecuteDataQueryOption, ) ( 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, opts ...options.ReadRowsOption, ) (_ 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, opts ...options.ExecuteScanQueryOption, ) (_ result.StreamResult, err error)
- func (s *Session) StreamReadTable( ctx context.Context, path string, opts ...options.ReadTableOption, ) (_ result.StreamResult, err error)
Functions ¶
func DescribeTable ¶
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 ¶
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 ¶
func (c *Client) BulkUpsert( ctx context.Context, tableName string, data table.BulkUpsertData, opts ...table.Option, ) (finalErr error)
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 ¶
func (c *Client) CreateSession(ctx context.Context, opts ...table.Option) (_ table.ClosableSession, err error)
func (*Client) Do ¶
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 ¶
func (c *Client) DoTx(ctx context.Context, op table.TxOperation, opts ...table.Option) (finalErr error)
func (*Client) ReadRows ¶
func (c *Client) ReadRows( ctx context.Context, path string, keys value.Value, readRowOpts []options.ReadRowsOption, retryOptions ...table.Option, ) (_ result.Result, err error)
type Query ¶
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 ¶
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 ¶
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 ¶
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 (*Session) CopyTable ¶
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 ¶
CopyTables creates copy of table at given path.
func (*Session) CreateTable ¶
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 ¶
func (s *Session) DescribeTable( ctx context.Context, path string, opts ...options.DescribeTableOption, ) (options.Description, error)
DescribeTable describes table at given path.
func (*Session) DescribeTableOptions ¶
func (s *Session) DescribeTableOptions(ctx context.Context) ( desc options.TableOptionsDescription, err error, )
DescribeTableOptions describes supported table options.
func (*Session) DropTable ¶
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 ¶
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 ¶
func (s *Session) ExecuteSchemeQuery(ctx context.Context, sql string, opts ...options.ExecuteSchemeQueryOption, ) (err error)
ExecuteSchemeQuery executes scheme query.
func (*Session) Explain ¶
func (s *Session) Explain(ctx context.Context, sql string) (exp table.DataQueryExplanation, err error)
Explain explains data query represented by text.
func (*Session) ID ¶
func (*Session) IsAlive ¶
func (*Session) KeepAlive ¶
KeepAlive keeps idle session alive.
func (*Session) LastUsage ¶
func (*Session) NodeID ¶
func (*Session) Prepare ¶
Prepare prepares data query within session s.
func (*Session) ReadRows ¶
func (s *Session) ReadRows( ctx context.Context, path string, keys value.Value, opts ...options.ReadRowsOption, ) (_ result.Result, err error)
func (*Session) RenameTables ¶
func (s *Session) RenameTables( ctx context.Context, opts ...options.RenameTablesOption, ) (err error)
RenameTables renames tables.
func (*Session) SetStatus ¶
func (s *Session) SetStatus(status table.SessionStatus)
func (*Session) Status ¶
func (s *Session) Status() table.SessionStatus
func (*Session) StreamExecuteScanQuery ¶
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 ¶
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.
Source Files ¶
client.go data_query.go errors.go retry.go session.go statement.go transaction.go ttl.go
Directories ¶
Path | Synopsis |
---|---|
internal/table/config | |
internal/table/scanner |
- Version
- v3.102.0
- Published
- Mar 14, 2025
- Platform
- js/wasm
- Imports
- 42 packages
- Last checked
- 4 minutes ago –
Tools for package owners.