Releases: guregu/dynamo
Improved errors
This is a minor release that improves some error checking.
- Added proper error messages for missing expression placeholder arguments (#212)
- Previously this led to OOB slice access panic, now it returns a descriptive error
- Added checks for nil/omitted primary key values (7768ebd)
- Previously this could result in a cryptic AWS ValidationError (using real DynamoDB) or DynamoDB local freezing
- Updated AWS SDK
Full Changelog: v1.18.1...v1.18.2
CreateTable attributes fix, less dependencies
What's Changed
- Bug fix for included attributes in CreateTable @blck-snwmn in #211
- Remove
github.com/gofrs/uuid
as a dependency by @danielwhite in #210 - Update AWS SDK
New Contributors
- @blck-snwmn made their first contribution in #211
- @danielwhite made their first contribution in #210
Full Changelog: v1.18.0...v1.18.1
Projections for Batch Get
This release adds projection support for batch gets and updates the AWS dependencies.
What's Changed
- Add Project method for BatchGet by @nightlord189 in #209
New Contributors
- @nightlord189 made their first contribution in #209
Full Changelog: v1.17.0...v1.18.0
Auto-retry transactions
This release adds automatic retrying behavior to transactions. See: #203.
What's Changed
- Automatically retry transactions (#204)
- Add
IsCondCheckFailed
function for working with conditional check failed errors
Full Changelog: v1.16.0...v1.17.0
allowemptyelem nesting
What's Changed
- Adding allowemptyelem support for nested maps and slices by @veedubyou in #200 (fixes #199)
New Contributors
- @veedubyou made their first contribution in #200
Full Changelog: v1.15.1...v1.16.0
Map field unmarshal fix
What's Changed
- Fix map fields not getting cleared on unmarshal by @guregu in #196
- regression from v1.12.0, prior versions not affected
Full Changelog: v1.15.0...v1.15.1
Table waiters
Summary
This release adds table waiters (#52 via #193).
CreateTable.Wait()
creates the table, then blocks until the table is activeDeleteTable.Wait()
deletes the table, then blocks until the table is finished deletingTable.Wait(...)
blocks until the table's status matches one of the arguments (for custom waiting purposes)
Example
// blocks until table is ready to use
if err := db.CreateTable(name, Widget{}).Wait(); err != nil {
panic(err)
}
// blocks until table is finished deleting
if err := db.Table(name).DeleteTable().Wait(); err != nil {
panic(err)
}
What's Changed
Full Changelog: v1.14.0...v1.15.0
ExpressionLiteral
Summary
This release adds a new type, ExpressionLiteral
(#192). It represents a raw DynamoDB expression and placeholders, using the same data types as the official AWS package. You can pass this as a parameter to any method that takes an expression. Both $
and ?
will work as variables. dynamo will automatically merge your placeholders with its own, so you can use this in tandem with the rest of the library.
Some use cases include porting projects from the official SDK, and passing around search parameters in APIs.
Be careful, using this is akin to manipulating SQL queries with string concatenation. Make sure you know what you're doing if you use it. Only reach for this hammer when the regular APIs don't cut it.
Example
lit := dynamo.ExpressionLiteral{
Expression: "#meta.#foo = :bar",
AttributeNames: aws.StringMap(map[string]string{
"#meta": "Meta",
"#foo": "foo",
}),
AttributeValues: map[string]*dynamodb.AttributeValue{
":bar": {S: aws.String("bar")},
},
}
err := table.Get("UserID", 42).
Filter("?", lit). // $ also works.
All(&result)
What's Changed
Full Changelog: v1.13.0...v1.14.0
v1.13.0
Summary
- Add server-side encryption (SSE) support in
CreateTable
andDescribeTable
#189 (thanks @TigerToof!) - Tweak the logic for inferring the table's primary keys
PagingIter.LastEvaluatedKey
#191- This change can better avoid calling
DescribeTable
depending on your usage. - Errors from
DescribeTable
(such as insufficient permissions) will be treated as warnings, falling back to pre-v1.12.0 behavior.- See: #187 (comment)
- This change can better avoid calling
- Warnings now use the logger configured in
aws.Config
instead of the standard library default.
What's Changed
- Add SSESpecification option to CreateTable by @TigerToof in #189
- lazier LastEvaluatedKey inference by @guregu in #191
New Contributors
- @TigerToof made their first contribution in #189
Full Changelog: v1.12.0...v1.13.0
v1.12.0
Summary
- This release fixes two issues:
- Also upgrades dependencies.
What's Changed
- virtual
PagingIter.LastEvaluatedKey
by @guregu in #187 - improve embedded struct decoding, fixing aux unmarshaling by @guregu in #188
- Upgrade backoff to backoff/v4 by @pquerna in #180
New Contributors
- @dnagir provided some very helpful test cases in #181
- @pquerna made their first contribution in #180
Full Changelog: v1.11.0...v1.12.0