Notes From Heck

Code Monkey Speaketh.

An NeDB Adapter for Sails / Waterline - 0.10.x

Released my second fully finished open source project a few days back. Wrote an ORM adapter for Waterline (the persistence layer of Sails.js) that works with the Node Embedded Database.

The source is available on GitHub: sails-nedb

Npm Downloads

I like working with Sails as it fits just the right spot for me, in terms of features, configurability and usability. For small portable projects, it often doesn't make sense to provision an external database server, just for a few thousand records. An embedded database would work just fine to serve a single end user.

Sails already comes packaged with a disk adapter, but I wanted something that would work atop NeDB, simply because it is the best embedded JS database out there. With MongoDB-like syntax, support for atomic operations and indexes, one couldn't just ignore it for too long. Not finding any adapters on the NPM registry, I decided to go ahead and build one. I did have to tweak the NeDB database internals in order to add support for aggregation - a feature that was missing in the stock product. The adapter will run atop my forked version, until this pull request gets merged into the master branch of the main repo.

Update: The main NeDB repo was not being updated for a while, so a bunch of rather decent folks decided to fork it and revive the stagnating codebase with a bunch of critical PRs (including mine). This new repo is to be found here.

Author image
Bangalore, India
I’m a developer, a hobbyist biker, and a Linux enthusiast. When not riding into the sunset, and not being a general nuisance, I like to experiment with new systems and concepts in technology.