Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trailsjs/trailpack-waterline
:package: Waterline.js Trailpack
https://github.com/trailsjs/trailpack-waterline
orm trailpack trails waterline
Last synced: 6 days ago
JSON representation
:package: Waterline.js Trailpack
- Host: GitHub
- URL: https://github.com/trailsjs/trailpack-waterline
- Owner: trailsjs
- License: mit
- Created: 2015-11-26T08:50:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-19T19:41:31.000Z (almost 7 years ago)
- Last Synced: 2024-11-02T21:04:10.389Z (12 days ago)
- Topics: orm, trailpack, trails, waterline
- Language: JavaScript
- Homepage:
- Size: 88.9 KB
- Stars: 8
- Watchers: 10
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# trailpack-waterline
[![Gitter][gitter-image]][gitter-url]
[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]
[![Dependency Status][daviddm-image]][daviddm-url]
[![Code Climate][codeclimate-image]][codeclimate-url]Loads Application Models (in `api/models`) into the Waterline ORM; Integrates with [trailpack-router](https://github.com/trailsjs/trailpack-router) to
generate Footprints for routes.## Usage
### Configure
```js
// config/main.js
module.exports = {
// ...
packs: [
require('trailpack-waterline')
]
}
```### Query
```js
// api/services/BirthdayService.js
module.exports = {
/**
* Finds people with the given birthday.
* @return Promise
* @example {
* name: 'Ludwig Beethoven',
* birthday: Sun Dec 16 1770 00:00:00 GMT-0500 (EST),
* favoriteColors: [
* { name: 'yellow', hex: 'ffff00' },
* { name: 'black', hex: '000000' }
* ]
* }
*/
findPeopleWithBirthday (birthday) {
return this.orm.Person.find({ birthday: birthday })
.populate('favoriteColors')
}
}
```## Contributing
We love contributions! Please check out our [Contributor's Guide](https://github.com/trailsjs/trails/blob/master/CONTRIBUTING.md) for more
information on how our projects are organized and how to get started.## License
[MIT](https://github.com/trailsjs/trailpack-waterline/blob/master/LICENSE)[npm-image]: https://img.shields.io/npm/v/trailpack-waterline.svg?style=flat-square
[npm-url]: https://npmjs.org/package/trailpack-waterline
[ci-image]: https://img.shields.io/travis/trailsjs/trailpack-waterline/master.svg?style=flat-square
[ci-url]: https://travis-ci.org/trailsjs/trailpack-waterline
[daviddm-image]: http://img.shields.io/david/trailsjs/trailpack-waterline.svg?style=flat-square
[daviddm-url]: https://david-dm.org/trailsjs/trailpack-waterline
[codeclimate-image]: https://img.shields.io/codeclimate/github/trailsjs/trailpack-waterline.svg?style=flat-square
[codeclimate-url]: https://codeclimate.com/github/trailsjs/trailpack-waterline
[gitter-image]: http://img.shields.io/badge/+%20GITTER-JOIN%20CHAT%20%E2%86%92-1DCE73.svg?style=flat-square
[gitter-url]: https://gitter.im/trailsjs/trails