incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Data Craftsman <database.crafts...@gmail.com>
Subject When will CQL BATCH support binding variable (Query substitution use named parameters)?
Date Wed, 20 Jun 2012 22:06:36 GMT
Hello,

CQL BATCH is good for INSERT/UPDATE performance.

But it cannot do binding variable, exposed to SQL injection.

Is there a plan to make CQL BATCH to support binding variable in near future?

e.g.
http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2/

Query substitution
Use named parameters and a dictionary of names and values.

>> cursor.execute("SELECT column FROM CF WHERE name=:name", dict(name="Foo"))


CQL Batch:
http://www.datastax.com/docs/1.1/references/cql/BATCH

BEGIN BATCH
INSERT INTO demo.product(id, price, description) VALUES (123, 5.98, 'AA''BB')
INSERT INTO demo.product(id, price, description) VALUES (124, 9.78, 'BB''CC')
...
INSERT INTO demo.product(id, price, description) VALUES (567, 2.34, 'E''''F')
APPLY BATCH;

Thanks,

Charlie (@mujiang) 一个 木匠
=======
Data Architect Developer
http://mujiang.blogspot.com

Mime
View raw message