Provides easy access to cassandra from Sails.js & Waterline.
This module is a Sails/Waterline community adapter. Its goal is to provide a set of declarative interfaces, conventions, and best-practices for integrating with the cassandra database/service.
Strict adherence to an adapter specification enables the (re)use of built-in generic test suites, standardized documentation, reasonable expectations around the API for your users, and overall, a more pleasant development experience for everyone.
Currently, this adapter is in the development process. That's why it's not hosted on npm. The only way to install sails-cassandra is to clone this repository and move it into your project's node_modules folder.
After that, you can configure the adapter just like the following in the config/datastores.js of Sails:
cassandra: {
adapter: 'sails-cassandra',
user: 'user',
password: 'password',
contactPoints: [ 'localhost' ],
keyspace: 'testDatabase',
localDataCenter: 'datacenter1',
schema: true
}
Visit Models & ORM in the docs for more information about using models, datastores, and adapters in your app/microservice.
See Extending Sails > Adapters > Custom Adapters in the Sails documentation, or check out recommended support options.
This adapter implements the following methods:
| Method | Status | Category |
|---|---|---|
| registerDatastore | Implemented | LIFECYCLE |
| teardown | in progress | LIFECYCLE |
| create | Implemented | DML |
| createEach | Planned | DML |
| update | Implemented | DML |
| destroy | Implemented | DML |
| find | Implemented | DQL |
| join | not supported | DQL |
| count | Implemented | DQL |
| sum | Planned | DQL |
| avg | Planned | DQL |
| define | Planned | DDL |
| drop | Planned | DDL |
| setSequence | ??? | DDL |
This cassandra adapter is available under the MIT license.
As for Waterline and the Sails framework? They're free and open-source under the MIT License.