Documentation ¶
Index ¶
- Variables
- func GetTransactionID(txr *Transaction) string
- func Retry(ctx context.Context, s SessionProvider, op Operation) error
- func WithClientTrace(ctx context.Context, t ClientTrace) context.Context
- func WithRetryTrace(ctx context.Context, t RetryTrace) context.Context
- func WithSessionPoolTrace(ctx context.Context, t SessionPoolTrace) context.Context
- type AlterTableOption
- func WithAddColumn(name string, typ ydb.Type) AlterTableOption
- func WithAddColumnFamilies(cf ...ColumnFamily) AlterTableOption
- func WithAddColumnMeta(column Column) AlterTableOption
- func WithAlterAttribute(key, value string) AlterTableOption
- func WithAlterColumnFamilies(cf ...ColumnFamily) AlterTableOption
- func WithAlterKeyBloomFilter(f ydb.FeatureFlag) AlterTableOption
- func WithAlterPartitionSettingsObject(ps PartitioningSettings) AlterTableOption
- func WithAlterPartitioningSettings(opts ...PartitioningSettingsOption) AlterTableOptiondeprecated
- func WithAlterReadReplicasSettings(rr ReadReplicasSettings) AlterTableOption
- func WithAlterStorageSettings(ss StorageSettings) AlterTableOption
- func WithDropColumn(name string) AlterTableOption
- func WithDropTTL() AlterTableOptiondeprecated
- func WithDropTimeToLive() AlterTableOption
- func WithSetTTL(settings TTLSettings) AlterTableOptiondeprecated
- func WithSetTimeToLiveSettings(settings TimeToLiveSettings) AlterTableOption
- type BeginTransactionDoneInfo
- type BeginTransactionStartInfo
- type CachingPolicyDescription
- type CachingPolicyOption
- type Client
- type ClientTrace
- type Column
- type ColumnFamily
- type ColumnFamilyCompression
- type CommitTransactionDoneInfo
- type CommitTransactionOption
- type CommitTransactionStartInfo
- type CompactionPolicyDescription
- type CompactionPolicyOption
- type CompilationStats
- type CopyTableOption
- type CreateSessionDoneInfo
- type CreateSessionStartInfo
- type CreateTableOption
- func WithAttribute(key, value string) CreateTableOption
- func WithColumn(name string, typ ydb.Type) CreateTableOption
- func WithColumnFamilies(cf ...ColumnFamily) CreateTableOption
- func WithColumnMeta(column Column) CreateTableOption
- func WithIndex(name string, opts ...IndexOption) CreateTableOption
- func WithKeyBloomFilter(f ydb.FeatureFlag) CreateTableOption
- func WithPartitioningSettings(opts ...PartitioningSettingsOption) CreateTableOptiondeprecated
- func WithPartitioningSettingsObject(ps PartitioningSettings) CreateTableOption
- func WithPrimaryKeyColumn(columns ...string) CreateTableOption
- func WithProfile(opts ...ProfileOption) CreateTableOption
- func WithReadReplicasSettings(rr ReadReplicasSettings) CreateTableOption
- func WithStorageSettings(ss StorageSettings) CreateTableOption
- func WithTTL(settings TTLSettings) CreateTableOptiondeprecated
- func WithTimeToLiveSettings(settings TimeToLiveSettings) CreateTableOption
- type DataQuery
- type DataQueryExplanation
- type DeleteSessionDoneInfo
- type DeleteSessionStartInfo
- type DescribeTableOption
- type Description
- type DropTableOption
- type ExecuteDataQueryDoneInfo
- type ExecuteDataQueryOption
- type ExecuteDataQueryStartInfo
- type ExecuteScanQueryOption
- type ExecuteScanQueryRequestMode
- type ExecuteSchemeQueryOption
- type ExecutionPolicyDescription
- type ExecutionPolicyOption
- type IndexDescription
- type IndexOption
- type IndexType
- type KeepAliveDoneInfo
- type KeepAliveStartInfo
- type KeyRange
- type Operation
- type OperationFunc
- type OperationStats
- type ParameterOption
- type PartitionStats
- type PartitioningMode
- type PartitioningPolicyDescription
- type PartitioningPolicyOption
- func WithPartitioningPolicyExplicitPartitions(splitPoints ...ydb.Value) PartitioningPolicyOption
- func WithPartitioningPolicyMode(mode PartitioningMode) PartitioningPolicyOption
- func WithPartitioningPolicyPreset(name string) PartitioningPolicyOption
- func WithPartitioningPolicyUniformPartitions(n uint64) PartitioningPolicyOption
- type PartitioningSettings
- type PartitioningSettingsOption
- func WithMaxPartitionsCount(maxPartitionsCount uint64) PartitioningSettingsOption
- func WithMinPartitionsCount(minPartitionsCount uint64) PartitioningSettingsOption
- func WithPartitionSizeMb(partitionSizeMb uint64) PartitioningSettingsOption
- func WithPartitioningByLoad(flag ydb.FeatureFlag) PartitioningSettingsOption
- func WithPartitioningBySize(flag ydb.FeatureFlag) PartitioningSettingsOption
- type PrepareDataQueryDoneInfo
- type PrepareDataQueryStartInfo
- type ProfileOption
- func WithCachingPolicy(opts ...CachingPolicyOption) ProfileOption
- func WithCompactionPolicy(opts ...CompactionPolicyOption) ProfileOption
- func WithExecutionPolicy(opts ...ExecutionPolicyOption) ProfileOption
- func WithPartitioningPolicy(opts ...PartitioningPolicyOption) ProfileOption
- func WithProfilePreset(name string) ProfileOption
- func WithReplicationPolicy(opts ...ReplicationPolicyOption) ProfileOption
- func WithStoragePolicy(opts ...StoragePolicyOption) ProfileOption
- type QueryCachePolicyOption
- type QueryParameters
- type QueryPhase
- type QueryStats
- type ReadReplicasSettings
- type ReadReplicasType
- type ReadTableOption
- func ReadColumn(name string) ReadTableOption
- func ReadGreater(x ydb.Value) ReadTableOption
- func ReadGreaterOrEqual(x ydb.Value) ReadTableOption
- func ReadKeyRange(x KeyRange) ReadTableOption
- func ReadLess(x ydb.Value) ReadTableOption
- func ReadLessOrEqual(x ydb.Value) ReadTableOption
- func ReadOrdered() ReadTableOption
- func ReadRowLimit(n uint64) ReadTableOption
- type ReplicationPolicyDescription
- type ReplicationPolicyOption
- func WithReplicationPolicyAllowPromotion(flag ydb.FeatureFlag) ReplicationPolicyOption
- func WithReplicationPolicyCreatePerAZ(flag ydb.FeatureFlag) ReplicationPolicyOption
- func WithReplicationPolicyPreset(name string) ReplicationPolicyOption
- func WithReplicationPolicyReplicasCount(n uint32) ReplicationPolicyOption
- type Result
- func (r *Result) Close() error
- func (r *Result) Columns(it func(Column))
- func (r *Result) Err() error
- func (r *Result) HasNextResultSet() bool
- func (r *Result) HasNextSet() booldeprecated
- func (r *Result) NextResultSet(ctx context.Context, columns ...string) bool
- func (r *Result) NextSet(columns ...string) booldeprecated
- func (r *Result) NextStreamSet(ctx context.Context, columns ...string) booldeprecated
- func (r *Result) RowCount() (n int)
- func (r *Result) SetCount() int
- func (r *Result) SetRowCount() int
- func (r *Result) SetRowItemCount() int
- func (r *Result) Stats() (stats QueryStats)
- func (r *Result) Truncated() bool
- type RetryLoopDoneInfo
- type RetryLoopStartInfo
- type RetryTrace
- type Retryer
- type RollbackTransactionDoneInfo
- type RollbackTransactionStartInfo
- type Session
- func (s *Session) Address() string
- func (s *Session) AlterTable(ctx context.Context, path string, opts ...AlterTableOption) (err error)
- func (s *Session) BeginTransaction(ctx context.Context, tx *TransactionSettings) (x *Transaction, err error)
- func (s *Session) BulkUpsert(ctx context.Context, table string, rows ydb.Value) (err error)
- func (s *Session) Close(ctx context.Context) (err error)
- func (s *Session) CopyTable(ctx context.Context, dst, src string, _ ...CopyTableOption) (err error)
- func (s *Session) CreateTable(ctx context.Context, path string, opts ...CreateTableOption) (err error)
- func (s *Session) DescribeTable(ctx context.Context, path string, opts ...DescribeTableOption) (desc Description, err error)
- func (s *Session) DescribeTableOptions(ctx context.Context) (desc TableOptionsDescription, err error)
- func (s *Session) DropTable(ctx context.Context, path string, opts ...DropTableOption) (err error)
- func (s *Session) Execute(ctx context.Context, tx *TransactionControl, query string, ...) (txr *Transaction, r *Result, err error)
- func (s *Session) ExecuteSchemeQuery(ctx context.Context, query string, opts ...ExecuteSchemeQueryOption) (err error)
- func (s *Session) Explain(ctx context.Context, query string) (exp DataQueryExplanation, err error)
- func (s *Session) KeepAlive(ctx context.Context) (info SessionInfo, err error)
- func (s *Session) OnClose(cb func())
- func (s *Session) Prepare(ctx context.Context, query string) (stmt *Statement, err error)
- func (s *Session) StreamExecuteScanQuery(ctx context.Context, query string, params *QueryParameters, ...) (_ *Result, err error)
- func (s *Session) StreamReadTable(ctx context.Context, path string, opts ...ReadTableOption) (r *Result, err error)
- type SessionBuilder
- type SessionInfo
- type SessionPool
- func (p *SessionPool) Close(ctx context.Context) (err error)
- func (p *SessionPool) CloseSession(ctx context.Context, s *Session) error
- func (p *SessionPool) Create(ctx context.Context) (s *Session, err error)
- func (p *SessionPool) Get(ctx context.Context) (s *Session, err error)
- func (p *SessionPool) Put(ctx context.Context, s *Session) (err error)
- func (p *SessionPool) PutBusy(ctx context.Context, s *Session) (err error)
- func (p *SessionPool) Stats() SessionPoolStats
- func (p *SessionPool) Take(ctx context.Context, s *Session) (took bool, err error)
- type SessionPoolBusyCheckDoneInfo
- type SessionPoolBusyCheckStartInfo
- type SessionPoolCloseDoneInfo
- type SessionPoolCloseSessionDoneInfo
- type SessionPoolCloseSessionStartInfo
- type SessionPoolCloseStartInfo
- type SessionPoolCreateDoneInfo
- type SessionPoolCreateStartInfo
- type SessionPoolGetDoneInfo
- type SessionPoolGetStartInfo
- type SessionPoolPutBusyDoneInfo
- type SessionPoolPutBusyStartInfo
- type SessionPoolPutDoneInfo
- type SessionPoolPutStartInfo
- type SessionPoolStats
- type SessionPoolTakeDoneInfo
- type SessionPoolTakeStartInfo
- type SessionPoolTakeWaitInfo
- type SessionPoolTrace
- type SessionPoolWaitDoneInfo
- type SessionPoolWaitStartInfo
- type SessionProvider
- type SessionProviderFunc
- func (f SessionProviderFunc) CloseSession(ctx context.Context, s *Session) error
- func (f SessionProviderFunc) Get(ctx context.Context) (*Session, error)
- func (f SessionProviderFunc) Put(ctx context.Context, s *Session) error
- func (f SessionProviderFunc) PutBusy(ctx context.Context, s *Session) errordeprecated
- type SessionStatus
- type Statement
- type StoragePolicyDescription
- type StoragePolicyOption
- func WithStoragePolicyData(kind string) StoragePolicyOption
- func WithStoragePolicyExternal(kind string) StoragePolicyOption
- func WithStoragePolicyKeepInMemory(flag ydb.FeatureFlag) StoragePolicyOption
- func WithStoragePolicyLog(kind string) StoragePolicyOption
- func WithStoragePolicyPreset(name string) StoragePolicyOption
- func WithStoragePolicySyslog(kind string) StoragePolicyOption
- type StoragePool
- type StorageSettings
- type StreamExecuteScanQueryDoneInfo
- type StreamExecuteScanQueryStartInfo
- type StreamReadTableDoneInfo
- type StreamReadTableStartInfo
- type TTLSettings
- type TableAccess
- type TableOptionsDescription
- type TableProfileDescription
- type TableStats
- type TimeToLiveMode
- type TimeToLiveSettings
- type TimeToLiveUnit
- type Transaction
- func (tx *Transaction) Commit(ctx context.Context) (err error)deprecated
- func (tx *Transaction) CommitTx(ctx context.Context, opts ...CommitTransactionOption) (result *Result, err error)
- func (tx *Transaction) Execute(ctx context.Context, query string, params *QueryParameters, ...) (r *Result, err error)
- func (tx *Transaction) ExecuteStatement(ctx context.Context, stmt *Statement, params *QueryParameters, ...) (r *Result, err error)
- func (tx *Transaction) Rollback(ctx context.Context) (err error)
- type TransactionControl
- type TransactionSettings
- type TxControlOption
- type TxOnlineReadOnlyOption
- type TxOption
Constants ¶
This section is empty.
Variables ¶
var ( DefaultSessionPoolKeepAliveTimeout = 500 * time.Millisecond DefaultSessionPoolDeleteTimeout = 500 * time.Millisecond DefaultSessionPoolCreateSessionTimeout = 5 * time.Second DefaultSessionPoolIdleThreshold = 5 * time.Minute DefaultSessionPoolSizeLimit = 50 DefaultKeepAliveMinSize = 10 DefaultIdleKeepAliveThreshold = 2 // Deprecated: has no effect now DefaultSessionPoolBusyCheckInterval = 1 * time.Second )
var ( // ErrSessionPoolClosed is returned by a SessionPool instance to indicate // that pool is closed and not able to complete requested operation. ErrSessionPoolClosed = errors.New("ydb: table: session pool is closed") // ErrSessionPoolOverflow is returned by a SessionPool instance to indicate // that the pool is full and requested operation is not able to complete. ErrSessionPoolOverflow = errors.New("ydb: table: session pool overflow") // ErrSessionUnknown is returned by a SessionPool instance to indicate that // requested session does not exist within the pool. ErrSessionUnknown = errors.New("ydb: table: unknown session") // ErrNoProgress is returned by a SessionPool instance to indicate that // operation could not be completed. ErrNoProgress = errors.New("ydb: table: no progress") )
var DefaultMaxQueryCacheSize = 1000
Deprecated: use server-side query cache with keep-in-memory flag control instead
Functions ¶
func GetTransactionID ¶
func GetTransactionID(txr *Transaction) string
func Retry ¶
func Retry(ctx context.Context, s SessionProvider, op Operation) error
Retry calls Retryer.Do() configured with default values.
func WithClientTrace ¶
func WithClientTrace(ctx context.Context, t ClientTrace) context.Context
WithClientTrace returns context which has associated ClientTrace with it.
func WithRetryTrace ¶
func WithRetryTrace(ctx context.Context, t RetryTrace) context.Context
WithRetryTrace returns context which has associated RetryTrace with it.
func WithSessionPoolTrace ¶
func WithSessionPoolTrace(ctx context.Context, t SessionPoolTrace) context.Context
WithSessionPoolTrace returns context which has associated SessionPoolTrace with it.
Types ¶
type AlterTableOption ¶
type AlterTableOption func(*alterTableDesc)
func WithAddColumn ¶
func WithAddColumn(name string, typ ydb.Type) AlterTableOption
func WithAddColumnFamilies ¶
func WithAddColumnFamilies(cf ...ColumnFamily) AlterTableOption
func WithAddColumnMeta ¶
func WithAddColumnMeta(column Column) AlterTableOption
func WithAlterAttribute ¶
func WithAlterAttribute(key, value string) AlterTableOption
func WithAlterColumnFamilies ¶
func WithAlterColumnFamilies(cf ...ColumnFamily) AlterTableOption
func WithAlterKeyBloomFilter ¶
func WithAlterKeyBloomFilter(f ydb.FeatureFlag) AlterTableOption
func WithAlterPartitionSettingsObject ¶
func WithAlterPartitionSettingsObject(ps PartitioningSettings) AlterTableOption
func WithAlterPartitioningSettings
deprecated
func WithAlterPartitioningSettings(opts ...PartitioningSettingsOption) AlterTableOption
Deprecated: use WithAlterPartitionSettingsObject instead. Will be removed after Jan 2021.
func WithAlterReadReplicasSettings ¶
func WithAlterReadReplicasSettings(rr ReadReplicasSettings) AlterTableOption
func WithAlterStorageSettings ¶
func WithAlterStorageSettings(ss StorageSettings) AlterTableOption
func WithDropColumn ¶
func WithDropColumn(name string) AlterTableOption
func WithDropTTL
deprecated
func WithDropTTL() AlterTableOption
Deprecated: use WithDropTimeToLive instead. Will be removed after Jan 2022.
func WithDropTimeToLive ¶
func WithDropTimeToLive() AlterTableOption
func WithSetTTL
deprecated
func WithSetTTL(settings TTLSettings) AlterTableOption
Deprecated: use WithSetTimeToLiveSettings instead. Will be removed after Jan 2022.
func WithSetTimeToLiveSettings ¶
func WithSetTimeToLiveSettings(settings TimeToLiveSettings) AlterTableOption
type CachingPolicyOption ¶
type CachingPolicyOption func(*cachingPolicy)
func WithCachingPolicyPreset ¶
func WithCachingPolicyPreset(name string) CachingPolicyOption
type Client ¶
type Client struct { Driver ydb.Driver Trace ClientTrace // Deprecated: use server-side query cache with keep-in-memory flag control instead // MaxQueryCacheSize limits maximum number of queries which able to live in // cache. Note that cache is not shared across sessions. // // If MaxQueryCacheSize equal to zero, then the DefaultMaxQueryCacheSize is used. // // If MaxQueryCacheSize is less than zero, then client not used query cache. MaxQueryCacheSize int }
Client contains logic of creation of ydb table sessions.
type ClientTrace ¶
type ClientTrace struct { OnCreateSession func(CreateSessionStartInfo) func(CreateSessionDoneInfo) OnKeepAlive func(KeepAliveStartInfo) func(KeepAliveDoneInfo) OnDeleteSession func(DeleteSessionStartInfo) func(DeleteSessionDoneInfo) OnPrepareDataQuery func(PrepareDataQueryStartInfo) func(PrepareDataQueryDoneInfo) OnExecuteDataQuery func(ExecuteDataQueryStartInfo) func(ExecuteDataQueryDoneInfo) OnStreamReadTable func(StreamReadTableStartInfo) func(StreamReadTableDoneInfo) OnStreamExecuteScanQuery func(StreamExecuteScanQueryStartInfo) func(StreamExecuteScanQueryDoneInfo) OnBeginTransaction func(BeginTransactionStartInfo) func(BeginTransactionDoneInfo) OnCommitTransaction func(CommitTransactionStartInfo) func(CommitTransactionDoneInfo) OnRollbackTransaction func(RollbackTransactionStartInfo) func(RollbackTransactionDoneInfo) }
func ContextClientTrace ¶
func ContextClientTrace(ctx context.Context) ClientTrace
ContextClientTrace returns ClientTrace associated with ctx. If there is no ClientTrace associated with ctx then zero value of ClientTrace is returned.
func (ClientTrace) Compose ¶
func (t ClientTrace) Compose(x ClientTrace) (ret ClientTrace)
Compose returns a new ClientTrace which has functional fields composed both from t and x.
type ColumnFamily ¶
type ColumnFamily struct { Name string Data StoragePool Compression ColumnFamilyCompression KeepInMemory ydb.FeatureFlag }
type ColumnFamilyCompression ¶
type ColumnFamilyCompression byte
const ( ColumnFamilyCompressionUnknown ColumnFamilyCompression = iota ColumnFamilyCompressionNone ColumnFamilyCompressionLZ4 )
func (ColumnFamilyCompression) String ¶
func (c ColumnFamilyCompression) String() string
type CommitTransactionOption ¶
type CommitTransactionOption func(*commitTransactionDesc)
func WithCommitCollectStatsModeBasic ¶
func WithCommitCollectStatsModeBasic() CommitTransactionOption
func WithCommitCollectStatsModeNone ¶
func WithCommitCollectStatsModeNone() CommitTransactionOption
type CompactionPolicyOption ¶
type CompactionPolicyOption func(*compactionPolicy)
func WithCompactionPolicyPreset ¶
func WithCompactionPolicyPreset(name string) CompactionPolicyOption
type CompilationStats ¶
CompilationStats holds query compilation statistics.
type CopyTableOption ¶
type CopyTableOption func(*copyTableDesc)
type CreateSessionDoneInfo ¶
type CreateSessionStartInfo ¶
type CreateTableOption ¶
type CreateTableOption func(d *createTableDesc)
func WithAttribute ¶
func WithAttribute(key, value string) CreateTableOption
func WithColumn ¶
func WithColumn(name string, typ ydb.Type) CreateTableOption
func WithColumnFamilies ¶
func WithColumnFamilies(cf ...ColumnFamily) CreateTableOption
func WithColumnMeta ¶
func WithColumnMeta(column Column) CreateTableOption
func WithIndex ¶
func WithIndex(name string, opts ...IndexOption) CreateTableOption
func WithKeyBloomFilter ¶
func WithKeyBloomFilter(f ydb.FeatureFlag) CreateTableOption
func WithPartitioningSettings
deprecated
func WithPartitioningSettings(opts ...PartitioningSettingsOption) CreateTableOption
Deprecated: use WithPartitioningSettingsObject instead. Will be removed after Jan 2021.
func WithPartitioningSettingsObject ¶
func WithPartitioningSettingsObject(ps PartitioningSettings) CreateTableOption
func WithPrimaryKeyColumn ¶
func WithPrimaryKeyColumn(columns ...string) CreateTableOption
func WithProfile ¶
func WithProfile(opts ...ProfileOption) CreateTableOption
func WithReadReplicasSettings ¶
func WithReadReplicasSettings(rr ReadReplicasSettings) CreateTableOption
func WithStorageSettings ¶
func WithStorageSettings(ss StorageSettings) CreateTableOption
func WithTTL
deprecated
func WithTTL(settings TTLSettings) CreateTableOption
Deprecated: use WithTimeToLiveSettings instead. Will be removed after Jan 2022.
func WithTimeToLiveSettings ¶
func WithTimeToLiveSettings(settings TimeToLiveSettings) CreateTableOption
type DataQueryExplanation ¶
DataQueryExplanation is a result of ExplainDataQuery call.
type DeleteSessionDoneInfo ¶
type DeleteSessionStartInfo ¶
type DescribeTableOption ¶
type DescribeTableOption func(d *describeTableDesc)
func WithPartitionStats ¶
func WithPartitionStats() DescribeTableOption
func WithShardKeyBounds ¶
func WithShardKeyBounds() DescribeTableOption
func WithTableStats ¶
func WithTableStats() DescribeTableOption
type Description ¶
type Description struct { Name string Columns []Column PrimaryKey []string KeyRanges []KeyRange Stats *TableStats ColumnFamilies []ColumnFamily Attributes map[string]string ReadReplicaSettings ReadReplicasSettings StorageSettings StorageSettings KeyBloomFilter ydb.FeatureFlag PartitioningSettings PartitioningSettings Indexes []IndexDescription // Deprecated: use TimeToLiveSettings instead. // Will be removed after Jan 2022. TTLSettings *TTLSettings TimeToLiveSettings *TimeToLiveSettings }
type DropTableOption ¶
type DropTableOption func(*dropTableDesc)
type ExecuteDataQueryOption ¶
type ExecuteDataQueryOption func(*executeDataQueryDesc)
func WithCollectStatsModeBasic ¶
func WithCollectStatsModeBasic() ExecuteDataQueryOption
func WithCollectStatsModeNone ¶
func WithCollectStatsModeNone() ExecuteDataQueryOption
func WithQueryCachePolicy ¶
func WithQueryCachePolicy(opts ...QueryCachePolicyOption) ExecuteDataQueryOption
type ExecuteScanQueryOption ¶
type ExecuteScanQueryOption func(*executeScanQueryDesc)
func WithExecuteScanQueryMode ¶
func WithExecuteScanQueryMode(m ExecuteScanQueryRequestMode) ExecuteScanQueryOption
type ExecuteScanQueryRequestMode ¶
type ExecuteScanQueryRequestMode byte
const ( ExecuteScanQueryRequestModeExec ExecuteScanQueryRequestMode = iota ExecuteScanQueryRequestModeExplain )
type ExecuteSchemeQueryOption ¶
type ExecuteSchemeQueryOption func(*executeSchemeQueryDesc)
type ExecutionPolicyOption ¶
type ExecutionPolicyOption func(*executionPolicy)
func WithExecutionPolicyPreset ¶
func WithExecutionPolicyPreset(name string) ExecutionPolicyOption
type IndexDescription ¶ added in v2.7.0
type IndexDescription struct { Name string IndexColumns []string Status Ydb_Table.TableIndexDescription_Status }
type IndexOption ¶
type IndexOption func(d *indexDesc)
func WithIndexColumns ¶
func WithIndexColumns(columns ...string) IndexOption
func WithIndexType ¶
func WithIndexType(t IndexType) IndexOption
type IndexType ¶
type IndexType interface {
// contains filtered or unexported methods
}
func GlobalAsyncIndex ¶ added in v2.10.0
func GlobalAsyncIndex() IndexType
func GlobalIndex ¶
func GlobalIndex() IndexType
type KeepAliveDoneInfo ¶
type KeepAliveDoneInfo struct { Context context.Context Session *Session SessionInfo SessionInfo Error error }
type KeepAliveStartInfo ¶
type Operation ¶
type Operation interface { // Do prepares actions need to be done for this operation. // // Implementations MUST NOT wrap ydb/table errors in order to leave the // ability to distinguish error type and make a decision about the next // retry attempt. Do(context.Context, *Session) error }
Operation is the interface that holds an operation for retry.
type OperationFunc ¶
OperationFunc is an adapter to allow the use of ordinary functions as Operation.
type OperationStats ¶
type ParameterOption ¶
type ParameterOption func(queryParams)
func ValueParam ¶
func ValueParam(name string, v ydb.Value) ParameterOption
type PartitionStats ¶
type PartitioningMode ¶
type PartitioningMode byte
const ( PartitioningUnknown PartitioningMode = iota PartitioningDisabled PartitioningAutoSplit PartitioningAutoSplitMerge )
type PartitioningPolicyOption ¶
type PartitioningPolicyOption func(*partitioningPolicy)
func WithPartitioningPolicyExplicitPartitions ¶
func WithPartitioningPolicyExplicitPartitions(splitPoints ...ydb.Value) PartitioningPolicyOption
func WithPartitioningPolicyMode ¶
func WithPartitioningPolicyMode(mode PartitioningMode) PartitioningPolicyOption
func WithPartitioningPolicyPreset ¶
func WithPartitioningPolicyPreset(name string) PartitioningPolicyOption
func WithPartitioningPolicyUniformPartitions ¶
func WithPartitioningPolicyUniformPartitions(n uint64) PartitioningPolicyOption
type PartitioningSettings ¶
type PartitioningSettingsOption ¶
type PartitioningSettingsOption func(settings *ydbPartitioningSettings)
func WithMaxPartitionsCount ¶
func WithMaxPartitionsCount(maxPartitionsCount uint64) PartitioningSettingsOption
func WithMinPartitionsCount ¶
func WithMinPartitionsCount(minPartitionsCount uint64) PartitioningSettingsOption
func WithPartitionSizeMb ¶
func WithPartitionSizeMb(partitionSizeMb uint64) PartitioningSettingsOption
func WithPartitioningByLoad ¶
func WithPartitioningByLoad(flag ydb.FeatureFlag) PartitioningSettingsOption
func WithPartitioningBySize ¶
func WithPartitioningBySize(flag ydb.FeatureFlag) PartitioningSettingsOption
type ProfileOption ¶
type ProfileOption func(p *profile)
func WithCachingPolicy ¶
func WithCachingPolicy(opts ...CachingPolicyOption) ProfileOption
func WithCompactionPolicy ¶
func WithCompactionPolicy(opts ...CompactionPolicyOption) ProfileOption
func WithExecutionPolicy ¶
func WithExecutionPolicy(opts ...ExecutionPolicyOption) ProfileOption
func WithPartitioningPolicy ¶
func WithPartitioningPolicy(opts ...PartitioningPolicyOption) ProfileOption
func WithProfilePreset ¶
func WithProfilePreset(name string) ProfileOption
func WithReplicationPolicy ¶
func WithReplicationPolicy(opts ...ReplicationPolicyOption) ProfileOption
func WithStoragePolicy ¶
func WithStoragePolicy(opts ...StoragePolicyOption) ProfileOption
type QueryCachePolicyOption ¶
type QueryCachePolicyOption func(*queryCachePolicy)
func WithQueryCachePolicyKeepInCache ¶
func WithQueryCachePolicyKeepInCache() QueryCachePolicyOption
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, value ydb.Value))
func (*QueryParameters) String ¶
func (q *QueryParameters) String() string
type QueryPhase ¶
type QueryPhase struct { Duration time.Duration CPUTime time.Duration AffectedShards uint64 // contains filtered or unexported fields }
QueryPhase holds query execution phase statistics.
func (*QueryPhase) NextTableAccess ¶
func (q *QueryPhase) NextTableAccess() (t TableAccess, ok bool)
NextTableAccess returns next accessed table within query execution phase.
If ok flag is false, then there are no more accessed tables and t is invalid.
type QueryStats ¶
type QueryStats struct {
// contains filtered or unexported fields
}
QueryStats holds query execution statistics.
func (*QueryStats) Compilation ¶
func (s *QueryStats) Compilation() (c *CompilationStats)
func (*QueryStats) NextPhase ¶
func (s *QueryStats) NextPhase() (p QueryPhase, ok bool)
NextPhase returns next execution phase within query. If ok flag is false, then there are no more phases and p is invalid.
func (*QueryStats) ProcessCPUTime ¶
func (s *QueryStats) ProcessCPUTime() time.Duration
type ReadReplicasSettings ¶
type ReadReplicasSettings struct { Type ReadReplicasType Count uint64 }
type ReadReplicasType ¶
type ReadReplicasType byte
const ( ReadReplicasPerAzReadReplicas ReadReplicasType = iota ReadReplicasAnyAzReadReplicas )
type ReadTableOption ¶
type ReadTableOption func(*readTableDesc)
Read table options
func ReadColumn ¶
func ReadColumn(name string) ReadTableOption
func ReadGreater ¶
func ReadGreater(x ydb.Value) ReadTableOption
func ReadGreaterOrEqual ¶
func ReadGreaterOrEqual(x ydb.Value) ReadTableOption
func ReadKeyRange ¶
func ReadKeyRange(x KeyRange) ReadTableOption
ReadKeyRange returns ReadTableOption which makes ReadTable read values in range [x.From, x.To).
Both x.From and x.To may be nil.
func ReadLess ¶
func ReadLess(x ydb.Value) ReadTableOption
func ReadLessOrEqual ¶
func ReadLessOrEqual(x ydb.Value) ReadTableOption
func ReadOrdered ¶
func ReadOrdered() ReadTableOption
func ReadRowLimit ¶
func ReadRowLimit(n uint64) ReadTableOption
type ReplicationPolicyOption ¶
type ReplicationPolicyOption func(*replicationPolicy)
func WithReplicationPolicyAllowPromotion ¶
func WithReplicationPolicyAllowPromotion(flag ydb.FeatureFlag) ReplicationPolicyOption
func WithReplicationPolicyCreatePerAZ ¶
func WithReplicationPolicyCreatePerAZ(flag ydb.FeatureFlag) ReplicationPolicyOption
func WithReplicationPolicyPreset ¶
func WithReplicationPolicyPreset(name string) ReplicationPolicyOption
func WithReplicationPolicyReplicasCount ¶
func WithReplicationPolicyReplicasCount(n uint32) ReplicationPolicyOption
type Result ¶
Result is a result of a query.
Use NextResultSet(), NextRow() and Scan() to advance through the result sets, its rows and row's items.
res, err := s.Execute(ctx, txc, "SELECT ...") defer res.Close() for res.NextResultSet() { for res.NextRow() { var id int64 var name *string //optional value res.Scan(&id,&name) } } if err := res.Err() { // get any error encountered during iteration // handle error }
If current value under scan is not requested type, then res.Err() become non-nil. After that, NextResultSet(), NextRow() will return false.
func (*Result) Err ¶
Err return scanner error To handle errors, do not need to check after scanning each row It is enough to check after reading all ResultSet
func (*Result) HasNextResultSet ¶ added in v2.8.0
HasNextResultSet reports whether result set may be advanced.
It may be useful to call HasNextResultSet() instead of NextResultSet() to look ahead without advancing the result set.
Note that it does not work with sets from stream.
func (*Result) HasNextSet
deprecated
func (*Result) NextResultSet ¶ added in v2.8.0
NextResultSet selects next result set in the result. columns - names of columns in the resultSet that will be scanned It returns false if there are no more result sets. Stream sets are supported.
func (*Result) RowCount ¶
RowCount returns the number of rows among the all result sets. Deprecated: RowCount with multiple result sets from different queries are misleads Instead - must iterate over result sets and ask SetRowCount() for each current result set
func (*Result) SetCount ¶
SetCount returns number of result sets. Note that it does not work if r is the result of streaming operation.
func (*Result) SetRowCount ¶
SetRowCount returns number of rows in the current result set.
func (*Result) SetRowItemCount ¶
SetRowItemCount returns number of items in the current row.
func (*Result) Stats ¶
func (r *Result) Stats() (stats QueryStats)
Stats returns query execution stats.
type RetryLoopDoneInfo ¶
type RetryLoopStartInfo ¶
type RetryTrace ¶
type RetryTrace struct {
OnLoop func(RetryLoopStartInfo) func(RetryLoopDoneInfo)
}
func ContextRetryTrace ¶
func ContextRetryTrace(ctx context.Context) RetryTrace
ContextRetryTrace returns RetryTrace associated with ctx. If there is no RetryTrace associated with ctx then zero value of RetryTrace is returned.
func (RetryTrace) Compose ¶
func (t RetryTrace) Compose(x RetryTrace) (ret RetryTrace)
Compose returns a new RetryTrace which has functional fields composed both from t and x.
type Retryer ¶
type Retryer struct { // SessionProvider is an interface capable for management of ydb sessions. // SessionProvider must not be nil. SessionProvider SessionProvider // MaxRetries is a number of maximum attempts to retry a failed operation. // If MaxRetries is zero then no attempts will be made. MaxRetries int // RetryChecker contains options of mapping errors to retry mode. // // Note that if RetryChecker's RetryNotFound field is set to true, creation // of prepared statements must always be included in the Operation logic. // Otherwise when prepared statement become removed by any reason from the // server, Retryer will just repeat MaxRetries times reception of statement // not found error. RetryChecker ydb.RetryChecker // Backoff is a selected backoff policy. // Deprecated: use FastBackoff and SlowBackoff instead, has no effect now Backoff ydb.Backoff // FastBackoff is a selected backoff policy. // If backoff is nil, then the ydb.DefaultFastBackoff is used. FastBackoff ydb.Backoff // SlowBackoff is a selected backoff policy. // If backoff is nil, then the ydb.DefaultSlowBackoff is used. SlowBackoff ydb.Backoff // Trace provide tracing of retry logic Trace RetryTrace }
Retryer contains logic of retrying operations failed with retriable errors.
type Session ¶
type Session struct { ID string // 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 ...AlterTableOption) (err error)
AlterTable modifies schema of table at given path with given options.
func (*Session) BeginTransaction ¶
func (s *Session) BeginTransaction(ctx context.Context, tx *TransactionSettings) (x *Transaction, err error)
BeginTransaction begins new transaction within given session with given settings.
func (*Session) BulkUpsert ¶
BulkUpsert uploads given list of ydb struct values to the table.
func (*Session) CreateTable ¶
func (s *Session) CreateTable(ctx context.Context, path string, opts ...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 ...DescribeTableOption) (desc Description, err error)
DescribeTable describes table at given path.
func (*Session) DescribeTableOptions ¶
func (s *Session) DescribeTableOptions(ctx context.Context) (desc TableOptionsDescription, err error)
DescribeTableOptions describes supported table options.
func (*Session) Execute ¶
func (s *Session) Execute( ctx context.Context, tx *TransactionControl, query string, params *QueryParameters, opts ...ExecuteDataQueryOption, ) ( txr *Transaction, r *Result, err error, )
Execute executes given data query represented by text.
func (*Session) ExecuteSchemeQuery ¶
func (s *Session) ExecuteSchemeQuery( ctx context.Context, query string, opts ...ExecuteSchemeQueryOption, ) (err error)
ExecuteSchemeQuery executes scheme query.
func (*Session) KeepAlive ¶
func (s *Session) KeepAlive(ctx context.Context) (info SessionInfo, err error)
KeepAlive keeps idle session alive.
func (*Session) StreamExecuteScanQuery ¶
func (s *Session) StreamExecuteScanQuery( ctx context.Context, query string, params *QueryParameters, opts ...ExecuteScanQueryOption, ) ( _ *Result, 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 NextStreamSet() calls.
func (*Session) StreamReadTable ¶
func (s *Session) StreamReadTable(ctx context.Context, path string, opts ...ReadTableOption) (r *Result, 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 NextStreamSet() calls.
type SessionBuilder ¶
SessionBuilder is the interface that holds logic of creating or deleting sessions.
type SessionInfo ¶
type SessionInfo struct {
Status SessionStatus
}
type SessionPool ¶
type SessionPool struct { // Trace is an optional session lifetime tracing options. Trace SessionPoolTrace // Builder holds an object capable for creating and deleting sessions. // It must not be nil. Builder SessionBuilder // SizeLimit is an upper bound of pooled sessions. // If SizeLimit is less than or equal to zero then the // DefaultSessionPoolSizeLimit variable is used as a limit. SizeLimit int // KeepAliveMinSize is a lower bound for sessions in the pool. If there are more sessions open, then // the excess idle ones will be closed and removed after IdleKeepAliveThreshold is reached for each of them. // If KeepAliveMinSize is less than zero, then no sessions will be preserved // If KeepAliveMinSize is zero, the DefaultKeepAliveMinSize is used KeepAliveMinSize int // IdleKeepAliveThreshold is a number of keepAlive messages to call before the // Session is removed if it is an excess session (see KeepAliveMinSize) // This means that session will be deleted after the expiration of lifetime = IdleThreshold * IdleKeepAliveThreshold // If IdleKeepAliveThreshold is less than zero then it will be treated as infinite and no sessions will // be removed ever. // If IdleKeepAliveThreshold is equal to zero, it will be set to DefaultIdleKeepAliveThreshold IdleKeepAliveThreshold int // IdleThreshold is a maximum duration between any activity within session. // If this threshold reached, KeepAlive() method will be called on idle // session. // // If IdleThreshold is less than zero then there is no idle limit. // If IdleThreshold is zero, then the DefaultSessionPoolIdleThreshold value // is used. IdleThreshold time.Duration // BusyCheckInterval is an interval between busy sessions status checks. // If BusyCheckInterval is less than zero then there busy checking is // disabled. // If BusyCheckInterval is equal to zero, then the // DefaultSessionPoolBusyCheckInterval value is used. // Deprecated: has no effect now BusyCheckInterval time.Duration // Deprecated: unnecessary parameter // it will be removed at next major release // KeepAliveBatchSize is a maximum number sessions taken from the pool to // prepare KeepAlive() call on them in background. // If KeepAliveBatchSize is less than or equal to zero, then there is no // batch limit. KeepAliveBatchSize int // KeepAliveTimeout limits maximum time spent on KeepAlive request // If KeepAliveTimeout is less than or equal to zero then the // DefaultSessionPoolKeepAliveTimeout is used. KeepAliveTimeout time.Duration // CreateSessionTimeout limits maximum time spent on Create session request // If CreateSessionTimeout is less than or equal to zero then the // DefaultSessionPoolCreateSessionTimeout is used. CreateSessionTimeout time.Duration // DeleteTimeout limits maximum time spent on Delete request // If DeleteTimeout is less than or equal to zero then the // DefaultSessionPoolDeleteTimeout is used. DeleteTimeout time.Duration // contains filtered or unexported fields }
SessionPool is a set of Session instances that may be reused. A SessionPool is safe for use by multiple goroutines simultaneously.
func (*SessionPool) Close ¶
func (p *SessionPool) Close(ctx context.Context) (err error)
Close deletes all stored sessions inside SessionPool. It also stops all underlying timers and goroutines. It returns first error occured during stale sessions deletion. Note that even on error it calls Close() on each session.
func (*SessionPool) CloseSession ¶ added in v2.6.0
func (p *SessionPool) CloseSession(ctx context.Context, s *Session) error
CloseSession provides the most effective way of session closing instead of plain session.Close. CloseSession must be fast. If necessary, can be async.
func (*SessionPool) Create ¶
func (p *SessionPool) Create(ctx context.Context) (s *Session, err error)
Create creates new session and returns it. The intended way of Create() usage relates to Take() method.
func (*SessionPool) Get ¶
func (p *SessionPool) Get(ctx context.Context) (s *Session, err error)
Get returns first idle session from the SessionPool and removes it from there. If no items stored in SessionPool it creates new one by calling Builder.CreateSession() method and returns it.
func (*SessionPool) Put ¶
func (p *SessionPool) Put(ctx context.Context, s *Session) (err error)
Put returns session to the SessionPool for further reuse. If pool is already closed Put() calls s.Close(ctx) and returns ErrSessionPoolClosed. If pool is overflow calls s.Close(ctx) and returns ErrSessionPoolOverflow.
Note that Put() must be called only once after being created or received by Get() or Take() calls. In other way it will produce unexpected behavior or panic.
func (*SessionPool) PutBusy ¶
func (p *SessionPool) PutBusy(ctx context.Context, s *Session) (err error)
PutBusy used for putting session into busy checker Deprecated: use Put() instead
func (*SessionPool) Stats ¶
func (p *SessionPool) Stats() SessionPoolStats
func (*SessionPool) Take ¶
Take removes session s from the pool and ensures that s will not be returned by other Take() or Get() calls.
The intended way of Take() use is to create session by calling Create() and Put() it later to prepare KeepAlive tracking when session is idle. When Session becomes active, one should call Take() to stop KeepAlive tracking (simultaneous use of Session is prohibited).
After session returned to the pool by calling PutBusy() it can not be taken by Take() any more. That is, semantically PutBusy() is the same as session's Close().
It is assumed that Take() callers never call Get() method.
type SessionPoolCloseSessionDoneInfo ¶ added in v2.6.0
type SessionPoolCloseSessionStartInfo ¶ added in v2.6.0
type SessionPoolCreateDoneInfo ¶ added in v2.6.0
type SessionPoolCreateStartInfo ¶ added in v2.6.0
type SessionPoolGetDoneInfo ¶
type SessionPoolGetStartInfo ¶
type SessionPoolPutBusyDoneInfo ¶ added in v2.6.0
type SessionPoolPutBusyStartInfo ¶ added in v2.6.0
type SessionPoolPutDoneInfo ¶
type SessionPoolPutStartInfo ¶
type SessionPoolStats ¶
type SessionPoolTakeDoneInfo ¶
type SessionPoolTakeWaitInfo ¶
type SessionPoolTrace ¶
type SessionPoolTrace struct { OnCreate func(SessionPoolCreateStartInfo) func(SessionPoolCreateDoneInfo) OnGet func(SessionPoolGetStartInfo) func(SessionPoolGetDoneInfo) OnWait func(SessionPoolWaitStartInfo) func(SessionPoolWaitDoneInfo) OnBusyCheck func(SessionPoolBusyCheckStartInfo) func(SessionPoolBusyCheckDoneInfo) OnTake func(SessionPoolTakeStartInfo) func(SessionPoolTakeDoneInfo) OnTakeWait func(SessionPoolTakeWaitInfo) OnPut func(SessionPoolPutStartInfo) func(SessionPoolPutDoneInfo) OnPutBusy func(SessionPoolPutBusyStartInfo) func(SessionPoolPutBusyDoneInfo) OnCloseSession func(SessionPoolCloseSessionStartInfo) func(SessionPoolCloseSessionDoneInfo) OnClose func(SessionPoolCloseStartInfo) func(SessionPoolCloseDoneInfo) }
func ContextSessionPoolTrace ¶
func ContextSessionPoolTrace(ctx context.Context) SessionPoolTrace
ContextSessionPoolTrace returns SessionPoolTrace associated with ctx. If there is no SessionPoolTrace associated with ctx then zero value of SessionPoolTrace is returned.
func (SessionPoolTrace) Compose ¶
func (t SessionPoolTrace) Compose(x SessionPoolTrace) (ret SessionPoolTrace)
Compose returns a new SessionPoolTrace which has functional fields composed both from t and x.
type SessionPoolWaitDoneInfo ¶
type SessionProvider ¶
type SessionProvider interface { // Get returns alive idle session or creates new one. Get(context.Context) (*Session, error) // Put takes no longer needed session for reuse or deletion depending // on implementation. // Put must be fast, if necessary must be async Put(context.Context, *Session) (err error) // PutBusy takes session with not yet completed operation inside. // It gives full ownership of s to session provider. // PutBusy must be fast, if necessary must be async // Deprecated: use conditionally Put() or CloseSession() for uncertain // sessions instead PutBusy(context.Context, *Session) (err error) // CloseSession provides the most effective way of session closing // instead of plain session.Close. // CloseSession must be fast. If necessary, can be async. CloseSession(ctx context.Context, s *Session) error }
SessionProvider is the interface that holds session lifecycle logic.
func SingleSession ¶
func SingleSession(s *Session) SessionProvider
SingleSession returns SessionProvider that uses only given session durting retries.
type SessionProviderFunc ¶
type SessionProviderFunc struct { OnGet func(context.Context) (*Session, error) OnPut func(context.Context, *Session) error // Deprecated: has no effect now OnPutBusy func(context.Context, *Session) error }
func (SessionProviderFunc) CloseSession ¶ added in v2.6.0
func (f SessionProviderFunc) CloseSession(ctx context.Context, s *Session) error
func (SessionProviderFunc) Get ¶
func (f SessionProviderFunc) Get(ctx context.Context) (*Session, error)
type SessionStatus ¶
type SessionStatus byte
const ( SessionStatusUnknown SessionStatus = iota SessionReady SessionBusy )
func (SessionStatus) String ¶
func (s SessionStatus) String() string
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement is a prepared statement. Like a single Session, it is not safe for concurrent use by multiple goroutines.
func (*Statement) Execute ¶
func (s *Statement) Execute( ctx context.Context, tx *TransactionControl, params *QueryParameters, opts ...ExecuteDataQueryOption, ) ( txr *Transaction, r *Result, err error, )
Execute executes prepared data query.
type StoragePolicyOption ¶
type StoragePolicyOption func(*storagePolicy)
func WithStoragePolicyData ¶
func WithStoragePolicyData(kind string) StoragePolicyOption
func WithStoragePolicyExternal ¶
func WithStoragePolicyExternal(kind string) StoragePolicyOption
func WithStoragePolicyKeepInMemory ¶
func WithStoragePolicyKeepInMemory(flag ydb.FeatureFlag) StoragePolicyOption
func WithStoragePolicyLog ¶
func WithStoragePolicyLog(kind string) StoragePolicyOption
func WithStoragePolicyPreset ¶
func WithStoragePolicyPreset(name string) StoragePolicyOption
func WithStoragePolicySyslog ¶
func WithStoragePolicySyslog(kind string) StoragePolicyOption
type StoragePool ¶
type StoragePool struct {
Media string
}
type StorageSettings ¶
type StorageSettings struct { TableCommitLog0 StoragePool TableCommitLog1 StoragePool External StoragePool StoreExternalBlobs ydb.FeatureFlag }
type StreamExecuteScanQueryStartInfo ¶
type StreamExecuteScanQueryStartInfo struct { Context context.Context Session *Session Query *DataQuery Parameters *QueryParameters }
type StreamReadTableDoneInfo ¶
type TTLSettings ¶
Deprecated use TimeToLiveSettings instead. Will be removed after Jan 2022.
type TableAccess ¶
type TableAccess struct { Name string Reads OperationStats Updates OperationStats Deletes OperationStats }
TableAccess contains query execution phase's table access statistics.
type TableOptionsDescription ¶
type TableOptionsDescription struct { TableProfilePresets []TableProfileDescription StoragePolicyPresets []StoragePolicyDescription CompactionPolicyPresets []CompactionPolicyDescription PartitioningPolicyPresets []PartitioningPolicyDescription ExecutionPolicyPresets []ExecutionPolicyDescription ReplicationPolicyPresets []ReplicationPolicyDescription CachingPolicyPresets []CachingPolicyDescription }
type TableProfileDescription ¶
type TableProfileDescription struct { Name string Labels map[string]string DefaultStoragePolicy string DefaultCompactionPolicy string DefaultPartitioningPolicy string DefaultExecutionPolicy string DefaultReplicationPolicy string DefaultCachingPolicy string AllowedStoragePolicies []string AllowedCompactionPolicies []string AllowedPartitioningPolicies []string AllowedExecutionPolicies []string AllowedReplicationPolicies []string AllowedCachingPolicies []string }
type TableStats ¶
type TimeToLiveMode ¶
type TimeToLiveMode byte
const ( TimeToLiveModeDateType TimeToLiveMode = iota TimeToLiveModeValueSinceUnixEpoch )
type TimeToLiveSettings ¶
type TimeToLiveSettings struct { ColumnName string ExpireAfterSeconds uint32 ColumnUnit *TimeToLiveUnit // valid with Mode = TimeToLiveModeValueSinceUnixEpoch // Specifies mode Mode TimeToLiveMode }
func (*TimeToLiveSettings) ToYDB ¶
func (ttl *TimeToLiveSettings) ToYDB() *Ydb_Table.TtlSettings
type TimeToLiveUnit ¶
type TimeToLiveUnit int32
const ( TimeToLiveUnitUnspecified TimeToLiveUnit = iota TimeToLiveUnitSeconds TimeToLiveUnitMilliseconds TimeToLiveUnitMicroseconds TimeToLiveUnitNanoseconds )
func (*TimeToLiveUnit) ToYDB ¶
func (unit *TimeToLiveUnit) ToYDB() Ydb_Table.ValueSinceUnixEpochModeSettings_Unit
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction is a database transaction. Hence session methods are not goroutine safe, Transaction is not goroutine safe either.
func (*Transaction) Commit
deprecated
func (tx *Transaction) Commit(ctx context.Context) (err error)
Deprecated: Use CommitTx instead Commit commits specified active transaction.
func (*Transaction) CommitTx ¶
func (tx *Transaction) CommitTx(ctx context.Context, opts ...CommitTransactionOption) (result *Result, err error)
CommitTx commits specified active transaction.
func (*Transaction) Execute ¶
func (tx *Transaction) Execute( ctx context.Context, query string, params *QueryParameters, opts ...ExecuteDataQueryOption, ) (r *Result, err error)
Execute executes query represented by text within transaction tx.
func (*Transaction) ExecuteStatement ¶
func (tx *Transaction) ExecuteStatement( ctx context.Context, stmt *Statement, params *QueryParameters, opts ...ExecuteDataQueryOption, ) (r *Result, err error)
ExecuteStatement executes prepared statement stmt within transaction tx.
type TransactionControl ¶
type TransactionControl struct {
// contains filtered or unexported fields
}
func TxControl ¶
func TxControl(opts ...TxControlOption) *TransactionControl
type TransactionSettings ¶
type TransactionSettings struct {
// contains filtered or unexported fields
}
func TxSettings ¶
func TxSettings(opts ...TxOption) *TransactionSettings
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