Documentation
¶
Overview ¶
Package expr implements DynamoDB's expression languages — condition, filter, and key-condition expressions (one shared grammar), update expressions, and projection expressions — with a real lexer and recursive-descent parsers. Expressions carry no literals: every value arrives as a :ref resolved against ExpressionAttributeValues, and #refs substitute attribute names.
The evaluators run on item.Item values. Unused name/value references are detected (ValidationException, like real DynamoDB) via the Used sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cond ¶
type Cond struct {
// contains filtered or unexported fields
}
Cond is a parsed condition/filter/key-condition expression.
func ParseCondition ¶
ParseCondition parses a condition or filter expression against env.
type Env ¶
type Env struct {
Names map[string]string // "#n" -> attribute name
Values map[string]item.Value // ":v" -> value
// contains filtered or unexported fields
}
Env carries the request's name/value substitutions and tracks which were actually referenced, so unused ones can be rejected like real DynamoDB.
func (*Env) CheckAllUsed ¶
CheckAllUsed errors if any provided substitution went unreferenced — the SDK-observable ValidationException real DynamoDB raises.
type KeyCondition ¶
type KeyCondition struct {
PKName string
PKValue item.Value
SKName string // empty when no sort-key condition
SKOp string // "=", "<", "<=", ">", ">=", "BETWEEN", "begins_with"
SKValue item.Value // operand (or BETWEEN low bound)
SKValue2 item.Value // BETWEEN high bound
}
KeyCondition is the restricted condition shape Query accepts:
pk = :v pk = :v AND sk <op> :v pk = :v AND sk BETWEEN :lo AND :hi pk = :v AND begins_with(sk, :prefix)
func ParseKeyCondition ¶
func ParseKeyCondition(src string, env *Env) (*KeyCondition, *awshttp.APIError)
ParseKeyCondition parses and validates a KeyConditionExpression.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a parsed document path (a.b[0].c).
type Projection ¶
type Projection struct {
// contains filtered or unexported fields
}
Projection is a parsed projection expression: the paths to keep.
func ParseProjection ¶
func ParseProjection(src string, env *Env) (*Projection, *awshttp.APIError)
ParseProjection parses a ProjectionExpression.
type Update ¶
type Update struct {
// contains filtered or unexported fields
}
Update is a parsed update expression: SET / REMOVE / ADD / DELETE clauses.
func ParseUpdate ¶
ParseUpdate parses an update expression.