cassandra-rs icon indicating copy to clipboard operation
cassandra-rs copied to clipboard

Batch::execute consumes the batch while Connection::execute_batch while does not

Open rukai opened this issue 2 years ago • 2 comments

Is this a bug in one or the other? Also worth noting that there is the similar method execute_batch_with_payloads and they both use the old style CassFuture instead of an async method like Batch::execute does.

rukai avatar Mar 17 '23 02:03 rukai

Ah, you're right - looks like we missed a few. The batch or statement should always be consumed, and we should be using the new-style futures everywhere.

I think we should just remove Session::execute_batch, Session::execute_batch_with_payloads, and Session::execute_with_payloads.

We should add Batch::execute_with_payloads and Statement::execute_with_payloads.

Then we'll need another major version bump, oops.

Would you be able to take a look at that?

kw217 avatar Mar 17 '23 09:03 kw217

@rukai any chance you could look at this? Thanks for spotting the issue!

kw217 avatar Apr 13 '23 10:04 kw217