Documentation
¶
Index ¶
- type QueryBuilder
- func (b *QueryBuilder) Build(queryInput *dynamodb.QueryInput) error
- func (b *QueryBuilder) SetConsistentRead()
- func (b *QueryBuilder) WithFilterExpression(filterExpression conditionexpression.ExpressionItem)
- func (b *QueryBuilder) WithForwardScan(forwardScan bool)
- func (b *QueryBuilder) WithHashKeyCondition(hashKeyCondition *conditionexpression.EqualComparisonOperator)
- func (b *QueryBuilder) WithIndexName(indexName string)
- func (b *QueryBuilder) WithLimit(limit int32)
- func (b *QueryBuilder) WithRangeKeyCondition(rangeKeyCondition conditionexpression.RangeKeyConditionExpressionItem)
- func (b *QueryBuilder) WithTableName(tableName string)
- type ScanBuilder
- func (b *ScanBuilder) Build(input *dynamodb.ScanInput) error
- func (b *ScanBuilder) SetConsistentRead()
- func (b *ScanBuilder) WithFilterExpression(filterExpression conditionexpression.ExpressionItem)
- func (b *ScanBuilder) WithIndexName(indexName string)
- func (b *ScanBuilder) WithLimit(limit int32)
- func (b *ScanBuilder) WithTableName(tableName string)
- type UpdateBuilder
- func (b *UpdateBuilder) AppendAdd(addOperations ...*updateexpression.AddOperationItem)
- func (b *UpdateBuilder) AppendDelete(deleteOperations ...*updateexpression.DeleteOperationItem)
- func (b *UpdateBuilder) AppendRemove(removeOperations ...expressionutils.AttributePath)
- func (b *UpdateBuilder) AppendSet(setOperations ...*updateexpression.SetOperationItem)
- func (b *UpdateBuilder) BuildUpdateItemInput(input *dynamodb.UpdateItemInput) error
- func (b *UpdateBuilder) BuildUpdateTransactItem(input *types.Update) error
- func (b *UpdateBuilder) WithConditionExpression(conditionExpression conditionexpression.ExpressionItem)
- func (b *UpdateBuilder) WithKey(attribute expressionutils.AttributePath, value interface{})
- func (b *UpdateBuilder) WithKeyMap(key map[string]interface{})
- func (b *UpdateBuilder) WithTableName(tableName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryBuilder ¶
type QueryBuilder struct { TableName string HashKeyCondition *conditionexpression.EqualComparisonOperator RangeKeyCondition conditionexpression.RangeKeyConditionExpressionItem FilterExpression conditionexpression.ExpressionItem ConsistentRead bool IndexName *string Limit *int32 ForwardScan *bool }
QueryBuilder is a builder to create dynamodb.QueryInput objects
func NewQueryBuilder ¶
func NewQueryBuilder() QueryBuilder
NewQueryBuilder creates a new and empty QueryBuilder
func (*QueryBuilder) Build ¶
func (b *QueryBuilder) Build(queryInput *dynamodb.QueryInput) error
Build builds the dynamodb.QueryInput object
func (*QueryBuilder) SetConsistentRead ¶
func (b *QueryBuilder) SetConsistentRead()
SetConsistentRead ensures the DynamoDB query is executed as consistent read
func (*QueryBuilder) WithFilterExpression ¶
func (b *QueryBuilder) WithFilterExpression(filterExpression conditionexpression.ExpressionItem)
WithFilterExpression sets the filter expression for the dynamodb.QueryInput object
func (*QueryBuilder) WithForwardScan ¶
func (b *QueryBuilder) WithForwardScan(forwardScan bool)
WithForwardScan sets the forward scan for the dynamodb.QueryInput object
func (*QueryBuilder) WithHashKeyCondition ¶
func (b *QueryBuilder) WithHashKeyCondition(hashKeyCondition *conditionexpression.EqualComparisonOperator)
WithHashKeyCondition sets the hash key condition for the dynamodb.QueryInput object The hash key condition must be a conditionexpression.EqualComparisonOperator representing an equality between the tables Partition Key and a corresponding scalar of correct type.
func (*QueryBuilder) WithIndexName ¶
func (b *QueryBuilder) WithIndexName(indexName string)
WithIndexName sets the index name for the dynamodb.QueryInput object
func (*QueryBuilder) WithLimit ¶
func (b *QueryBuilder) WithLimit(limit int32)
WithLimit sets the limit for the dynamodb.QueryInput object
func (*QueryBuilder) WithRangeKeyCondition ¶
func (b *QueryBuilder) WithRangeKeyCondition(rangeKeyCondition conditionexpression.RangeKeyConditionExpressionItem)
WithRangeKeyCondition sets the range key condition for the dynamodb.QueryInput object The range key condition must be a conditionexpression.RangeKeyConditionExpressionItem representing a valid comparison between the Sort Key and a corresponding scalar.
func (*QueryBuilder) WithTableName ¶
func (b *QueryBuilder) WithTableName(tableName string)
WithTableName sets the table name for the dynamodb.QueryInput object
type ScanBuilder ¶
type ScanBuilder struct { TableName string FilterExpression conditionexpression.ExpressionItem ConsistentRead bool IndexName *string Limit *int32 }
ScanBuilder is a builder to create dynamodb.ScanInput objects
func NewScanBuilder ¶
func NewScanBuilder() ScanBuilder
NewScanBuilder creates a new and empty ScanBuilder
func (*ScanBuilder) Build ¶
func (b *ScanBuilder) Build(input *dynamodb.ScanInput) error
Build builds the dynamodb.ScanInput object
func (*ScanBuilder) SetConsistentRead ¶
func (b *ScanBuilder) SetConsistentRead()
SetConsistentRead ensures the DynamoDB scan is executed as consistent read
func (*ScanBuilder) WithFilterExpression ¶
func (b *ScanBuilder) WithFilterExpression(filterExpression conditionexpression.ExpressionItem)
WithFilterExpression sets the filter expression for the dynamodb.ScanInput object
func (*ScanBuilder) WithIndexName ¶
func (b *ScanBuilder) WithIndexName(indexName string)
WithIndexName sets the index name for the dynamodb.QueryInput object
func (*ScanBuilder) WithLimit ¶
func (b *ScanBuilder) WithLimit(limit int32)
WithLimit sets the limit for the dynamodb.QueryInput object
func (*ScanBuilder) WithTableName ¶
func (b *ScanBuilder) WithTableName(tableName string)
WithTableName sets the table name for the dynamodb.ScanInput object
type UpdateBuilder ¶
type UpdateBuilder struct { TableName string Key map[string]interface{} Set []*updateexpression.SetOperationItem Add []*updateexpression.AddOperationItem Delete []*updateexpression.DeleteOperationItem Remove []expressionutils.AttributePath ConditionExpression conditionexpression.ExpressionItem }
UpdateBuilder is a builder to create dynamodb.UpdateItemInput and types.Update objects
func NewUpdateBuilder ¶
func NewUpdateBuilder() *UpdateBuilder
NewUpdateBuilder creates a new and empty UpdateBuilder
func (*UpdateBuilder) AppendAdd ¶
func (b *UpdateBuilder) AppendAdd(addOperations ...*updateexpression.AddOperationItem)
AppendAdd appends DynamoDB ADD operations to the update query https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.ADD
func (*UpdateBuilder) AppendDelete ¶
func (b *UpdateBuilder) AppendDelete(deleteOperations ...*updateexpression.DeleteOperationItem)
AppendDelete appends DynamoDB DELETE operations to the update query https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.DELETE
func (*UpdateBuilder) AppendRemove ¶
func (b *UpdateBuilder) AppendRemove(removeOperations ...expressionutils.AttributePath)
AppendRemove appends DynamoDB REMOVE operations to the update query https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.REMOVE
func (*UpdateBuilder) AppendSet ¶
func (b *UpdateBuilder) AppendSet(setOperations ...*updateexpression.SetOperationItem)
AppendSet appends DynamoDB SET operations to the update query https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.SET
func (*UpdateBuilder) BuildUpdateItemInput ¶
func (b *UpdateBuilder) BuildUpdateItemInput(input *dynamodb.UpdateItemInput) error
BuildUpdateItemInput builds a dynamodb.UpdateItemInput object
func (*UpdateBuilder) BuildUpdateTransactItem ¶
func (b *UpdateBuilder) BuildUpdateTransactItem(input *types.Update) error
BuildUpdateTransactItem builds a types.Update object that can be used in a dynamodb.TransactWriteItemsInput object
func (*UpdateBuilder) WithConditionExpression ¶
func (b *UpdateBuilder) WithConditionExpression(conditionExpression conditionexpression.ExpressionItem)
WithConditionExpression sets the condition expression on the Update Input object
func (*UpdateBuilder) WithKey ¶
func (b *UpdateBuilder) WithKey(attribute expressionutils.AttributePath, value interface{})
WithKey appends the given key and value pair to the key defining the item to update value will be marshalled during when the update object is build. If the value is of type types.AttributeValue, the marshaling will be skipped and the value is directly used instead.
func (*UpdateBuilder) WithKeyMap ¶
func (b *UpdateBuilder) WithKeyMap(key map[string]interface{})
WithKeyMap sets the key on the Update Input object. The key of the map represents the key attribute names. The values of the map represents the attribute values. The values of the map are marshalled when the update object is build. If a value is of type types.AttributeValue, the marshaling will be skipped and the value is directly used instead.
func (*UpdateBuilder) WithTableName ¶
func (b *UpdateBuilder) WithTableName(tableName string)
WithTableName sets the table name on the Update Input object