Search code examples
astyanax

Is it possible to run CQL3 queries "create table", "insert into" with Astyanax?


For now I have found just "select" examples.

Or is it possible to do with e.g. MutationBatch?

MutationBatch m = keyspace.prepareMutationBatch();
ColumnListMutation<String> cfmStandard = m.withRow(MY_CF, ...);

my column family is:

 CREATE TABLE my_cf (
                   ... key text,
                   ... timeid timeuuid,
                   ...   flag boolean,
                   ...   data text,
                   ... PRIMARY KEY (key, timeid));

Solution

  • worked for inserts and create:

    keyspace.prepareQuery(MY_CF).withCql(queryBuilder.toString()).execute();