-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi transaction API changes #81
Conversation
README.md
Outdated
|
||
transaction.Check(table, key, doesntExistCondition) | ||
transaction.Put(table, item2, None) | ||
transaction.Put(table, item3, Some existsCondition) | ||
transaction.Delete (table ,table.Template.ExtractKey item5, None) | ||
|
||
do! transaction.TransactWriteItems() | ||
``` | ||
|
||
Failed preconditions (or `TransactWrite.Check`s) are signalled as per the underlying API: via a `TransactionCanceledException`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed preconditions (or `TransactWrite.Check`s) are signalled as per the underlying API: via a `TransactionCanceledException`. | |
Failed preconditions (or `Check`s) are signalled as per the underlying API: via a `TransactionCanceledException`. |
README.md
Outdated
@@ -269,25 +269,26 @@ let doesntExistCondition = compile <@ fun t -> NOT_EXISTS t.Value @> | |||
let existsCondition = compile <@ fun t -> EXISTS t.Value @> | |||
let key = TableKey.Combined(hashKey, rangeKey) | |||
|
|||
let transaction = Transaction() | |||
let transaction = table.CreateTransaction() | |||
|
|||
transaction.Check(table, key, doesntExistCondition) | |||
transaction.Put(table, item2, None) | |||
transaction.Put(table, item3, Some existsCondition) | |||
transaction.Delete (table ,table.Template.ExtractKey item5, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transaction.Delete (table ,table.Template.ExtractKey item5, None) | |
transaction.Delete(table, table.Template.ExtractKey item5, None) |
@@ -1318,22 +1318,19 @@ type TableContext<'TRecord> | |||
else | |||
t.VerifyTableAsync() | |||
|
|||
member t.Transaction() = | |||
/// <summary>Creates a new `Transaction`, using the DynamoDB client and metricsCollector configured for this `TableContext`</summary> | |||
member _.CreateTransaction() = | |||
match metricsCollector with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match metricsCollector with | |
Transaction(client, ?metricsCollector = metricsCollector) |
@@ -2151,7 +2137,7 @@ module Scripting = | |||
t.UpdateTableIfRequiredAsync(spec) |> Async.Ignore |> Async.RunSynchronously | |||
|
|||
/// Helpers for working with <c>TransactWriteItemsRequest</c> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Helpers for working with <c>TransactWriteItemsRequest</c> | |
/// Helpers for working with <c>Transaction</c> |
Feedback from #77