Documentation ¶
Index ¶
- func DeleteSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, ...) error
- func GetMany[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, ...) ([]T, error)
- func GetSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, ...) (*T, error)
- func PutSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, ...) error
- func ScanMany[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, ...) ([]T, error)
- func UpdateSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, ...) (*T, error)
- type DeleteSingleInput
- type GetManyInput
- type GetSingleInput
- type PutSingleInput
- type ScanManyInput
- type UpdateSingleInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSingle ¶ added in v1.0.0
func DeleteSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, input *DeleteSingleInput) error
DeleteSingle deletes a single item from the database.
func GetMany ¶ added in v1.0.0
func GetMany[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, input *GetManyInput) ([]T, error)
GetMany fetches items from the database and tries to deserialize it into a list of the provided struct type. Set the index to "" to query the main table. Set the limit to '-1' to fetch all items.
func GetSingle ¶ added in v1.0.0
func GetSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, input *GetSingleInput) (*T, error)
GetSingle fetches a single item from the database and tries to deserialize it into the provided struct type. Set the index to "" to query the main table.
func PutSingle ¶ added in v1.0.0
func PutSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, input *PutSingleInput[T]) error
PutSingle inserts a single item to the database. If you want to ensure no item is overwritten, you can set the ProtectionAttributeName to an attribute key that must NOT alread exist (usually the partition key is used for this).
func ScanMany ¶ added in v1.0.0
func ScanMany[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, input *ScanManyInput) ([]T, error)
ScanMany reads all items from the database. Only use this on very very small datasets. Set the limit to '-1' to fetch all items.
func UpdateSingle ¶ added in v1.0.0
func UpdateSingle[T any](transportCtx context.Context, dynamoClient *dynamodb.Client, input *UpdateSingleInput) (*T, error)
UpdateSingle updates a single item on the database.
Types ¶
type DeleteSingleInput ¶ added in v1.0.0
type DeleteSingleInput struct { Table *string PrimaryKey map[string]dynamodbtypes.AttributeValue }
type GetManyInput ¶ added in v1.0.0
type GetManyInput struct { Table *string Index *string AttributeValues map[string]dynamodbtypes.AttributeValue ConditionExpr *string Limit *int32 }
type GetSingleInput ¶ added in v1.0.0
type GetSingleInput struct { Table *string Index *string AttributeValues map[string]dynamodbtypes.AttributeValue ConditionExpr *string }
type PutSingleInput ¶ added in v1.0.0
type ScanManyInput ¶ added in v1.0.0
type UpdateSingleInput ¶ added in v1.0.0
type UpdateSingleInput struct { Table *string PrimaryKey map[string]dynamodbtypes.AttributeValue Upsert bool ReturnOld bool ConditionExpr *string AttributeNames map[string]string AttributeValues map[string]dynamodbtypes.AttributeValue UpdateExpr *string }