dynamo-query: started working on queries

This commit is contained in:
Leon Mika 2022-06-21 13:37:07 +10:00
parent 41af399215
commit 54fab1b1c3
15 changed files with 305 additions and 16 deletions

View file

@ -0,0 +1,24 @@
package queryexpr
import (
"strconv"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/pkg/errors"
)
func (a *astLiteralValue) dynamoValue() (types.AttributeValue, error) {
s, err := strconv.Unquote(a.String)
if err != nil {
return nil, errors.Wrap(err, "cannot unquote string")
}
return &types.AttributeValueMemberS{Value: s}, nil
}
func (a *astLiteralValue) goValue() (any, error) {
s, err := strconv.Unquote(a.String)
if err != nil {
return nil, errors.Wrap(err, "cannot unquote string")
}
return s, nil
}