riptano / cdm

Cassandra Dataset Manager
Apache License 2.0
32 stars 7 forks source link

think about alternate schema importing #55

Closed rustyrazorblade closed 8 years ago

rustyrazorblade commented 8 years ago

currently loading a schema shells out to cqlsh. this kind of sucks.

would it be better to include schema as a schema.py file, with a list of statements?

schema = [ "CREATE TABLE XYZ" ]

perhaps more meta data to allow for advanced install options? it would be nice to have the installer auto detect the version and install the tables that support the feature.

schema = [ Statement("CREATE TABLE XYZ", sasi=True) ]

It would also be useful to be able to set up a specific feature (like a materialized view) and if that isn't available, create a table. So effectively schema branching based on versions. Need to mull over that syntax.

rustyrazorblade commented 8 years ago

cassandra_schema() should return a list of statements or cqlengine models which can be syncronized to the db