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

Write a parser to create a CQL AST #83

Open
eighty4 opened this issue Jul 31, 2023 · 0 comments
Open

Write a parser to create a CQL AST #83

eighty4 opened this issue Jul 31, 2023 · 0 comments

Comments

@eighty4
Copy link
Owner

eighty4 commented Jul 31, 2023

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.

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

1 participant