Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to generate the bootstrap.cql from a template #46

Open
chrishughes25 opened this issue Nov 21, 2016 · 3 comments
Open

ability to generate the bootstrap.cql from a template #46

chrishughes25 opened this issue Nov 21, 2016 · 3 comments
Assignees

Comments

@chrishughes25
Copy link

I would like the ability to provide a bootstrap.template, with the keyspace name, and the replication factor as replaceable values, so that don't have to duplicate the bootstrap.cql for each environment.

@oliverlockwood oliverlockwood self-assigned this Nov 25, 2016
@oliverlockwood
Copy link
Contributor

@chrishughes25 I've also thought that something like this would be a good idea.

Would you please provide an example of the kind of bootstrap.template file you envisage (just as a comment would be fine for now), so we can discuss further?

@chrishughes25
Copy link
Author

@oliverlockwood bootstrap.template would contain the cql required to create a keyspace, (and tables).
It would allow 2 replacement variables, {keyspace} and {replication} which the library would expose through its api.
It would be mandatory to include the bootstrap.template file, either at the root classpath level, (or this could be a configurable item.) and would take the place of the bootstrap.cql
The library would read the template and replace the values, then apply it as it does for a bootstrap.cql.

To maintain the replication factor in sync with the properties files, requires additional work. This can use the existing functionality used to apply the deltas, by writing the alter keyspace statement into a file in the /cql directory, with the name to include the checksum of the replicationFactor being applied. (This allows the existing schema-update functionality to make sure the statement is only applied once)

@bluedigits
Copy link

Wouldn't this proposal limit you to have one keyspace only?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants