@yukim/cqlparser
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Cassandra Query Language (CQL) parser

Hand crafted Apache Cassandra CQL parser, implemented in Rust.

WARNING: This library is still in very early stage, and APIs and AST will change.

Design goals

The goal of this library is to provide standalone CQL parser that can be used in tools, such as pretty printer, auto completion, schema visualizer, etc.

The design goals are:

  • Minimum dependencies
  • Detailed error reporting
  • WebAssembly compatible
  • Complete and validatable AST
  • Supports both CQL to AST and AST to CQL
  • Parsing multiple statements

Supported CQL versions

Implemented statements

  • [x] SELECT statement
    • SELECT JSON / DISTINCT is not yet implemented
  • [x] INSERT statement
  • [x] UPDATE statement
  • [ ] BATCH statement
  • [ ] DELETE statement
  • [ ] USE statement
  • [ ] TRUNCATE statement
  • [x] CREATE KEYSPACE statement
  • [x] CREATE TABLE statement
  • [x] CREATE INDEX statement
  • [ ] DROP KEYSPACE statement
  • [ ] DROP TABLE statement
  • [ ] DROP INDEX statement
  • [ ] ALTER TABLE statement
  • [ ] ALTER KEYSPACE statement
  • [ ] GRANT PERMISSIONS statement
  • [ ] REVOKE PERMISSIONS statement
  • [ ] LIST PERMISSIONS statement
  • [ ] CREATE USER statement (deprecated)
  • [ ] ALTER USER statement (deprecatd)
  • [ ] DROP USER statement (deprecated)
  • [ ] LIST USERS statement (deprecated)
  • [ ] CREATE TRIGGER statement
  • [ ] DROP TRIGGER statement
  • [x] CREATE TYPE statement
  • [ ] ALTER TYPE statement
  • [ ] DROP TYPE statement
  • [ ] CREATE FUNCTION statement
  • [ ] DROP FUNCTION statement
  • [ ] CREATE AGGREGATE statement
  • [ ] DROP AGGREGATE statement
  • [ ] CREATE ROLE statement
  • [ ] ALTER ROLE statement
  • [ ] DROP ROLE statement
  • [ ] LIST ROLES statement
  • [ ] GRANT ROLE statement
  • [ ] REVOKE ROLE statement
  • [x] CREATE MATERIALIZED VIEW statement
  • [ ] DROP MATERIALIZED VIEW statement
  • [ ] ALTER MATERIALIZED VIEW statement
  • [ ] DESCRIBE statement

TODOs

  • Binding variables are not yet supported.

Readme

Keywords

Package Sidebar

Install

npm i @yukim/cqlparser

Weekly Downloads

1

Version

0.1.0

License

Apache-2.0

Unpacked Size

207 kB

Total Files

6

Last publish

Collaborators

  • yukim