Skip to the content.

< Back

Returns a list of strings representing each keyspaces of Cassandra (similar to cql command describe keyspaces;)

def get_keyspaces():

Gets a table list of keyspace

def get_tablenames(keyspace):

Returns a list of columns from keyspace.tablename

def get_columns(keyspace, tablename):

Gets partition key from keyspace.tablename

def get_partition_key(keyspace, tablename):

Gets clustering key from keyspace.tablename

def get_clustering_key(keyspace, tablename):

Gets primary key

def get_primary_key(keyspace, tablename):

Describe keyspace.tablename

def describe_table(keyspace, tablename):

Creates a keyspace with keyspace name, strategy and replication_factor are regular options for Cassandra Keyspaces, see documentation at Datastax

def create_keyspace(keyspace, strategy='SimpleStrategy', replication_factor=1):

Creates a table with keyspade.tablename columns parameter has a dictionary description for data fields

def create_table(keyspace, tablename, columns, partition_key=None,
                 cluster_key=None, replication_factor=1,
                 durable_writes=True, connections=None, create_keyspace_if_not_exists=True):