DROP KEYSPACE
Immediate, irreversible removal of the keyspace, including objects such as tables, functions, and data in the keyspace.
DataStax recommends not manually deleting the DSEFS keyspace or other system keyspaces. |
A snapshot is automatically created, before the keyspace is dropped; see Restoring from a snapshot for recovery details. |
Synopsis
DROP KEYSPACE [ IF EXISTS ] <keyspace_name> ;
Syntax legend
Syntax conventions | Description |
---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
|
Variable value. Replace with a user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
Set, list, map, or tuple.
Angle brackets ( |
|
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrConfig files. |
Example
Drop the cycling keyspace:
DROP KEYSPACE cycling;
Drop the cycling keyspace if it exists:
DROP KEYSPACE IF EXISTS cycling;