Skip to content

Write a parser to create a CQL AST #83

@eighty4

Description

@eighty4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions