Changed
-
🛠 Migrated from
aws-sdk-go(v1, end-of-support as of v1.55.8) toaws-sdk-go-v2(#22).New()now accepts*dynamodb.Clientfromgithub.com/aws/aws-sdk-go-v2/service/dynamodbinstead of*dynamodb.DynamoDBfromgithub.com/aws/aws-sdk-go. Attribute marshaling moves tofeature/dynamodb/attributevalue.AttributeValuebecomes an interface withtypes.AttributeValueMember*concrete members.ExpressionAttributeNamesis nowmap[string]string, since v2 dropped*string. Errors are matched witherrors.Asagainst*types.ConditionalCheckFailedExceptionand*types.ResourceInUseExceptioninstead ofawserr.Error.Code(). Queries page throughdynamodb.NewQueryPaginator. Every*WithContextmethod collapses to its ctx-first equivalent.Action required. Build clients with the v2 SDK and pass them to
ddbds.New:// before sess := session.Must(session.NewSession(&aws.Config{Region: aws.String("us-east-1")})) ddbDS := ddbds.New(dynamodb.New(sess), "datastore-table") // after cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion("us-east-1")) if err != nil { return err } ddbDS := ddbds.New(dynamodb.NewFromConfig(cfg), "datastore-table")
-
Bumped non-AWS direct dependencies:
go-datastorev0.8.2 to v0.9.1,go-log/v2v2.5.1 to v2.9.2,testifyv1.10.0 to v1.11.1.
Fixed
- Scan worker no longer panics on
Scanerrors. v1 returned a zero-value response on error, so the post-error iteration overres.Itemswas harmless; v2 returns nil and the iteration crashed. The worker now sends the error and returns.d2b4528 - Batch commit no longer races on a shared
*rand.Rand. Jitter usesmath/rand/v2, whose top-level functions are safe for concurrent use.f93f955 Puton a sort-key table returnsErrInvalidKeyfor keys with too few namespaces, instead of panicking inputKeywith "assignment to entry in nil map".669f8e7- Batch retry backoff stops when the
Commitcontext is cancelled. Used to sleep through the full backoff.d1a78a5 - Batch retry exhaustion error reads "batch had unprocessed items after N attempts" instead of the previous
last error: %!w(<nil>)produced by wrapping a nil error with%w. When a real error is present it is still wrapped aslast error: <err>.9f9326752addd0 DiskUsageandEntryCountnil-checkres.Tableand useaws.ToInt64for the*int64fields, instead of dereferencing them blindly.3538832Queryno longer relies on an unchecked type assertion on the partition-keyAttributeValue.queryKeynow returns the value directly.95e0498- Batch
Commitno longer deadlocks when cancelled mid-retry. The internal error channel is buffered to the chunk count, so the chunk goroutine's deferred send always completes without racing against<-ctx.Done().b7486ea SetTTLworks on tables whose partition key has been renamed viaWithPartitionkey. TheUpdateItemrequest used to include a strayDSKeyattribute and DynamoDB rejected every call withValidationException.c1a28ca
Full Changelog: v0.2.2...v0.3.0
Note
This release was brought to you by the Shipyard team.
