Provides an alternate access mechanism to Apache Couchdb from Sails.js & Waterline.
The core idea is,
Create a single database for all models (than one database per model) Identify models by an doc_type attribute Create a doc_type == 'metadata' document for each document type (Analogous to _design docs) Automatically generate simple indexed views that is accessible from the find function (Inspired by the original couchdb adapter) Ability to switch between all couch variants supported by nano
To install this adapter, run:
$ npm install sails-couch-alt (Not deployed in npm registry yet. Coming soon)
This adapter exposes the following methods:
Find by id, find by where conditions. For each where condition, if a design doc is not present a new one is created, using a templated map funcion. TODO: Add more flexibility in creating views
Does a nano.insert() by updating the id to _id column.
Does a nano.insert taking into account the _rev property
Finds the records specified by the where condition and, sets the _deleted property.
TODO: Support local instance of pouchDB. Currently only passing the basic tests, implement queryable interfaces completely Optimize for speed.
Configure the interfaces you plan to support (and targeted version of Sails/Waterline) in the adapter's package.json
file:
{
//...
"sails": {
"adapter": {
"sailsVersion": "~0.10.0",
"implements": [
"semantic",
"queryable"
]
}
}
}
In your adapter's directory, run:
$ npm test
MIT © 2014 houm & [contributors] vipinr & contributors
Sails is free and open-source under the MIT License.