Versions in this module Expand all Collapse all v2 v2.0.3 Jul 8, 2026 v2.0.3-rc Jul 8, 2026 v2.0.2 Jul 7, 2026 Changes in this version + func Between(lo, hi any) []any + func EncodeCursor(lastKey map[string]types.AttributeValue, indexName string, ...) (string, error) + func FirstOrNil(q core.Query, dest any) (bool, error) + func NewUpdateBuilder(q *Query) core.UpdateBuilder + func UnmarshalItem(item map[string]types.AttributeValue, dest any) error + func UnmarshalItems(items []map[string]types.AttributeValue, dest any) error + type AggregateResult struct + Average float64 + Count int64 + Max any + Min any + Sum float64 + type AttributeValueConverter interface + ConvertToSet func(slice any, isSet bool) (types.AttributeValue, error) + FromAttributeValue func(av types.AttributeValue, target any) error + HasCustomConverter func(typ reflect.Type) bool + ToAttributeValue func(value any) (types.AttributeValue, error) + type BatchExecutor interface + ExecuteBatchGet func(input *CompiledBatchGet, opts *core.BatchGetOptions) ([]map[string]types.AttributeValue, error) + ExecuteBatchWrite func(input *CompiledBatchWrite) error + type BatchGetResult struct + Responses []map[string]types.AttributeValue + UnprocessedKeys []map[string]types.AttributeValue + type BatchResult struct + Errors []error + Failed int + Succeeded int + UnprocessedKeys []any + type BatchUpdateOptions struct + ErrorHandler func(item any, err error) error + MaxBatchSize int + MaxConcurrency int + Parallel bool + ProgressCallback func(processed, total int) + RetryPolicy *RetryPolicy + func DefaultBatchOptions() *BatchUpdateOptions + type BatchWriteItemExecutor interface + ExecuteBatchWriteItem func(tableName string, writeRequests []types.WriteRequest) (*core.BatchWriteResult, error) + type CompiledBatchGet struct + ConsistentRead bool + ExpressionAttributeNames map[string]string + Keys []map[string]types.AttributeValue + ProjectionExpression string + TableName string + type CompiledBatchWrite struct + Items []map[string]types.AttributeValue + TableName string + type CompiledScan struct + ConsistentRead bool + ExclusiveStartKey map[string]types.AttributeValue + ExpressionAttributeNames map[string]string + ExpressionAttributeValues map[string]types.AttributeValue + FilterExpression string + Limit *int32 + ProjectionExpression string + Segment *int32 + TableName string + TotalSegments *int32 + type Condition struct + Field string + Operator string + Value any + type CostEstimate struct + ConfidenceLevel float64 + EstimatedDuration time.Duration + EstimatedItemCount int64 + EstimatedScanCount int64 + ReadCapacityUnits float64 + WriteCapacityUnits float64 + type Cursor struct + IndexName string + LastEvaluatedKey map[string]any + SortDirection string + func DecodeCursor(encoded string) (*Cursor, error) + func (c *Cursor) ToAttributeValues() (map[string]types.AttributeValue, error) + type DeleteItemExecutor interface + ExecuteDeleteItem func(input *core.CompiledQuery, key map[string]types.AttributeValue) error + type Filter struct + Expression string + Params map[string]any + type GetItemExecutor interface + ExecuteGetItem func(input *core.CompiledQuery, key map[string]types.AttributeValue, dest any) error + type GroupByQuery struct + func (g *GroupByQuery) Avg(field, alias string) *GroupByQuery + func (g *GroupByQuery) Count(alias string) *GroupByQuery + func (g *GroupByQuery) Execute() ([]*GroupedResult, error) + func (g *GroupByQuery) Having(aggregate, operator string, value any) *GroupByQuery + func (g *GroupByQuery) Max(field, alias string) *GroupByQuery + func (g *GroupByQuery) Min(field, alias string) *GroupByQuery + func (g *GroupByQuery) Sum(field, alias string) *GroupByQuery + type GroupedResult struct + Aggregates map[string]*AggregateResult + Count int64 + Items []any + Key any + type Operator string + const OpBeginsWith + const OpBetween + const OpContains + const OpEQ + const OpEqual + const OpExists + const OpGE + const OpGT + const OpGreaterThan + const OpGreaterThanOrEqual + const OpIn + const OpLE + const OpLT + const OpLessThan + const OpLessThanOrEqual + const OpNE + const OpNotEqual + const OpNotExists + type OptimizationOptions struct + EnableAdaptive bool + EnableParallel bool + MaxCacheSize int + MaxParallelism int + PlanCacheTTL time.Duration + type OptimizedQuery struct + func (oq *OptimizedQuery) Execute(dest any) error + func (oq *OptimizedQuery) ExplainPlan() string + func (oq *OptimizedQuery) GetPlan() *QueryPlan + type OrderBy struct + Field string + Order string + type PaginatedQueryExecutor interface + ExecuteQueryWithPagination func(input *core.CompiledQuery, dest any) (*QueryResult, error) + ExecuteScanWithPagination func(input *core.CompiledQuery, dest any) (*ScanResult, error) + type PaginatedResult struct + Count int + HasMore bool + Items any + NextCursor string + ScannedCount int + type PutItemExecutor interface + ExecutePutItem func(input *core.CompiledQuery, item map[string]types.AttributeValue) error + type Query struct + func New(model any, metadata core.ModelMetadata, executor QueryExecutor) *Query + func NewWithConditions(model any, metadata core.ModelMetadata, executor QueryExecutor, ...) *Query + func (q *Query) Aggregate(fields ...string) (*AggregateResult, error) + func (q *Query) All(dest any) error + func (q *Query) AllPaginated(dest any) (*core.PaginatedResult, error) + func (q *Query) Average(field string) (float64, error) + func (q *Query) BatchCreate(items any) error + func (q *Query) BatchCreateWithResult(items any) (*BatchResult, error) + func (q *Query) BatchDelete(keys []any) error + func (q *Query) BatchDeleteWithOptions(keys []any, opts *BatchUpdateOptions) error + func (q *Query) BatchGet(keys []any, dest any) error + func (q *Query) BatchGetBuilder() core.BatchGetBuilder + func (q *Query) BatchGetWithOptions(keys []any, dest any, opts *core.BatchGetOptions) error + func (q *Query) BatchUpdate(items any, fields ...string) error + func (q *Query) BatchUpdateWithOptions(items []any, fields []string, options ...any) error + func (q *Query) BatchWrite(putItems []any, deleteKeys []any) error + func (q *Query) BatchWriteWithOptions(putItems []any, deleteKeys []any, opts *BatchUpdateOptions) error + func (q *Query) Compile() (*core.CompiledQuery, error) + func (q *Query) ConsistentRead() core.Query + func (q *Query) Count() (int64, error) + func (q *Query) CountDistinct(field string) (int64, error) + func (q *Query) Create() error + func (q *Query) CreateOrUpdate() error + func (q *Query) Cursor(cursor string) core.Query + func (q *Query) Delete() error + func (q *Query) Filter(field string, op string, value any) core.Query + func (q *Query) FilterGroup(fn func(core.Query)) core.Query + func (q *Query) First(dest any) error + func (q *Query) FirstOrNil(dest any) (bool, error) + func (q *Query) GroupBy(field string) *GroupByQuery + func (q *Query) Having(condition string, value any) core.Query + func (q *Query) IfExists() core.Query + func (q *Query) IfNotExists() core.Query + func (q *Query) Index(name string) core.Query + func (q *Query) Limit(n int) core.Query + func (q *Query) Max(field string) (any, error) + func (q *Query) Min(field string) (any, error) + func (q *Query) Offset(offset int) core.Query + func (q *Query) OrFilter(field string, op string, value any) core.Query + func (q *Query) OrFilterGroup(fn func(core.Query)) core.Query + func (q *Query) OrderBy(field string, order string) core.Query + func (q *Query) ParallelScan(segment int32, totalSegments int32) core.Query + func (q *Query) QueryTimeout(timeout time.Duration) core.Query + func (q *Query) Scan(dest any) error + func (q *Query) ScanAllSegments(dest any, totalSegments int32) error + func (q *Query) Select(fields ...string) core.Query + func (q *Query) SetCursor(cursor string) error + func (q *Query) Sum(field string) (float64, error) + func (q *Query) Update(fields ...string) error + func (q *Query) UpdateBuilder() core.UpdateBuilder + func (q *Query) Where(field string, op string, value any) core.Query + func (q *Query) WithCancellation() (core.Query, *QueryCanceler) + func (q *Query) WithCondition(field, operator string, value any) core.Query + func (q *Query) WithConditionExpression(exprStr string, values map[string]any) core.Query + func (q *Query) WithContext(ctx context.Context) core.Query + func (q *Query) WithConverter(converter AttributeValueConverter) *Query + func (q *Query) WithMarshaler(marshaler marshal.MarshalerInterface) *Query + func (q *Query) WithOptimizer(optimizer *QueryOptimizer) (*OptimizedQuery, error) + func (q *Query) WithRetry(maxRetries int, initialDelay time.Duration) core.Query + type QueryCanceler struct + func (qc *QueryCanceler) Cancel() + type QueryExecutionResult struct + Duration time.Duration + Error error + ItemsReturned int64 + ItemsScanned int64 + type QueryExecutor interface + ExecuteQuery func(input *core.CompiledQuery, dest any) error + ExecuteScan func(input *core.CompiledQuery, dest any) error + type QueryOptimizer struct + func NewOptimizer(opts *OptimizationOptions) *QueryOptimizer + func (o *QueryOptimizer) ClearCache() + func (o *QueryOptimizer) GetQueryPlan(q *Query) (*QueryPlan, bool) + func (o *QueryOptimizer) GetStatistics(q *Query) (*QueryStatistics, bool) + func (o *QueryOptimizer) OptimizeQuery(q *Query) (*QueryPlan, error) + func (o *QueryOptimizer) RecordExecution(q *Query, result *QueryExecutionResult) + type QueryPlan struct + CachedAt time.Time + EstimatedCost *CostEstimate + ID string + IndexName string + Operation string + OptimizationHints []string + ParallelSegments int + Projections []string + Statistics *QueryStatistics + type QueryResult struct + Count int64 + Items []map[string]types.AttributeValue + LastEvaluatedKey map[string]types.AttributeValue + ScannedCount int64 + type QueryStatistics struct + AverageDuration time.Duration + ErrorCount int64 + ErrorRate float64 + ExecutionCount int64 + LastExecuted time.Time + MaxDuration time.Duration + MinDuration time.Duration + TotalDuration time.Duration + TotalItemsRead int64 + TotalItemsScanned int64 + type RawFilter struct + Expression string + Params []core.Param + type RetryConfig struct + InitialDelay time.Duration + MaxRetries int + type RetryPolicy = core.RetryPolicy + type ScanResult struct + Count int64 + Items []map[string]types.AttributeValue + LastEvaluatedKey map[string]types.AttributeValue + ScannedCount int64 + type UpdateBuilder struct + func (ub *UpdateBuilder) Add(field string, value any) core.UpdateBuilder + func (ub *UpdateBuilder) AppendToList(field string, values any) core.UpdateBuilder + func (ub *UpdateBuilder) Condition(field string, operator string, value any) core.UpdateBuilder + func (ub *UpdateBuilder) ConditionExists(field string) core.UpdateBuilder + func (ub *UpdateBuilder) ConditionNotExists(field string) core.UpdateBuilder + func (ub *UpdateBuilder) ConditionVersion(currentVersion int64) core.UpdateBuilder + func (ub *UpdateBuilder) Decrement(field string) core.UpdateBuilder + func (ub *UpdateBuilder) Delete(field string, value any) core.UpdateBuilder + func (ub *UpdateBuilder) Execute() error + func (ub *UpdateBuilder) ExecuteWithResult(result any) error + func (ub *UpdateBuilder) Increment(field string) core.UpdateBuilder + func (ub *UpdateBuilder) OrCondition(field string, operator string, value any) core.UpdateBuilder + func (ub *UpdateBuilder) PrependToList(field string, values any) core.UpdateBuilder + func (ub *UpdateBuilder) Remove(field string) core.UpdateBuilder + func (ub *UpdateBuilder) RemoveFromListAt(field string, index int) core.UpdateBuilder + func (ub *UpdateBuilder) ReturnValues(option string) core.UpdateBuilder + func (ub *UpdateBuilder) Set(field string, value any) core.UpdateBuilder + func (ub *UpdateBuilder) SetIfNotExists(field string, value any, defaultValue any) core.UpdateBuilder + func (ub *UpdateBuilder) SetListElement(field string, index int, value any) core.UpdateBuilder + type UpdateItemExecutor interface + ExecuteUpdateItem func(input *core.CompiledQuery, key map[string]types.AttributeValue) error + type UpdateItemWithResultExecutor interface + ExecuteUpdateItemWithResult func(input *core.CompiledQuery, key map[string]types.AttributeValue) (*core.UpdateResult, error) v2.0.2-rc Jul 7, 2026 Other modules containing this package github.com/theory-cloud/tabletheory