Datastax Cassandra Driver (Python): Is there a way to generate CQL files from the data models we create? As an example if I have a data model:
class ExampleModel(Model):
example_id = columns.UUID(primary_key=True, default=uuid.uuid4)
example_type = columns.Integer(index=True)
created_at = columns.DateTime()
description = columns.Text(required=False)
I know I can create table in Cassandra using the sync_table
but my aim here is to derive the equivalent CQL statements for the create table statement generated from the model above. Is there a way?
cqlsh
you candescribe yourtable;
to get the correspondingCREATE TABLE...
statements. – xmas79desc table
from python, is there a better way? – Segmented