Registry / database / dakota-cassandra

dakota-cassandra

JSON →
library0.0.37jsnpmunverified

A full-featured Apache Cassandra ORM for Node.js built on the DataStax Node.js driver. Version 0.0.37 is the latest release. Development is sporadic with no recent updates. It offers chainable query building, schema validation, automatic keyspace/table/user-defined type rectification, and full support for Cassandra data types including collections, counters, and tuples. Unlike simpler query builders, it provides an active-record style model with lifecycle callbacks, setters/getters, and change tracking.

npm install dakota-cassandra
INSTALL
IMPORT
SIG · DAKOTA-CASSANDRA
D
dakota-cassandra
databasejavascriptv0.0.37
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Dakota
const Dakota = require('dakota-cassandra');
import Dakota from 'dakota-cassandra';
This library uses CommonJS and does not export an ESM module.
new Dakota(options)
const dakota = new Dakota(options);
Dakota(options);
Requires the 'new' keyword to instantiate.
Model
const User = dakota.addModel('User', schema, validations);
const User = require('dakota-cassandra').Model;
Models are created via the Dakota instance, not imported directly.

Connects to a local Cassandra instance, defines a User model with schema validation, creates and saves a new user, then queries for it by name.

const Dakota = require('dakota-cassandra'); const dakota = new Dakota({ connection: { contactPoints: ['127.0.0.1'], localDataCenter: 'datacenter1', keyspace: 'mykeyspace' } }); const userSchema = { name: { type: 'text', required: true }, email: { type: 'text', validate: { regex: /@/ } }, age: { type: 'int', default: 18 } }; const User = dakota.addModel('User', userSchema); const user = new User({ name: 'Alex', email: 'alex@example.com' }); user.save((err) => { if (err) console.error(err); else console.log('Saved user'); }); User.where({ name: 'Alex' }).first((err, found) => { if (err) console.error(err); else console.log('Found:', found); });
Debug
Known issues
gotchaThe library has no active maintenance; issues and pull requests may not be addressed.
fix
Consider using alternatives like express-cassandra or cql-translator for production.
affects: 0.0.0
breakingESM imports are not supported; only CommonJS require works.
fix
Use const Dakota = require('dakota-cassandra'); instead of import.
affects: >=0.0.0
gotchaThe keyspace option must be provided in connection options or schema rectification may fail.
fix
Always include keyspace in connection options.
affects: >=0.0.0
gotchaSchema rectification can automatically alter tables; disabling it is recommended for production.
fix
Set schema rectification options to 'ensure exists' or false.
affects: >=0.0.0
gotchaCollection type operations (append, prepend) may not work as expected without proper schema definitions.
fix
Ensure collection columns are defined as list, set, or map in the schema.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Connection error: All host(s) tried for query failed
Cassandra server is not running or contact points are incorrect.
fix
Verify Cassandra is running and contactPoints includes the correct host:port.
TypeError: Dakota is not a constructor
Using import instead of require or missing 'new' keyword.
fix
Use const Dakota = require('dakota-cassandra'); and then new Dakota(options);
Error: Keyspace 'mykeyspace' does not exist
Specified keyspace has not been created in Cassandra.
fix
Create the keyspace manually or enable auto-rectification with ensureExists: true.
TypeError: Cannot read property 'save' of undefined
Model was not created correctly or dakota instance failed to connect.
fix
Check that dakota.addModel returned a valid model. Ensure connection options are correct.
Upgrade
Version history
0.0.37latest on npm
Audit
Dependencies
cassandra-driverrequiredUnderlying Cassandra driver for database connectivity and CQL execution
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
dakota-cassandra — npm install dakota-cassandra · libregistry