/waterline

An adapter-based ORM for Node.js with support for mysql, mongo, postgres, redis, and more

Primary LanguageJavaScriptMIT LicenseMIT

Waterline logo

Build Status NPM version Dependency Status Test Coverage StackOverflow

Waterline is a brand new kind of storage and retrieval engine.

It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get and store things like users, whether they live in Redis, MySQL, MongoDB, or Postgres.

Waterline strives to inherit the best parts of ORMs like ActiveRecord, Hibernate, and Mongoose, but with a fresh perspective and emphasis on modularity, testability, and consistency across adapters.

For detailed documentation, go to Waterline Documentation repository.

Installation

Install from NPM.

$ npm install waterline

Overview

Waterline uses the concept of an Adapter to translate a predefined set of methods into a query that can be understood by your data store. Adapters allow you to use various datastores such as MySQL, PostgreSQL, MongoDB, Redis, etc. and have a clear API for working with your model data.

It also allows an adapter to define it's own methods that don't necessarily fit into the CRUD methods defined by default in Waterline. If an adapter defines a custom method, Waterline will simply pass the function arguments down to the adapter.

You may also supply an array of adapters and Waterline will map out the methods so they are both mixed in. It works similar to Underscore's Extend method where the last item in the array will override any methods in adapters before it. This allows you to mixin both the traditional CRUD adapters such as MySQL with specialized adapters such as Twilio and have both types of methods available.

Community Adapters

Support

Need help or have a question?

Issue Submission

Please read the issue submission guidelines before opening a new issue.

Waterline and Sails are composed of a number of different sub-projects, many of which have their own dedicated repository. If you suspect an issue in one of these sub-modules, you can find its repo on the organization page, or in MODULES.md. Click here to search/post issues in this repository.

Feature Requests

If you have an idea for a new feature, please feel free to submit it as a pull request to the backlog section of the ROADMAP.md file in this repository.

Contribute

Please carefully read our contribution guide before submitting a pull request with code changes.

Tests

All tests are written with mocha and should be run with npm:

  $ npm test

Coverage

To generate the code coverage report, run:

  $ npm run coverage

And have a look at coverage/lcov-report/index.html.

License

MIT License Copyright © 2012-2016 Balderdash Design Co.

image_squidhome@2x.png