A schema registry, validated CQL builder, DDL generator, and migration differ for Apache Cassandra. Version 2.2.0 (stable, released 2024). Define your schema in JSON; all CQL statements are validated against it at build time, catching errors like missing columns or invalid primary key updates before deployment. Differentiators: build-time validation (not runtime), CQL builder that enforces schema correctness, and migration diffing for safe schema evolution. Requires Node.js >=18.0.0.
npm install cassandra-guardNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Load a schema from JSON, build a validated SELECT query, and demonstrate build-time column validation.
Replace `registry.loadFromFile('./schema.json')` with `await registry.loadFromFileAsync('./schema.json')`Update code to chain methods directly: `cql.select('ks', 't').columns('a').where('b', 'v').build()`Use `.if_()` not `.if()` in your CQL builder chains.
Check the 'columns' definition in your schema JSON file for the correct column name.
Ensure `cql.select('keyspace', 'table')` returns a builder object. Chain `.columns()` on the result.