feathers-waterline-aggregate-aggregate
A database adapter for the Waterline ORM, the ORM used by SailsJS. For detailed Waterline documentation, see the waterline-docs repository. Currently Waterline supports the following data stores:
NOTE: Work In Progress. This fork intends to provide some aggregate function support not found in feathers-waterline.
- PostgreSQL - 0.9+ compatible
- MySQL - 0.9+ compatible
- MongoDB - 0.9+ compatible
- Memory - 0.9+ compatible
- Disk - 0.9+ compatible
- Microsoft SQL Server
- Redis
- Riak
- IRC
- JSDom
- Neo4j
- OrientDB
- ArangoDB
- Apache Cassandra
- GraphQL
- Solr
Status
This module will continue to work as is but needs a maintainer for future feature and dependency updates. Create an issue if you are interested.
Installation
npm install feathers-waterline-aggregate --save
ProTip: You also need to install the waterline database adapter for the DB you want to use.
Getting Started
feathers-waterline-aggregate
hooks a Waterline Model up to a configured data store as a feathers service.
const Message = ;const config = ;const Waterline = ;const service = ; const ORM = ; ORM;ORM;
Options
Creating a new Waterline service currently offers the following options:
Model
(required) - The Waterline model definitionid
(default:id
) [optional] - The name of the id propertypaginate
[optional] - A pagination object containing adefault
andmax
page size (see the Pagination chapter)
Complete Example
Here is an example of a Feathers server with a messages
Waterline Model using the Disk store:
$ npm install feathers feathers-rest feathers-socketio body-parser waterline sails-disk feathers-waterline-aggregate
const feathers = ;const rest = ;const socketio = ;const bodyParser = ;const Waterline = ;const diskAdapter = ;const service = ; const ORM = ;const config = adapters: 'default': diskAdapter disk: diskAdapter connections: myLocalDisk: adapter: 'disk' defaults: migrate: 'alter' ;const Message = WaterlineCollection; // Create a feathers instance.const app = // Enable REST services // Enable Socket.io services // Turn on JSON parser for REST services // Turn on URL-encoded parser for REST services ; ORM;ORM;
License
Copyright (c) 2016
Licensed under the MIT license.