I need to check if certain keyspace exists in Cassandra database. I need to write smth like this:
if (keyspace KEYSPACE_NAME not exists) create keyspace KEYSPACE_NAME;
There’s a command describe keyspace, but can I somehow retrieve information from it in cql script?
As of this moment, cql grammar does not provide
create keyspace if not exists. Probably in the future, they will add this feature. The one come close to this, would be this improvement, maybe they will add in for create keyspace too. shrugsYou can probably do something similar using CQL in python or in any Cassandra clients. I have a simple create keyspace if not exists written in java.