dynalite icon indicating copy to clipboard operation
dynalite copied to clipboard

Add TransactWriteItems

Open jpeterschmidt opened this issue 4 years ago • 17 comments
trafficstars

An expansion on this PR from mid-2020, this PR implements TransactWriteItems.

related to #98

jpeterschmidt avatar Jul 30 '21 14:07 jpeterschmidt

Addresses #98

exoego avatar Aug 24 '21 03:08 exoego

any update from this?

ashkanjj avatar Oct 20 '21 16:10 ashkanjj

Great PR, would love to see it merged.

derolf avatar Nov 05 '21 21:11 derolf

I've been using a local build of this branch for testing my own code for several months and haven't found any issues. I'd say this is ready for review/to be merged!

@mhart

jpeterschmidt avatar Nov 09 '21 16:11 jpeterschmidt

Any update on this? Would love to see it merged in….

bbbates avatar Dec 07 '21 03:12 bbbates

Likewise!

ajoslin avatar Jan 03 '22 20:01 ajoslin

Is there a reason that prevents this PR from being merged? Something we could help with?

@jpeterschmidt There is a bug in the transaction implementation: Condition checks apparently don't work

  await client
    .put({
      TableName: "someTable",
      Item: {
        streamId: "someAggregateId",
        version: 1,
      },
    })
    .promise();

// this works as expected: condition is not met, op fails
  try {
    await client
      .put({
        TableName: "someTable",
        ConditionExpression: "attribute_not_exists(version)",
        Item: {
          streamId: "someAggregateId",
          version: 1,
        },
      })
      .promise();
  } 

// this does NOT works as expected: condition is not met, but op succeeds
  try {
    await client
      .transactWrite({
        TransactItems: [
          {
            Put: {
              TableName: tableName,
              ConditionExpression: "attribute_not_exists(version)",
              Item: {
                streamId: "someAggregateId",
                version: 1,
              },
            },
          },
        ],
      })
      .promise();
  }

florianbepunkt avatar Feb 16 '22 09:02 florianbepunkt

Any news ? I would like to see that feature :(

scorsi avatar Nov 13 '22 19:11 scorsi

@florianbepunkt Just pushed a commit that should fix your issue; I mistakenly omitted checking ConditionExpressions from Puts and Deletes. Pretty big miss on my part - thanks for catching!

@scorsi @bbbates @ajoslin no updates from me; maybe @mhart can weigh in on what else needs to happen!

jpeterschmidt avatar Nov 14 '22 19:11 jpeterschmidt

Any news on this?

lpsinger avatar Dec 21 '22 05:12 lpsinger

cc @mhart

dimaqq avatar Dec 21 '22 06:12 dimaqq

any news?

diogo-alexandre avatar Dec 23 '22 14:12 diogo-alexandre

@mhart Would there be any chance of merging and releasing TransactWrite support?

I have been using a fork of the repo with only this PR merged: https://github.com/c-py/dynalite

It's working really well, would love to see this merged and on NPM.

c-py avatar Feb 09 '23 04:02 c-py

@jpeterschmidt thank you so much for all the legwork you did on this PR! It's chonky and will take me a while to review, but reviewed it shall be. Are you amenable to picking it back up together? Thanks in advance!

ryanblock avatar Aug 30 '23 02:08 ryanblock

hey @ryanblock, absolutely! I'll spend some time this week getting familiar again with what I did.

jpeterschmidt avatar Aug 30 '23 13:08 jpeterschmidt

@jpeterschmidt great news! I'll dig into it as well and provide any additional specific feedback (although tbh right now you probably know this codebase better than I do!). Also, if you'd like to get more real-time, please find us in our Discord's dynalite channel.

ryanblock avatar Aug 30 '23 15:08 ryanblock

Earlier today I updated the linting on this project, and pulled those changes (and related fixes the linter caught) over here: https://github.com/architect/dynalite/pull/174 – @jpeterschmidt I don't have write access to this PR, so would you like to merge that branch into this one?

ryanblock avatar Sep 03 '23 21:09 ryanblock