cqlc-core 1.1.0

CQL lexer, parser, schema resolver, type checker and typed IR for cqlc
Documentation
  • Coverage
  • 100%
    240 out of 240 items documented1 out of 68 items with examples
  • Size
  • Source code size: 337.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.0 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Max-imalgutaussehend/cqlc
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Max-imalgutaussehend

cqlc-core

The compiler front end of cqlc, a static CQL analyzer and Rust code generator for Cassandra-compatible databases.

It contains the lexer, parser, schema resolver, type checker and the typed intermediate representation (IR). It is pure: no I/O and no database access.

use cqlc_core::{compile, Input};

let c = compile(
    &[Input::new("schema.cql", "CREATE TABLE t (k uuid PRIMARY KEY, v text);")],
    &[Input::new("q.cql", "-- name: Get :one\nSELECT v FROM t WHERE k = ?;")],
);
assert!(c.diagnostics.is_empty());
assert_eq!(c.ir.queries[0].name, "Get");

Most users want the cqlc command line tool instead. See the repository for documentation and the stability policy: compile and the ir, schema, types, diagnostic and span modules are covered by semver; the compiler internals are not.

Licensed under the Apache License, Version 2.0.