evseevnn-zz / php-cassandra-binary

PHP library for Cassandra database via a binary protocol.
http://evseevnn.github.io/php-cassandra-binary/
MIT License
69 stars 33 forks source link

Allow "COUNTER" batches (transactions) #24

Closed noonie2k closed 10 years ago

noonie2k commented 10 years ago

The implementation of the counter batches here utilizes a separate function to the existing beginBatch() function.

Another implementation could be to extend the existing function to take an optional "type" parameter which would be limited to values of "COUNTER" and "UNLOGGED' (see https://cassandra.apache.org/doc/cql3/CQL.html#batchStmt). The batch query line would then become...

$this->batchQuery = "BEGIN $type BATCH\n";

I will be performing a lot of counter updates for specific events in an application and so Counter Batches are extremely useful to me... I believe this will provide additional value to other clients also.

Regards, Adam

evseevnn-zz commented 10 years ago

Thank you, very glad that there are people so actively involved in the development of libraries.