Code Monkey home page Code Monkey logo

cquill's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cprieto taylornz

cquill's Issues

Dev mode that drops and recreates a keyspace for developer productivity

Developer workflows for adding new statements to a CQL file that's already been migrated to a local cassandra. There are two current approaches:

  • Add new CQL files to migrate that will be merged into a single CQL file when development work is ready to be committed
  • Repeatedly drop keyspace ... with cqlsh and rerun cquill migrate

Hibernate and Flyway supports dropping and recreating schemas for developer experience. This could be replicated with a --refresh or --dev-refresh flag on the migrate command.

I'm hesitant about introducing this as a param that could accidentally get ran against a production database. Another option would be to introduce a new command called dev that would behave like migrate with the extra step of removing the existing keyspaces.

Write a parser to create a CQL AST

The current CQL parsing before migrating a CQL file only separates statements, tracks line numbers and removes comments.

There are many enhancements that would benefit from generating an AST from a cql file before migrating. The primary benefit would be syntax validation before executing a query. This would reduce the chance of partially migrating a CQL file that would require manual cleanup.

Other potential enhancements include:

  • formatter and linter features for developer experience
  • suggest rollback CQL to rollback from an error after partially migrating a CQL file
  • augmenting statements with an alternate keyspace for test isolation

There's an ANTLR crate that could be used with the cql3.0 grammar on antlr/grammars but it would probably be more fun to code a parser.

Embedding migrations

Is it possible to embed migrations and run them at startup? Is this feature outside the scope of this repository?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.