You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sebastian Schmidt <is...@gmail.com> on 2014/04/16 10:23:06 UTC
How to clear all data using CQL?
Hey
I want to do unit tests for software that uses Cassandra as storage
backend. Using the Hector client, I could just iterate over all
keyspaces and delete them. In CQL, there is no query to list all
keyspaces. How can I drop all Keyspaces from Cassandra, without knowing
every single Keyspace name?
Regards,
Sebastian
Re: How to clear all data using CQL?
Posted by James Horey <jl...@opencore.io>.
If you’re running unit tests and repeatadly clearing the Cassandra keyspaces, you may want to check out Ferry (ferry.opencore.io). It lets you standup/destroy multiple Cassandra stacks locally on your machine and is useful for the use case you described. I’m the author of Ferry, and would be glad to help out.
(Sorry for the plug)
James
On Apr 16, 2014, at 5:29 AM, Sebastian Schmidt <is...@gmail.com> wrote:
> Thank you that worked!
>
> Am 16.04.2014 10:46, schrieb Mark Reddy:
>> select keyspace_name from system.schema_keyspaces;
>>
>
Re: How to clear all data using CQL?
Posted by Sebastian Schmidt <is...@gmail.com>.
Thank you that worked!
Am 16.04.2014 10:46, schrieb Mark Reddy:
> /select keyspace_name from system.schema_keyspaces;/
>
Re: How to clear all data using CQL?
Posted by Mark Reddy <ma...@boxever.com>.
To get a list of all keyspaces via CQL you can run:
*describe keyspaces *or *select keyspace_name from system.schema_keyspaces;*
On Wed, Apr 16, 2014 at 9:23 AM, Sebastian Schmidt <is...@gmail.com>wrote:
> Hey
>
> I want to do unit tests for software that uses Cassandra as storage
> backend. Using the Hector client, I could just iterate over all
> keyspaces and delete them. In CQL, there is no query to list all
> keyspaces. How can I drop all Keyspaces from Cassandra, without knowing
> every single Keyspace name?
>
> Regards,
> Sebastian
>