Database Reference
In-Depth Information
system_rename_keyspace
system_rename_keyspace
Changes the name of a keyspace after taking a snapshot of it. Note that this method blocks
until its work is done.
system_drop_keyspace
system_drop_keyspace
Deletes an entire keyspace after taking a snapshot of it.
system_add_column_family
system_add_column_family
Creates a column family.
system_drop_column_family
system_drop_column_family
Deletes a column family after taking a snapshot of it.
system_rename_column_family
system_rename_column_family
Changes the name of a column family after taking a snapshot of it. Note that this method
blocks until its work is done.
For example, to create a new keyspace using the CLI in 0.7, you can launch the command-line
client as shown here:
[default@unknown] connect 127.0.0.1/9160
Connected to: "Test Cluster" on 127.0.0.1/9160
[default@unknown] create keyspace Test1 with replication_factor=0
610d06ed-a8d8-11df-93db-e700f669bcfc
[default@unknown] describe keyspace Test1
Keyspace: Test1
The convention default@unknown is similar to MySQL, where the authenticated username (if
one is required) and the keyspace name you're currently using act as the prompt. So we can
switch to a different keyspace using the use keyspace command:
use <keyspace> [<username> 'password']
Now that we've switched to our new keyspace on the CLI, we can add a column family to it:
[default@Test1] create column family MyCF
4105a82f-ad51-11df-93db-e700f669bcfc
You can specify additional settings as you like when creating the keyspace or column family us-
ing the with flag, and more settings using the and flag:
[default@MyKeyspace] create keyspace NewKs with replication_factor=1
There are other keyspace-related CLI commands you can invoke as necessary:
Search WWH ::




Custom Search