Documentation ¶
Index ¶
- type AddOperationItem
- type AdditionOperationItem
- type BinaryOperation
- type BinaryOperationItem
- type DeleteOperationItem
- type IfNotExistsOperationItem
- type ListAppendOperationItem
- type OperationItem
- type SetFunctionOperationItem
- type SetOperationItem
- func Set(path expressionutils.AttributePath, value interface{}) *SetOperationItem
- func SetDecrement(path expressionutils.AttributePath, value interface{}) *SetOperationItem
- func SetIfNotExists(path expressionutils.AttributePath, value interface{}) *SetOperationItem
- func SetIncrement(path expressionutils.AttributePath, value interface{}) *SetOperationItem
- func SetUpsertToList[I any](path expressionutils.AttributePath, values ...I) *SetOperationItem
- type SubtractionOperationItem
- type ValueOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOperationItem ¶
type AddOperationItem struct { Path expressionutils.AttributePath Value interface{} }
func Add ¶
func Add(path expressionutils.AttributePath, value interface{}) *AddOperationItem
Add create an AddOperationItem object to representing a single `ADD` action https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.ADD
func (*AddOperationItem) Marshall ¶
func (i *AddOperationItem) Marshall(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
type AdditionOperationItem ¶
type AdditionOperationItem struct {
BinaryOperationItem
}
func Addition ¶
func Addition(left interface{}, right interface{}) *AdditionOperationItem
Addition creates a AdditionOperationItem representing a `operand + operand` DynamoDB expression.
func (*AdditionOperationItem) Marshal ¶
func (o *AdditionOperationItem) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
type BinaryOperation ¶
type BinaryOperation string
const ( AdditionOperation BinaryOperation = "+" SubtractionOperation BinaryOperation = "-" )
type BinaryOperationItem ¶
type BinaryOperationItem struct { LeftOperand interface{} RightOperand interface{} }
func (*BinaryOperationItem) IsValueOperation ¶
func (i *BinaryOperationItem) IsValueOperation()
type DeleteOperationItem ¶
type DeleteOperationItem struct { Path expressionutils.AttributePath Value interface{} }
func Delete ¶
func Delete(path expressionutils.AttributePath, value interface{}) *DeleteOperationItem
Delete create a DeleteOperationItem object, representing a single `DELETE` action https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.DELETE
func (*DeleteOperationItem) Marshall ¶
func (i *DeleteOperationItem) Marshall(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
type IfNotExistsOperationItem ¶
type IfNotExistsOperationItem struct { Path expressionutils.AttributePath Value interface{} }
func IfNotExists ¶
func IfNotExists(path expressionutils.AttributePath, value interface{}) *IfNotExistsOperationItem
IfNotExists creates an IfNotExistsOperationItem object representing a `if_not_exists(path, value)` DynamoDB expression
func (*IfNotExistsOperationItem) IsFunctionOperation ¶
func (l *IfNotExistsOperationItem) IsFunctionOperation()
func (*IfNotExistsOperationItem) Marshal ¶
func (l *IfNotExistsOperationItem) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
type ListAppendOperationItem ¶
type ListAppendOperationItem struct { ListA interface{} ListB interface{} }
func ListAppend ¶
func ListAppend(listA interface{}, listB interface{}) *ListAppendOperationItem
ListAppend creates a ListAppendOperationItem representing a `list_append(path, values)` DynamoDB expression
func (*ListAppendOperationItem) IsFunctionOperation ¶
func (l *ListAppendOperationItem) IsFunctionOperation()
func (*ListAppendOperationItem) Marshal ¶
func (l *ListAppendOperationItem) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
type OperationItem ¶
type OperationItem interface {
Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
}
type SetFunctionOperationItem ¶
type SetFunctionOperationItem interface { OperationItem IsFunctionOperation() }
type SetOperationItem ¶
type SetOperationItem struct { Path expressionutils.AttributePath Value interface{} }
func Set ¶
func Set(path expressionutils.AttributePath, value interface{}) *SetOperationItem
Set creates a SetOperationItem object representing a `SET p = value` DynamoDB expression value can be a scalar, or it can be a ValueOperation or SetFunctionOperationItem https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.SET
func SetDecrement ¶ added in v0.0.6
func SetDecrement(path expressionutils.AttributePath, value interface{}) *SetOperationItem
SetDecrement decrements attribute This operation create a SetOperationItem representing `path = path - value` as DynamoDB expression value could be a scalar or an Operand
func SetIfNotExists ¶ added in v0.0.5
func SetIfNotExists(path expressionutils.AttributePath, value interface{}) *SetOperationItem
SetIfNotExists set attribute if not exist. This operation creates a SetOperationItem representing `path = if_not_exists(path, value)` as DynamoDB expression
func SetIncrement ¶ added in v0.0.6
func SetIncrement(path expressionutils.AttributePath, value interface{}) *SetOperationItem
SetIncrement increment attribute This operation create a SetOperationItem representing `path = path + value` as DynamoDB expression value could be a scalar or an Operand
func SetUpsertToList ¶ added in v0.0.5
func SetUpsertToList[I any](path expressionutils.AttributePath, values ...I) *SetOperationItem
SetUpsertToList upsert values to a list. This operation creates a SetOperationItem representing `path = list_append(if_not_exists(path, :empty_list), values)` as DynamoDB expression
func (*SetOperationItem) Marshal ¶
func (o *SetOperationItem) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
type SubtractionOperationItem ¶
type SubtractionOperationItem struct {
BinaryOperationItem
}
func Subtraction ¶
func Subtraction(left interface{}, right interface{}) *SubtractionOperationItem
Subtraction creates a SubtractionOperationItem representing a `operand + operand` DynamoDB expression.
func (*SubtractionOperationItem) Marshal ¶
func (o *SubtractionOperationItem) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
type ValueOperation ¶
type ValueOperation interface { OperationItem IsValueOperation() }