php-cassandra-binary icon indicating copy to clipboard operation
php-cassandra-binary copied to clipboard

Conditional updates are not supported

Open CBox opened this issue 10 years ago • 3 comments

Is there a way to make Conditional updates supported?

When I'm adding IF NOT EXISTS I'm getting: Invalid: Conditional updates are not supported by the protocol version in use. You need to upgrade to a driver using the native protocol v2.

Thanks!

CBox avatar Apr 05 '15 13:04 CBox

It's working on mine. Can you post your whole CQL and table setup?

for mine $db->beginBatch(); $q = "INSERT INTO sessions (id,data) VALUES (:id,:data) IF NOT EXISTS"; $db->query($q,['id'=>$id,'data'=>$data]); $db->applyBatch();

make sure your query is valid on cqlsh before you run it on this library

mistercorea avatar Apr 23 '15 20:04 mistercorea

This right, It's really working when using Batch, if not there is an error. Good enough for me, Thanks!

CBox avatar Apr 24 '15 08:04 CBox

When using IF NOT EXISTS in a batch, even if one row exists the batch will not insert or update anything. Is there way to get around that? So each statement in a batch will be not related to the other when using if not exists?

CBox avatar Apr 28 '15 02:04 CBox