You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by @calvinlfer - make ConditionCheck type (which is part of the transaction API) public so that users can use it to ascribe types.
defconditionalCheckAddTransaction(givenP1: DynamoPerson, givenP2: DynamoPerson)(
write: DynamoPerson
):IO[DynamoDBError, Option[DynamoPerson]] =defcheckPrimaryKeyAndName(p: DynamoPerson) =// can't type ConditionCheck here valprimaryKey= (DynamoPerson.pk.partitionKey === p.pk &&DynamoPerson.sk.sortKey === p.sk).asAttrMap
DynamoDBQuery.conditionCheck(table, primaryKey)(
DynamoPerson.name === p.name
)
// given the presence of persons #1 and #2 in the table, we want to write a new personvalcond1= checkPrimaryKeyAndName(givenP1)
valcond2= checkPrimaryKeyAndName(givenP2)
valadd=DynamoDBQuery.put(tableName = table, write)
valtxn= cond1.zipRight(cond2).zipRight(add).transaction
executor
.execute(txn)
.tapSomeError:caseDynamoDBError.AWSError(cause)
if cause.awsErrorDetails().errorCode() =="ConditionalCheckFailedException"=>ZIO.debug(cause.awsErrorDetails())
The text was updated successfully, but these errors were encountered:
Reported by @calvinlfer - make
ConditionCheck
type (which is part of the transaction API) public so that users can use it to ascribe types.The text was updated successfully, but these errors were encountered: