Files
deb-python-cassandra-driver/docs/cqlengine/manage_schemas.rst
2015-02-05 12:21:51 -06:00

1.3 KiB

Managing Schemas

Users of versions < 0.4, please read this post before upgrading: Breaking Changes

cqlengine.connection

cqlengine.management

Once a connection has been made to Cassandra, you can use the functions in cqlengine.management to create and delete keyspaces, as well as create and delete tables for defined models

create_keyspace(name)

param name

the keyspace name to create

type name

string

creates a keyspace with the given name

delete_keyspace(name)

param name

the keyspace name to delete

type name

string

deletes the keyspace with the given name

sync_table(model)

param model

the ~cqlengine.model.Model class to make a table with

type model

~cqlengine.model.Model

syncs a python model to cassandra (creates & alters)

drop_table(model)

param model

the ~cqlengine.model.Model class to delete a column family for

type model

~cqlengine.model.Model

deletes the CQL table for the given model

See the example at getting-started