Versions in this module Expand all Collapse all v1 v1.1.1 Apr 26, 2026 Changes in this version type FilterBuilder + func NewFilterBuilderFromBuilder(eb *ExpressionBuilder) *FilterBuilder v1.0.0 Nov 22, 2025 Changes in this version + const ErrBatchTooLarge + const ErrCollectionNotFound + const ErrCursorDecoding + const ErrCursorEncoding + const ErrDuplicateEntity + const ErrDynamoDB + const ErrEntityNotFound + const ErrInvalidEntity + const ErrInvalidEnumValue + const ErrInvalidIndex + const ErrInvalidKeys + const ErrInvalidOperation + const ErrInvalidSchema + const ErrMarshal + const ErrMissingAttribute + const ErrNoClientProvided + const ErrReadOnlyViolation + const ErrTransaction + const ErrTransactionCanceled + const ErrUnmarshal + const ErrValidation + const MaxBatchGetItems + const MaxBatchWriteItems + const Version + func ApplyUpdateTimestamps(setOps map[string]interface{}, schema *Schema) map[string]interface + func IsTTLExpired(ttl int64) bool + func MergeExpressionAttributes(existingNames map[string]string, ...) (map[string]string, map[string]types.AttributeValue) + func TTLFromNow(duration time.Duration) int64 + func TTLFromTime(t time.Time) int64 + func TimeUntilTTL(ttl int64) time.Duration + type AttributeDefinition struct + Cast string + Default DefaultFunc + EnumValues []interface{} + Field string + Get GetFunc + Hidden bool + Label string + Padding *PaddingConfig + ReadOnly bool + Required bool + Set SetFunc + Type AttributeType + Validate ValidationFunc + Watch []string + type AttributeOperations map[string]*AttributeOperator + type AttributeOperator struct + func (a *AttributeOperator) Begins(value interface{}) string + func (a *AttributeOperator) Between(low, high interface{}) string + func (a *AttributeOperator) Contains(value interface{}) string + func (a *AttributeOperator) Eq(value interface{}) string + func (a *AttributeOperator) Gt(value interface{}) string + func (a *AttributeOperator) Gte(value interface{}) string + func (a *AttributeOperator) Lt(value interface{}) string + func (a *AttributeOperator) Lte(value interface{}) string + func (a *AttributeOperator) Ne(value interface{}) string + type AttributeRef struct + func (ar *AttributeRef) Begins(value interface{}) string + func (ar *AttributeRef) Between(start, end interface{}) string + func (ar *AttributeRef) Contains(value interface{}) string + func (ar *AttributeRef) Eq(value interface{}) string + func (ar *AttributeRef) Gt(value interface{}) string + func (ar *AttributeRef) Gte(value interface{}) string + func (ar *AttributeRef) Lt(value interface{}) string + func (ar *AttributeRef) Lte(value interface{}) string + func (ar *AttributeRef) Ne(value interface{}) string + type AttributeType string + const AttributeTypeAny + const AttributeTypeBoolean + const AttributeTypeEnum + const AttributeTypeList + const AttributeTypeMap + const AttributeTypeNumber + const AttributeTypeSet + const AttributeTypeString + type BatchGetRequest struct + func (bgr *BatchGetRequest) Go() (*BatchGetResponse, error) + type BatchGetResponse struct + Data []map[string]interface{} + Unprocessed []Keys + type BatchGetService struct + func (bgs *BatchGetService) Get(entityName string, keys []Keys) *BatchGetService + func (bgs *BatchGetService) Go() (*BatchGetServiceResponse, error) + type BatchGetServiceResponse struct + Data map[string][]map[string]interface{} + Unprocessed map[string][]Keys + type BatchWriteRequest struct + func (bwr *BatchWriteRequest) Delete(keys []Keys) *BatchWriteRequest + func (bwr *BatchWriteRequest) Go() (*BatchWriteResponse, error) + func (bwr *BatchWriteRequest) Put(items []Item) *BatchWriteRequest + type BatchWriteResponse struct + Unprocessed struct{ ... } + type BatchWriteService struct + func (bws *BatchWriteService) Delete(entityName string, keys []Keys) *BatchWriteService + func (bws *BatchWriteService) Go() (*BatchWriteServiceResponse, error) + func (bws *BatchWriteService) Put(entityName string, items []Item) *BatchWriteService + type BatchWriteServiceResponse struct + Unprocessed map[string]struct{ ... } + type Collection struct + func (c *Collection) Query(facets ...interface{}) *CollectionQuery + type CollectionQuery struct + func (cq *CollectionQuery) Begins(value interface{}) *CollectionQuery + func (cq *CollectionQuery) Between(start, end interface{}) *CollectionQuery + func (cq *CollectionQuery) Eq(value interface{}) *CollectionQuery + func (cq *CollectionQuery) Go() (*CollectionQueryResponse, error) + func (cq *CollectionQuery) Gt(value interface{}) *CollectionQuery + func (cq *CollectionQuery) Gte(value interface{}) *CollectionQuery + func (cq *CollectionQuery) Lt(value interface{}) *CollectionQuery + func (cq *CollectionQuery) Lte(value interface{}) *CollectionQuery + func (cq *CollectionQuery) Options(opts *QueryOptions) *CollectionQuery + func (cq *CollectionQuery) Params() (map[string]interface{}, error) + type CollectionQueryResponse struct + Cursor *string + Data map[string][]map[string]interface{} + type ConditionBuilder struct + func NewConditionBuilder(attributes map[string]*AttributeDefinition) *ConditionBuilder + func (cb *ConditionBuilder) Build() (string, map[string]string, map[string]types.AttributeValue) + func (cb *ConditionBuilder) Where(callback WhereCallback) error + type Config struct + Client DynamoDBClient + Identifiers *IdentifierConfig + Listeners []EventListener + Logger Logger + Table *string + type DefaultFunc func() interface + type DeleteOperation struct + func (d *DeleteOperation) Commit() TransactionItem + func (d *DeleteOperation) Condition(callback WhereCallback) *DeleteOperation + func (d *DeleteOperation) Go() (*DeleteResponse, error) + func (d *DeleteOperation) Params() (map[string]interface{}, error) + type DeleteOptions struct + Attributes []string + Raw bool + Response *string + type DeleteResponse struct + Data map[string]interface{} + type DynamoDBClient interface + BatchGetItem func(ctx context.Context, params *dynamodb.BatchGetItemInput, ...) (*dynamodb.BatchGetItemOutput, error) + BatchWriteItem func(ctx context.Context, params *dynamodb.BatchWriteItemInput, ...) (*dynamodb.BatchWriteItemOutput, error) + DeleteItem func(ctx context.Context, params *dynamodb.DeleteItemInput, ...) (*dynamodb.DeleteItemOutput, error) + GetItem func(ctx context.Context, params *dynamodb.GetItemInput, ...) (*dynamodb.GetItemOutput, error) + PutItem func(ctx context.Context, params *dynamodb.PutItemInput, ...) (*dynamodb.PutItemOutput, error) + Query func(ctx context.Context, params *dynamodb.QueryInput, ...) (*dynamodb.QueryOutput, error) + Scan func(ctx context.Context, params *dynamodb.ScanInput, ...) (*dynamodb.ScanOutput, error) + TransactGetItems func(ctx context.Context, params *dynamodb.TransactGetItemsInput, ...) (*dynamodb.TransactGetItemsOutput, error) + TransactWriteItems func(ctx context.Context, params *dynamodb.TransactWriteItemsInput, ...) (*dynamodb.TransactWriteItemsOutput, error) + UpdateItem func(ctx context.Context, params *dynamodb.UpdateItemInput, ...) (*dynamodb.UpdateItemOutput, error) + type ElectroError struct + Cause error + Code string + Message string + Time time.Time + func NewElectroError(code, message string, cause error) *ElectroError + func (e *ElectroError) Error() string + type Entity struct + func NewEntity(schema *Schema, config *Config) (*Entity, error) + func (e *Entity) BatchGet(keys []Keys) *BatchGetRequest + func (e *Entity) BatchWrite() *BatchWriteRequest + func (e *Entity) Create(item Item) *PutOperation + func (e *Entity) Delete(keys Keys) *DeleteOperation + func (e *Entity) Get(keys Keys) *GetOperation + func (e *Entity) Patch(keys Keys) *UpdateOperation + func (e *Entity) Put(item Item) *PutOperation + func (e *Entity) Query(accessPattern string) QueryBuilder + func (e *Entity) Remove(keys Keys) *DeleteOperation + func (e *Entity) Scan() *ScanOperation + func (e *Entity) Schema() *Schema + func (e *Entity) Update(keys Keys) *UpdateOperation + func (e *Entity) Upsert(item Item) *PutOperation + func (e *Entity) UpsertUpdate(keys Keys) *UpdateOperation + type EventListener interface + OnQuery func(params map[string]interface{}) + OnResults func(results interface{}) + type ExecutionHelper struct + func NewExecutionHelper(entity *Entity) *ExecutionHelper + func (eh *ExecutionHelper) ExecuteDeleteItem(ctx context.Context, keys Keys, options *DeleteOptions) (*DeleteResponse, error) + func (eh *ExecutionHelper) ExecuteGetItem(ctx context.Context, keys Keys, options *GetOptions) (*GetResponse, error) + func (eh *ExecutionHelper) ExecutePutItem(ctx context.Context, item Item, options *PutOptions) (*PutResponse, error) + func (eh *ExecutionHelper) ExecuteQuery(ctx context.Context, indexName string, pkFacets []interface{}, ...) (*QueryResponse, error) + func (eh *ExecutionHelper) ExecuteScan(ctx context.Context, options *QueryOptions) (*ScanResponse, error) + func (eh *ExecutionHelper) ExecuteUpdateItem(ctx context.Context, keys Keys, setOps map[string]interface{}, ...) (*UpdateResponse, error) + type ExpressionBuilder struct + func NewExpressionBuilder(attributes map[string]*AttributeDefinition) *ExpressionBuilder + func (eb *ExpressionBuilder) AddExpression(expr string) + func (eb *ExpressionBuilder) Build() (string, map[string]string, map[string]types.AttributeValue) + func (eb *ExpressionBuilder) BuildWhereExpression(callback WhereCallback) error + func (eb *ExpressionBuilder) GetExpression() string + type FacetDefinition struct + Casing *string + Facets []string + Field string + Template *string + type FilterBuilder struct + func NewFilterBuilder(attributes map[string]*AttributeDefinition) *FilterBuilder + func (fb *FilterBuilder) Build() (string, map[string]string, map[string]types.AttributeValue) + func (fb *FilterBuilder) Where(callback WhereCallback) error + type FilterFunc func(attr AttributeOperations, params map[string]interface{}) string + type GetFunc func(value interface{}) interface + type GetOperation struct + func (g *GetOperation) Commit() TransactionItem + func (g *GetOperation) Go() (*GetResponse, error) + func (g *GetOperation) Params() (map[string]interface{}, error) + type GetOptions struct + Attributes []string + Raw bool + type GetResponse struct + Data map[string]interface{} + type IdentifierConfig struct + Entity string + Version string + type IndexDefinition struct + Collection *string + Index *string + PK FacetDefinition + SK *FacetDefinition + Type *string + type Item map[string]interface + func ApplyPadding(item Item, schema *Schema) Item + func ApplyTimestamps(item Item, schema *Schema, isUpdate bool) Item + func RemovePadding(item Item, schema *Schema) Item + type Keys map[string]interface + type Logger interface + Error func(message string, data map[string]interface{}) + Info func(message string, data map[string]interface{}) + Warn func(message string, data map[string]interface{}) + type OperationBuilder struct + func (ob *OperationBuilder) AttributeType(attr *AttributeRef, typeName string) string + func (ob *OperationBuilder) Exists(attr *AttributeRef) string + func (ob *OperationBuilder) NotExists(attr *AttributeRef) string + func (ob *OperationBuilder) Size(attr *AttributeRef) string + type PaddingConfig struct + Char string + Length int + type Page struct + Cursor *string + Data []map[string]interface{} + type PagesIterator struct + func (pi *PagesIterator) Next() (*Page, bool, error) + type PagesOptions struct + Limit int32 + MaxPages int + type ParamsBuilder struct + func NewParamsBuilder(entity *Entity) *ParamsBuilder + func (pb *ParamsBuilder) BuildDeleteItemParams(keys Keys, options *DeleteOptions) (map[string]interface{}, error) + func (pb *ParamsBuilder) BuildGetItemParams(keys Keys, options *GetOptions) (map[string]interface{}, error) + func (pb *ParamsBuilder) BuildPutItemParams(item Item, options *PutOptions) (map[string]interface{}, error) + func (pb *ParamsBuilder) BuildQueryParams(indexName string, pkFacets []interface{}, skCondition *sortKeyCondition, ...) (map[string]interface{}, error) + func (pb *ParamsBuilder) BuildUpdateItemParams(keys Keys, setOps map[string]interface{}, addOps map[string]interface{}, ...) (map[string]interface{}, error) + type PutOperation struct + func (p *PutOperation) Commit() TransactionItem + func (p *PutOperation) Condition(callback WhereCallback) *PutOperation + func (p *PutOperation) Go() (*PutResponse, error) + func (p *PutOperation) Params() (map[string]interface{}, error) + func (p *PutOperation) WithTTL(duration time.Duration) *PutOperation + func (p *PutOperation) WithTTLTimestamp(timestamp int64) *PutOperation + type PutOptions struct + Attributes []string + Raw bool + Response *string + type PutResponse struct + Data map[string]interface{} + type QueryBuilder interface + Query func(facets ...interface{}) *QueryChain + type QueryChain struct + func (qc *QueryChain) Begins(value interface{}) *QueryChain + func (qc *QueryChain) Between(start, end interface{}) *QueryChain + func (qc *QueryChain) Eq(value interface{}) *QueryChain + func (qc *QueryChain) Filter(filterName string, params map[string]interface{}) *QueryChain + func (qc *QueryChain) Go() (*QueryResponse, error) + func (qc *QueryChain) Gt(value interface{}) *QueryChain + func (qc *QueryChain) Gte(value interface{}) *QueryChain + func (qc *QueryChain) Lt(value interface{}) *QueryChain + func (qc *QueryChain) Lte(value interface{}) *QueryChain + func (qc *QueryChain) Options(opts *QueryOptions) *QueryChain + func (qc *QueryChain) Page(opts ...PagesOptions) *PagesIterator + func (qc *QueryChain) Pages(opts ...PagesOptions) ([]map[string]interface{}, error) + func (qc *QueryChain) Params() (map[string]interface{}, error) + func (qc *QueryChain) Where(callback WhereCallback) *QueryChain + type QueryOptions struct + Attributes []string + Concurrent *int + Cursor *string + IgnoreCursor bool + Limit *int32 + Order *string + Pages *int + Raw bool + type QueryResponse struct + Cursor *string + Data []map[string]interface{} + type ScanOperation struct + func (s *ScanOperation) Go() (*ScanResponse, error) + func (s *ScanOperation) Page(opts ...PagesOptions) *ScanPagesIterator + func (s *ScanOperation) Pages(opts ...PagesOptions) ([]map[string]interface{}, error) + func (s *ScanOperation) Params() (map[string]interface{}, error) + type ScanPagesIterator struct + func (spi *ScanPagesIterator) Next() (*Page, bool, error) + type ScanResponse struct + Cursor *string + Data []map[string]interface{} + type Schema struct + Attributes map[string]*AttributeDefinition + Entity string + Filters map[string]FilterFunc + Indexes map[string]*IndexDefinition + Service string + TTL *TTLConfig + Table string + Timestamps *TimestampsConfig + Version string + type Service struct + func NewService(name string, config *ServiceConfig) *Service + func (s *Service) BatchGet() *BatchGetService + func (s *Service) BatchWrite() *BatchWriteService + func (s *Service) Collection(name string) (*Collection, error) + func (s *Service) Collections() map[string]*Collection + func (s *Service) Entities() map[string]*Entity + func (s *Service) Entity(name string) (*Entity, error) + func (s *Service) Join(entity *Entity) error + func (s *Service) TransactGet(fn func(entities map[string]*Entity) []TransactionItem) *TransactGetBuilder + func (s *Service) TransactWrite(fn func(entities map[string]*Entity) []TransactionItem) *TransactWriteBuilder + type ServiceConfig struct + Client DynamoDBClient + Table *string + type SetFunc func(value interface{}) interface + type TTLConfig struct + Attribute string + type TimestampsConfig struct + CreatedAt string + UpdatedAt string + type TransactDeleteItem struct + func (tdi *TransactDeleteItem) BuildTransactGetItem() (types.TransactGetItem, error) + func (tdi *TransactDeleteItem) BuildTransactItem() (types.TransactWriteItem, error) + type TransactGetBuilder struct + func (tgb *TransactGetBuilder) Go() (*TransactGetResponse, error) + func (tgb *TransactGetBuilder) GoWithContext(ctx context.Context) (*TransactGetResponse, error) + func (tgb *TransactGetBuilder) Params() (map[string]interface{}, error) + type TransactGetItem struct + func (tgi *TransactGetItem) BuildTransactGetItem() (types.TransactGetItem, error) + func (tgi *TransactGetItem) BuildTransactItem() (types.TransactWriteItem, error) + type TransactGetResponse struct + Canceled bool + Data []TransactResult + type TransactPutItem struct + func (tpi *TransactPutItem) BuildTransactGetItem() (types.TransactGetItem, error) + func (tpi *TransactPutItem) BuildTransactItem() (types.TransactWriteItem, error) + type TransactResult struct + Code string + Item map[string]interface{} + Message string + Rejected bool + type TransactUpdateItem struct + func (tui *TransactUpdateItem) BuildTransactGetItem() (types.TransactGetItem, error) + func (tui *TransactUpdateItem) BuildTransactItem() (types.TransactWriteItem, error) + type TransactWriteBuilder struct + func (twb *TransactWriteBuilder) Go() (*TransactWriteResponse, error) + func (twb *TransactWriteBuilder) GoWithContext(ctx context.Context) (*TransactWriteResponse, error) + func (twb *TransactWriteBuilder) Params() (map[string]interface{}, error) + type TransactWriteResponse struct + Canceled bool + Data []TransactResult + type TransactionItem interface + BuildTransactGetItem func() (types.TransactGetItem, error) + BuildTransactItem func() (types.TransactWriteItem, error) + type TransactionResponse struct + Data []map[string]interface{} + type UpdateData map[string]interface + type UpdateOperation struct + func (u *UpdateOperation) Add(updates map[string]interface{}) *UpdateOperation + func (u *UpdateOperation) AddToSet(attribute string, values interface{}) *UpdateOperation + func (u *UpdateOperation) Append(updates map[string]interface{}) *UpdateOperation + func (u *UpdateOperation) Commit() TransactionItem + func (u *UpdateOperation) Condition(callback WhereCallback) *UpdateOperation + func (u *UpdateOperation) Data(updates map[string]interface{}) *UpdateOperation + func (u *UpdateOperation) DeleteFromSet(attribute string, values interface{}) *UpdateOperation + func (u *UpdateOperation) Go() (*UpdateResponse, error) + func (u *UpdateOperation) Params() (map[string]interface{}, error) + func (u *UpdateOperation) Prepend(updates map[string]interface{}) *UpdateOperation + func (u *UpdateOperation) Remove(attributes []string) *UpdateOperation + func (u *UpdateOperation) RemoveTTL() *UpdateOperation + func (u *UpdateOperation) Set(updates map[string]interface{}) *UpdateOperation + func (u *UpdateOperation) Subtract(updates map[string]interface{}) *UpdateOperation + func (u *UpdateOperation) WithTTL(duration time.Duration) *UpdateOperation + func (u *UpdateOperation) WithTTLTimestamp(timestamp int64) *UpdateOperation + type UpdateOptions struct + Attributes []string + Raw bool + Response *string + type UpdateResponse struct + Data map[string]interface{} + type ValidationFunc func(value interface{}) error + type Validator struct + func NewValidator(entity *Entity) *Validator + func (v *Validator) ApplySetTransformations(setOps map[string]interface{}, addOps map[string]interface{}, ...) (map[string]interface{}, map[string]interface{}, map[string]interface{}) + func (v *Validator) TransformForRead(item Item) Item + func (v *Validator) ValidateAndTransformForWrite(item Item, isUpdate bool) (Item, error) + func (v *Validator) ValidateUpdateOperations(setOps map[string]interface{}, addOps map[string]interface{}, ...) error + type WhereCallback func(attrs map[string]*AttributeRef, ops *OperationBuilder) string