Skip to content
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

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Conversation

samritchie
Copy link
Collaborator

Feedback from #77

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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Helpers for working with <c>TransactWriteItemsRequest</c>
/// Helpers for working with <c>Transaction</c>

@samritchie samritchie merged commit c4f7d1d into master Nov 14, 2024
4 checks passed
@samritchie samritchie deleted the multi-transaction-changes branch November 14, 2024 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants