Skip to content

Releases: guregu/dynamo

Minor touchups

19 Mar 19:15
Compare
Choose a tag to compare

This release updates dependencies, fixes and improves some docs (#86, #91), and fixes a couple instances where context didn't get passed to the AWS SDK (#93).

On-demand and better If

26 Feb 18:29
Compare
Choose a tag to compare

This release adds some new features:

  • #87: On-demand (pay per request) billing mode support in CreateTable, UpdateTable, and table Descriptions. Just use OnDemand(true).
  • #89: You can now call If multiple times when using Update, Put, Delete, and ConditionCheck and your conditions will be combined with AND. Formerly, it replaced the previous condition which could lead to buggy behavior.
    • Additionally, Filter in Query and Scan is now careful about adding parentheses so that multiple calls will always have isolated conditions.

CreateTable fix

19 Feb 17:42
Compare
Choose a tag to compare

This is a minor release that fixes CreateTable not working under certain conditions. See: #88

Transactions

08 Jan 17:25
d8bb6a0
Compare
Choose a tag to compare

This release adds support for DynamoDB transactions! For a quick and dirty intro to them, see tx_test.go.
You create transactions by composing pre-existing parts of the library such as Update and Delete.

For example, imagine a game where you can give money to other players. The following transaction models Alice giving 100 gold to Bob and adding a log to a separate table, but only if Alice has enough gold.

tx := db.WriteTx()
users := db.Table("Users")
logs := db.Table("TradeLogs")
amount := 100
tx.Update(users.Update("UserID", "Alice").Add("Gold", -amount).If("Gold >= ?", amount))
tx.Update(users.Update("UserID", "Bob").Add("Gold", amount))
tx.Put(logs.Put(TradeLog{From: "Alice", To: "Bob", Amount: amount, Time: time.Now()}))
err := tx.Run()

If any part of the transaction fails, it will be rolled back and an appropriate error will be returned.

The official AWS Go SDK is still missing some transactions features, and we'll add support for them as they trickle in.
This release also adds support for Go modules.

First versioned release

01 Aug 14:52
e38c48c
Compare
Choose a tag to compare

The API has been relatively stable since the beginning and that API is now officially version 1 🎉
There are still things to add and changes I'd like to make, but rest assured that semver will be upheld.
Thanks to everyone who uses this library.