Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { HashKey string SortKey string NamedParams map[string]Empty PositionalParams map[int]string FixedParams map[string]interface{} Substitutions map[string]string // contains filtered or unexported fields }
Context tracks expression state as DynamoDB request is built.
func (*Context) BuildPath ¶
func (c *Context) BuildPath(path *parser.DocumentPath) string
BuildPath applies substitutions for reserved keywords in a parser.DocumentPath and marshals it into string format.
func (*Context) ExpressionAttributeNames ¶ added in v0.0.2
func (*Context) IsKey ¶
IsKey returns true if the field is a hash key or sort key for the selected table/index.
func (*Context) NextGeneratedParam ¶
NextGeneratedParam returns the next generated parameter placeholder name. DynamoDB requires concrete values to be passed as expression values, so we simulate expression values by generating placeholders.
func (*Context) NextPositionalParam ¶
NextPositionalParam returns the next generated positional placeholder name. DynamoDB does not support positional parameters so we simulate it by generating named placeholders.
type FilterExpression ¶
type FilterExpression struct{}
type KeyExpression ¶
type KeyExpression struct{}
type NamedParams ¶
func (NamedParams) Clone ¶
func (p NamedParams) Clone() NamedParams
type PreparedInsert ¶ added in v0.0.2
type PreparedInsert struct { Table *schema.Table Placeholder string Values []map[string]*dynamodb.AttributeValue }
func PrepareInsert ¶ added in v0.0.2
func PrepareInsert(ctx context.Context, tables *schema.TableLoader, query string) (*PreparedInsert, error)
func (*PreparedInsert) Do ¶ added in v0.0.2
func (p *PreparedInsert) Do(dynamo dynamodbiface.DynamoDBAPI, args []driver.NamedValue) (driver.Result, error)
type PreparedQuery ¶
type PreparedQuery struct { Query *dynamodb.QueryInput Limit int Columns []*parser.ProjectionColumn NamedParams NamedParams PositionalParams map[int]string FixedParams map[string]interface{} }
func PrepareQuery ¶
func PrepareQuery(ctx context.Context, tables *schema.TableLoader, query string) (*PreparedQuery, error)
func (*PreparedQuery) NewRequest ¶
func (pq *PreparedQuery) NewRequest(args []driver.NamedValue) (*dynamodb.QueryInput, error)