Socket
Socket
Sign inDemoInstall

feathers-sequelize

Package Overview
Dependencies
Maintainers
2
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-sequelize - npm Package Compare versions

Comparing version 2.4.0 to 3.0.0

db.sqlite

412

CHANGELOG.md
# Change Log
## [v2.3.2](https://github.com/feathersjs/feathers-sequelize/tree/v2.3.2) (2017-10-14)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v2.3.1...v2.3.2)
## [v2.4.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.4.0) (2017-11-06)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.3.2...v2.4.0)
**Merged pull requests:**
- Add option to not return modified entries for bulk updates [\#173](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/173) ([MichaelErmer](https://github.com/MichaelErmer))
- Disable count for find without pagination [\#172](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/172) ([MichaelErmer](https://github.com/MichaelErmer))
## [v2.3.2](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.3.2) (2017-10-14)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.3.1...v2.3.2)
**Closed issues:**
- The patch on postgres is selecting every row from the table before updating [\#168](https://github.com/feathersjs/feathers-sequelize/issues/168)
- Can't override id field when declaring a \(MySQL\) service [\#164](https://github.com/feathersjs/feathers-sequelize/issues/164)
- Run tests against all sequelize dialects [\#163](https://github.com/feathersjs/feathers-sequelize/issues/163)
- Adding model includes returns incorrect paging count [\#161](https://github.com/feathersjs/feathers-sequelize/issues/161)
- Raw associations prevent pagination total being available [\#137](https://github.com/feathersjs/feathers-sequelize/issues/137)
- update not working? [\#125](https://github.com/feathersjs/feathers-sequelize/issues/125)
- The patch on postgres is selecting every row from the table before updating [\#168](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/168)
- Can't override id field when declaring a \(MySQL\) service [\#164](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/164)
- Run tests against all sequelize dialects [\#163](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/163)
- Adding model includes returns incorrect paging count [\#161](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/161)
- Raw associations prevent pagination total being available [\#137](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/137)
- update not working? [\#125](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/125)
**Merged pull requests:**
- Fixed the patch method to not fetch all rows [\#169](https://github.com/feathersjs/feathers-sequelize/pull/169) ([andymoon](https://github.com/andymoon))
- Update mocha to the latest version 🚀 [\#167](https://github.com/feathersjs/feathers-sequelize/pull/167) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Slightly better class for extending. [\#166](https://github.com/feathersjs/feathers-sequelize/pull/166) ([devel-pa](https://github.com/devel-pa))
- Fixed the patch method to not fetch all rows [\#169](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/169) ([andymoon](https://github.com/andymoon))
- Update mocha to the latest version 🚀 [\#167](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/167) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Slightly better class for extending. [\#166](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/166) ([devel-pa](https://github.com/devel-pa))
## [v2.3.1](https://github.com/feathersjs/feathers-sequelize/tree/v2.3.1) (2017-09-06)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v2.3.0...v2.3.1)
## [v2.3.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.3.1) (2017-09-06)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.3.0...v2.3.1)
**Closed issues:**
- \[Question\] Should new tests be using Postgres or SQLite or both? [\#154](https://github.com/feathersjs/feathers-sequelize/issues/154)
- Multiple rows delete [\#153](https://github.com/feathersjs/feathers-sequelize/issues/153)
- \[Question\] Should new tests be using Postgres or SQLite or both? [\#154](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/154)
- Multiple rows delete [\#153](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/153)
**Merged pull requests:**
- Tests and fixes [\#162](https://github.com/feathersjs/feathers-sequelize/pull/162) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- Extend test coverage [\#160](https://github.com/feathersjs/feathers-sequelize/pull/160) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- Tests and fixes [\#162](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/162) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- Extend test coverage [\#160](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/160) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
## [v2.3.0](https://github.com/feathersjs/feathers-sequelize/tree/v2.3.0) (2017-08-19)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v2.2.1...v2.3.0)
## [v2.3.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.3.0) (2017-08-19)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.2.1...v2.3.0)
**Closed issues:**
- use inside php server [\#151](https://github.com/feathersjs/feathers-sequelize/issues/151)
- Patch returns Model instance by default [\#146](https://github.com/feathersjs/feathers-sequelize/issues/146)
- Run tests against PostgreSQL [\#105](https://github.com/feathersjs/feathers-sequelize/issues/105)
- Avoid findAndCount if paginate is false [\#95](https://github.com/feathersjs/feathers-sequelize/issues/95)
- use inside php server [\#151](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/151)
- Patch returns Model instance by default [\#146](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/146)
- Run tests against PostgreSQL [\#105](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/105)
- Avoid findAndCount if paginate is false [\#95](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/95)
**Merged pull requests:**
- Finalize running tests against Postgresql [\#152](https://github.com/feathersjs/feathers-sequelize/pull/152) ([daffl](https://github.com/daffl))
- Fix postgres tests [\#150](https://github.com/feathersjs/feathers-sequelize/pull/150) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- Finalize running tests against Postgresql [\#152](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/152) ([daffl](https://github.com/daffl))
- Fix postgres tests [\#150](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/150) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
## [v2.2.1](https://github.com/feathersjs/feathers-sequelize/tree/v2.2.1) (2017-08-08)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v2.2.0...v2.2.1)
## [v2.2.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.2.1) (2017-08-08)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.2.0...v2.2.1)
**Closed issues:**
- All service methods should take into account the query parameter [\#143](https://github.com/feathersjs/feathers-sequelize/issues/143)
- All service methods should take into account the query parameter [\#143](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/143)
**Merged pull requests:**
- Patch should default to raw queries [\#147](https://github.com/feathersjs/feathers-sequelize/pull/147) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- Fixing broken docs links [\#144](https://github.com/feathersjs/feathers-sequelize/pull/144) ([corymsmith](https://github.com/corymsmith))
- Patch should default to raw queries [\#147](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/147) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- Fixing broken docs links [\#144](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/144) ([corymsmith](https://github.com/corymsmith))
## [v2.2.0](https://github.com/feathersjs/feathers-sequelize/tree/v2.2.0) (2017-07-24)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v2.1.0...v2.2.0)
## [v2.2.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.2.0) (2017-07-24)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.1.0...v2.2.0)
**Closed issues:**
- Is there any full example about database relationship? [\#141](https://github.com/feathersjs/feathers-sequelize/issues/141)
- Query fails when using the $contains operator with a single value [\#135](https://github.com/feathersjs/feathers-sequelize/issues/135)
- Allow scope\(\) to be used for operations [\#130](https://github.com/feathersjs/feathers-sequelize/issues/130)
- Is there any full example about database relationship? [\#141](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/141)
- Query fails when using the $contains operator with a single value [\#135](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/135)
- Allow scope\(\) to be used for operations [\#130](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/130)
**Merged pull requests:**
- Adding ability to scope operations [\#142](https://github.com/feathersjs/feathers-sequelize/pull/142) ([bparise](https://github.com/bparise))
- Adding ability to scope operations [\#142](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/142) ([bparise](https://github.com/bparise))
## [v2.1.0](https://github.com/feathersjs/feathers-sequelize/tree/v2.1.0) (2017-07-13)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v2.0.1...v2.1.0)
## [v2.1.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.1.0) (2017-07-13)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.0.1...v2.1.0)
**Closed issues:**
- Hydrate is not compatible with Sequelize 4.x [\#138](https://github.com/feathersjs/feathers-sequelize/issues/138)
- Update only one parameter in row [\#136](https://github.com/feathersjs/feathers-sequelize/issues/136)
- Hook Includes not working [\#134](https://github.com/feathersjs/feathers-sequelize/issues/134)
- Hydrate not being exported correctly [\#133](https://github.com/feathersjs/feathers-sequelize/issues/133)
- An in-range update of feathers-rest is breaking the build 🚨 [\#132](https://github.com/feathersjs/feathers-sequelize/issues/132)
- No record found [\#128](https://github.com/feathersjs/feathers-sequelize/issues/128)
- many to many \(through model, with extra field in junction table\) error "\<Model1\> is not associated to \<Model2\>" [\#126](https://github.com/feathersjs/feathers-sequelize/issues/126)
- find total is always zero when raw is false [\#118](https://github.com/feathersjs/feathers-sequelize/issues/118)
- N:N relation using React Native [\#109](https://github.com/feathersjs/feathers-sequelize/issues/109)
- Hydrate is not compatible with Sequelize 4.x [\#138](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/138)
- Update only one parameter in row [\#136](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/136)
- Hook Includes not working [\#134](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/134)
- Hydrate not being exported correctly [\#133](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/133)
- An in-range update of feathers-rest is breaking the build 🚨 [\#132](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/132)
- No record found [\#128](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/128)
- many to many \(through model, with extra field in junction table\) error "\<Model1\> is not associated to \<Model2\>" [\#126](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/126)
- find total is always zero when raw is false [\#118](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/118)
- N:N relation using React Native [\#109](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/109)
**Merged pull requests:**
- Add compatibility for documented hydration hook imports [\#140](https://github.com/feathersjs/feathers-sequelize/pull/140) ([daffl](https://github.com/daffl))
- fix\(hydrate\): Fix the factory function so that Sequelize 4.x is supported [\#139](https://github.com/feathersjs/feathers-sequelize/pull/139) ([dschnare](https://github.com/dschnare))
- Update sequelize to the latest version 🚀 [\#123](https://github.com/feathersjs/feathers-sequelize/pull/123) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Add compatibility for documented hydration hook imports [\#140](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/140) ([daffl](https://github.com/daffl))
- fix\(hydrate\): Fix the factory function so that Sequelize 4.x is supported [\#139](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/139) ([dschnare](https://github.com/dschnare))
- Update sequelize to the latest version 🚀 [\#123](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/123) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
## [v2.0.1](https://github.com/feathersjs/feathers-sequelize/tree/v2.0.1) (2017-06-09)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v2.0.0...v2.0.1)
## [v2.0.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.0.1) (2017-06-09)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v2.0.0...v2.0.1)
**Closed issues:**
- Allow custom primary keys [\#122](https://github.com/feathersjs/feathers-sequelize/issues/122)
- Investigate issue where getters, setters not being called [\#116](https://github.com/feathersjs/feathers-sequelize/issues/116)
- Model.create ignoring field and virtual setters [\#113](https://github.com/feathersjs/feathers-sequelize/issues/113)
- An in-range update of feathers is breaking the build 🚨 [\#112](https://github.com/feathersjs/feathers-sequelize/issues/112)
- Using `include` breaks the find method query [\#111](https://github.com/feathersjs/feathers-sequelize/issues/111)
- An in-range update of feathers-errors is breaking the build 🚨 [\#110](https://github.com/feathersjs/feathers-sequelize/issues/110)
- Add `lean` attribute to automatically call toJSON? [\#19](https://github.com/feathersjs/feathers-sequelize/issues/19)
- Add a toJSON bundled hook like mongoose [\#18](https://github.com/feathersjs/feathers-sequelize/issues/18)
- Allow custom primary keys [\#122](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/122)
- Investigate issue where getters, setters not being called [\#116](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/116)
- Model.create ignoring field and virtual setters [\#113](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/113)
- An in-range update of feathers is breaking the build 🚨 [\#112](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/112)
- Using `include` breaks the find method query [\#111](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/111)
- An in-range update of feathers-errors is breaking the build 🚨 [\#110](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/110)
- Add `lean` attribute to automatically call toJSON? [\#19](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/19)
- Add a toJSON bundled hook like mongoose [\#18](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/18)
**Merged pull requests:**
- Fix issue with custom ID when using eager loading [\#124](https://github.com/feathersjs/feathers-sequelize/pull/124) ([DesignByOnyx](https://github.com/DesignByOnyx))
- Update chai to the latest version 🚀 [\#120](https://github.com/feathersjs/feathers-sequelize/pull/120) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Issue \#113: Model.create ignoring field and virtual setters [\#114](https://github.com/feathersjs/feathers-sequelize/pull/114) ([buske](https://github.com/buske))
- Fix issue with custom ID when using eager loading [\#124](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/124) ([DesignByOnyx](https://github.com/DesignByOnyx))
- Update chai to the latest version 🚀 [\#120](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/120) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Issue \#113: Model.create ignoring field and virtual setters [\#114](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/114) ([buske](https://github.com/buske))
## [v2.0.0](https://github.com/feathersjs/feathers-sequelize/tree/v2.0.0) (2017-05-03)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.4.5...v2.0.0)
## [v2.0.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v2.0.0) (2017-05-03)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.4.5...v2.0.0)
**Closed issues:**
- update\(\) breaks when sequelize configured with raw:true [\#99](https://github.com/feathersjs/feathers-sequelize/issues/99)
- Discuss querying of NULL values [\#96](https://github.com/feathersjs/feathers-sequelize/issues/96)
- update\(\) breaks when sequelize configured with raw:true [\#99](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/99)
- Discuss querying of NULL values [\#96](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/96)
**Merged pull requests:**
- Update all methods to return plain JS objects [\#106](https://github.com/feathersjs/feathers-sequelize/pull/106) ([DesignByOnyx](https://github.com/DesignByOnyx))
- Fixed return value of patch method for postgresql dialect [\#104](https://github.com/feathersjs/feathers-sequelize/pull/104) ([msimulcik](https://github.com/msimulcik))
- Update semistandard to the latest version 🚀 [\#103](https://github.com/feathersjs/feathers-sequelize/pull/103) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Update dependencies to enable Greenkeeper 🌴 [\#102](https://github.com/feathersjs/feathers-sequelize/pull/102) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Update all methods to return plain JS objects [\#106](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/106) ([DesignByOnyx](https://github.com/DesignByOnyx))
- Fixed return value of patch method for postgresql dialect [\#104](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/104) ([msimulcik](https://github.com/msimulcik))
- Update semistandard to the latest version 🚀 [\#103](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/103) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
- Update dependencies to enable Greenkeeper 🌴 [\#102](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/102) ([greenkeeper[bot]](https://github.com/apps/greenkeeper))
## [v1.4.5](https://github.com/feathersjs/feathers-sequelize/tree/v1.4.5) (2017-03-26)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.4.4...v1.4.5)
## [v1.4.5](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.4.5) (2017-03-26)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.4.4...v1.4.5)
**Merged pull requests:**
- Fix update no dao [\#101](https://github.com/feathersjs/feathers-sequelize/pull/101) ([lowip](https://github.com/lowip))
- Fix update no dao [\#101](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/101) ([lowip](https://github.com/lowip))
## [v1.4.4](https://github.com/feathersjs/feathers-sequelize/tree/v1.4.4) (2017-03-24)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.4.3...v1.4.4)
## [v1.4.4](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.4.4) (2017-03-24)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.4.3...v1.4.4)
**Closed issues:**
- Relation between Models not working. [\#98](https://github.com/feathersjs/feathers-sequelize/issues/98)
- Can we create nested models in one go? [\#97](https://github.com/feathersjs/feathers-sequelize/issues/97)
- Add example for model relations [\#20](https://github.com/feathersjs/feathers-sequelize/issues/20)
- Relation between Models not working. [\#98](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/98)
- Can we create nested models in one go? [\#97](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/97)
- Add example for model relations [\#20](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/20)
**Merged pull requests:**
- checking for the toJSON method on the instance before calling it [\#100](https://github.com/feathersjs/feathers-sequelize/pull/100) ([lowip](https://github.com/lowip))
- checking for the toJSON method on the instance before calling it [\#100](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/100) ([lowip](https://github.com/lowip))
## [v1.4.3](https://github.com/feathersjs/feathers-sequelize/tree/v1.4.3) (2017-03-17)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.4.2...v1.4.3)
## [v1.4.3](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.4.3) (2017-03-17)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.4.2...v1.4.3)
**Merged pull requests:**
- use 'returning: true' for postgres to keep patch and its response atomic [\#93](https://github.com/feathersjs/feathers-sequelize/pull/93) ([MichaelErmer](https://github.com/MichaelErmer))
- use 'returning: true' for postgres to keep patch and its response atomic [\#93](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/93) ([MichaelErmer](https://github.com/MichaelErmer))
## [v1.4.2](https://github.com/feathersjs/feathers-sequelize/tree/v1.4.2) (2017-03-14)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.4.1...v1.4.2)
## [v1.4.2](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.4.2) (2017-03-14)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.4.1...v1.4.2)
**Merged pull requests:**
- Fixed missing where clause [\#92](https://github.com/feathersjs/feathers-sequelize/pull/92) ([eikaramba](https://github.com/eikaramba))
- Fixed missing where clause [\#92](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/92) ([eikaramba](https://github.com/eikaramba))
## [v1.4.1](https://github.com/feathersjs/feathers-sequelize/tree/v1.4.1) (2017-03-10)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.4.0...v1.4.1)
## [v1.4.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.4.1) (2017-03-10)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.4.0...v1.4.1)
**Closed issues:**
- $populate does not seem to work [\#89](https://github.com/feathersjs/feathers-sequelize/issues/89)
- updated\_at column does not get updated at PATCH request [\#88](https://github.com/feathersjs/feathers-sequelize/issues/88)
- Suggested pattern to create a multi model service [\#86](https://github.com/feathersjs/feathers-sequelize/issues/86)
- GroupBy issue [\#84](https://github.com/feathersjs/feathers-sequelize/issues/84)
- Concat and other sequelize functions [\#81](https://github.com/feathersjs/feathers-sequelize/issues/81)
- Solved: How to add relationship [\#80](https://github.com/feathersjs/feathers-sequelize/issues/80)
- Consider creating a sequelize instance during updates: [\#63](https://github.com/feathersjs/feathers-sequelize/issues/63)
- $populate does not seem to work [\#89](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/89)
- updated\_at column does not get updated at PATCH request [\#88](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/88)
- Suggested pattern to create a multi model service [\#86](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/86)
- GroupBy issue [\#84](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/84)
- Concat and other sequelize functions [\#81](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/81)
- Solved: How to add relationship [\#80](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/80)
- Consider creating a sequelize instance during updates: [\#63](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/63)
**Merged pull requests:**
- Enable eager-loading for GET endpoint [\#91](https://github.com/feathersjs/feathers-sequelize/pull/91) ([eikaramba](https://github.com/eikaramba))
- Update index.js [\#83](https://github.com/feathersjs/feathers-sequelize/pull/83) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- doc: fix README.md comment. [\#82](https://github.com/feathersjs/feathers-sequelize/pull/82) ([omeid](https://github.com/omeid))
- Enable eager-loading for GET endpoint [\#91](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/91) ([eikaramba](https://github.com/eikaramba))
- Update index.js [\#83](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/83) ([Ryanthegiantlion](https://github.com/Ryanthegiantlion))
- doc: fix README.md comment. [\#82](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/82) ([omeid](https://github.com/omeid))
## [v1.4.0](https://github.com/feathersjs/feathers-sequelize/tree/v1.4.0) (2016-11-11)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.3.3...v1.4.0)
## [v1.4.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.4.0) (2016-11-11)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.3.3...v1.4.0)
**Closed issues:**
- TypeError: Cannot read property '2' of null [\#71](https://github.com/feathersjs/feathers-sequelize/issues/71)
- ES6/Babel [\#68](https://github.com/feathersjs/feathers-sequelize/issues/68)
- TypeError: Cannot read property '2' of null [\#71](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/71)
- ES6/Babel [\#68](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/68)
**Merged pull requests:**
- Update feathers-service-tests to version 0.9.0 🚀 [\#79](https://github.com/feathersjs/feathers-sequelize/pull/79) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- sequelize@3.25.0 breaks build 🚨 [\#78](https://github.com/feathersjs/feathers-sequelize/pull/78) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- sequelize@3.24.8 breaks build 🚨 [\#77](https://github.com/feathersjs/feathers-sequelize/pull/77) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#76](https://github.com/feathersjs/feathers-sequelize/pull/76) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- babel-preset-es2015@6.18.0 breaks build 🚨 [\#75](https://github.com/feathersjs/feathers-sequelize/pull/75) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- jshint —\> semistandard [\#72](https://github.com/feathersjs/feathers-sequelize/pull/72) ([corymsmith](https://github.com/corymsmith))
- Update feathers-service-tests to version 0.9.0 🚀 [\#79](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/79) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- sequelize@3.25.0 breaks build 🚨 [\#78](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/78) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- sequelize@3.24.8 breaks build 🚨 [\#77](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/77) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#76](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/76) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- babel-preset-es2015@6.18.0 breaks build 🚨 [\#75](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/75) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- jshint —\> semistandard [\#72](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/72) ([corymsmith](https://github.com/corymsmith))
## [v1.3.3](https://github.com/feathersjs/feathers-sequelize/tree/v1.3.3) (2016-09-28)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.3.2...v1.3.3)
## [v1.3.3](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.3.3) (2016-09-28)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.3.2...v1.3.3)
**Merged pull requests:**
- Update service tests, id and events option [\#65](https://github.com/feathersjs/feathers-sequelize/pull/65) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Update service tests, id and events option [\#65](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/65) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
## [v1.3.2](https://github.com/feathersjs/feathers-sequelize/tree/v1.3.2) (2016-08-25)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.3.1...v1.3.2)
## [v1.3.2](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.3.2) (2016-08-25)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.3.1...v1.3.2)
**Closed issues:**
- Cannot call remove service method when id field name is custom [\#60](https://github.com/feathersjs/feathers-sequelize/issues/60)
- Make params optional [\#59](https://github.com/feathersjs/feathers-sequelize/issues/59)
- Exporting utils.js [\#58](https://github.com/feathersjs/feathers-sequelize/issues/58)
- Cannot call remove service method when id field name is custom [\#60](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/60)
- Make params optional [\#59](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/59)
- Exporting utils.js [\#58](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/58)
**Merged pull requests:**
- Use correct id property when removing items [\#62](https://github.com/feathersjs/feathers-sequelize/pull/62) ([daffl](https://github.com/daffl))
- Update mocha to version 3.0.0 🚀 [\#57](https://github.com/feathersjs/feathers-sequelize/pull/57) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Use correct id property when removing items [\#62](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/62) ([daffl](https://github.com/daffl))
- Update mocha to version 3.0.0 🚀 [\#57](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/57) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
## [v1.3.1](https://github.com/feathersjs/feathers-sequelize/tree/v1.3.1) (2016-07-20)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.3.0...v1.3.1)
## [v1.3.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.3.1) (2016-07-20)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.3.0...v1.3.1)
**Merged pull requests:**
- sequelize@3.23.6 breaks build 🚨 [\#54](https://github.com/feathersjs/feathers-sequelize/pull/54) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Update feathers-query-filters to version 2.0.0 🚀 [\#51](https://github.com/feathersjs/feathers-sequelize/pull/51) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- sequelize@3.23.6 breaks build 🚨 [\#54](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/54) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Update feathers-query-filters to version 2.0.0 🚀 [\#51](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/51) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
## [v1.3.0](https://github.com/feathersjs/feathers-sequelize/tree/v1.3.0) (2016-07-08)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.2.0...v1.3.0)
## [v1.3.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.3.0) (2016-07-08)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.2.0...v1.3.0)
**Fixed bugs:**
- We shouldn't remove properties from original objects [\#49](https://github.com/feathersjs/feathers-sequelize/issues/49)
- We shouldn't remove properties from original objects [\#49](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/49)
**Merged pull requests:**
- feathers-service-tests@0.6.1 breaks build 🚨 [\#50](https://github.com/feathersjs/feathers-sequelize/pull/50) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- feathers-service-tests@0.6.1 breaks build 🚨 [\#50](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/50) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
## [v1.2.0](https://github.com/feathersjs/feathers-sequelize/tree/v1.2.0) (2016-06-17)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.1.6...v1.2.0)
## [v1.2.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.2.0) (2016-06-17)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.1.6...v1.2.0)
**Merged pull requests:**
- Update feathers-service-tests to version 0.6.0 🚀 [\#48](https://github.com/feathersjs/feathers-sequelize/pull/48) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Update feathers-service-tests to version 0.6.0 🚀 [\#48](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/48) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
## [v1.1.6](https://github.com/feathersjs/feathers-sequelize/tree/v1.1.6) (2016-06-15)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.1.5...v1.1.6)
## [v1.1.6](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.1.6) (2016-06-15)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.1.5...v1.1.6)
**Closed issues:**
- TypeError: Cannot read property '$nin' of undefined [\#45](https://github.com/feathersjs/feathers-sequelize/issues/45)
- TypeError: Cannot read property '$nin' of undefined [\#45](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/45)
**Merged pull requests:**
- Allow querying for null values [\#47](https://github.com/feathersjs/feathers-sequelize/pull/47) ([daffl](https://github.com/daffl))
- Allow querying for null values [\#47](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/47) ([daffl](https://github.com/daffl))
## [v1.1.5](https://github.com/feathersjs/feathers-sequelize/tree/v1.1.5) (2016-06-10)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.1.4...v1.1.5)
## [v1.1.5](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.1.5) (2016-06-10)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.1.4...v1.1.5)
**Closed issues:**
- Custom id column name [\#40](https://github.com/feathersjs/feathers-sequelize/issues/40)
- Find\(\) generates an invalid query with pagination but no order. [\#39](https://github.com/feathersjs/feathers-sequelize/issues/39)
- Private method \_get\(\) not processing parameters [\#22](https://github.com/feathersjs/feathers-sequelize/issues/22)
- Support $search [\#15](https://github.com/feathersjs/feathers-sequelize/issues/15)
- Custom id column name [\#40](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/40)
- Find\(\) generates an invalid query with pagination but no order. [\#39](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/39)
- Private method \_get\(\) not processing parameters [\#22](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/22)
- Support $search [\#15](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/15)
**Merged pull requests:**
- Pass sequelize parameters to findById [\#46](https://github.com/feathersjs/feathers-sequelize/pull/46) ([daffl](https://github.com/daffl))
- mocha@2.5.0 breaks build 🚨 [\#41](https://github.com/feathersjs/feathers-sequelize/pull/41) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Update babel-plugin-add-module-exports to version 0.2.0 🚀 [\#38](https://github.com/feathersjs/feathers-sequelize/pull/38) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- feathers-rest@1.3.0 breaks build 🚨 [\#34](https://github.com/feathersjs/feathers-sequelize/pull/34) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Pass sequelize parameters to findById [\#46](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/46) ([daffl](https://github.com/daffl))
- mocha@2.5.0 breaks build 🚨 [\#41](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/41) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- Update babel-plugin-add-module-exports to version 0.2.0 🚀 [\#38](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/38) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
- feathers-rest@1.3.0 breaks build 🚨 [\#34](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/34) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot))
## [v1.1.4](https://github.com/feathersjs/feathers-sequelize/tree/v1.1.4) (2016-03-10)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.1.3...v1.1.4)
## [v1.1.4](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.1.4) (2016-03-10)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.1.3...v1.1.4)
**Closed issues:**
- Create method should support options param [\#25](https://github.com/feathersjs/feathers-sequelize/issues/25)
- Create method should support options param [\#25](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/25)
**Merged pull requests:**
- adding support for sequelize options [\#27](https://github.com/feathersjs/feathers-sequelize/pull/27) ([ekryski](https://github.com/ekryski))
- adding support for sequelize options [\#27](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/27) ([ekryski](https://github.com/ekryski))
## [v1.1.3](https://github.com/feathersjs/feathers-sequelize/tree/v1.1.3) (2016-03-09)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.1.2...v1.1.3)
## [v1.1.3](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.1.3) (2016-03-09)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.1.2...v1.1.3)
**Closed issues:**
- Hook result data shouldn't have sequelize info [\#24](https://github.com/feathersjs/feathers-sequelize/issues/24)
- Service methods should reject with feathers error instance rather throwing in-place [\#23](https://github.com/feathersjs/feathers-sequelize/issues/23)
- When i need force sync? [\#21](https://github.com/feathersjs/feathers-sequelize/issues/21)
- How to retrieve records for a many to many relationship? [\#16](https://github.com/feathersjs/feathers-sequelize/issues/16)
- Hook result data shouldn't have sequelize info [\#24](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/24)
- Service methods should reject with feathers error instance rather throwing in-place [\#23](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/23)
- When i need force sync? [\#21](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/21)
- How to retrieve records for a many to many relationship? [\#16](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/16)
**Merged pull requests:**
- Options param support for create method [\#26](https://github.com/feathersjs/feathers-sequelize/pull/26) ([rafalszemraj](https://github.com/rafalszemraj))
- Options param support for create method [\#26](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/26) ([rafalszemraj](https://github.com/rafalszemraj))
## [v1.1.2](https://github.com/feathersjs/feathers-sequelize/tree/v1.1.2) (2016-02-24)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.1.1...v1.1.2)
## [v1.1.2](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.1.2) (2016-02-24)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.1.1...v1.1.2)
**Closed issues:**
- How do you retrieve associations in the response? [\#12](https://github.com/feathersjs/feathers-sequelize/issues/12)
- How do you retrieve associations in the response? [\#12](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/12)
**Merged pull requests:**
- bumping feathers-errors version [\#17](https://github.com/feathersjs/feathers-sequelize/pull/17) ([ekryski](https://github.com/ekryski))
- bumping feathers-errors version [\#17](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/17) ([ekryski](https://github.com/ekryski))
## [v1.1.1](https://github.com/feathersjs/feathers-sequelize/tree/v1.1.1) (2016-02-02)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.1.0...v1.1.1)
## [v1.1.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.1.1) (2016-02-02)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.1.0...v1.1.1)
**Merged pull requests:**
- Add options to find query [\#14](https://github.com/feathersjs/feathers-sequelize/pull/14) ([lionelrudaz](https://github.com/lionelrudaz))
- Add options to find query [\#14](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/14) ([lionelrudaz](https://github.com/lionelrudaz))
## [v1.1.0](https://github.com/feathersjs/feathers-sequelize/tree/v1.1.0) (2016-01-30)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.10...v1.1.0)
## [v1.1.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.1.0) (2016-01-30)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.10...v1.1.0)
**Closed issues:**
- How to add the model name in the REST response [\#11](https://github.com/feathersjs/feathers-sequelize/issues/11)
- Review patch and remove many for consistency [\#8](https://github.com/feathersjs/feathers-sequelize/issues/8)
- How to add the model name in the REST response [\#11](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/11)
- Review patch and remove many for consistency [\#8](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/8)
**Merged pull requests:**
- Use internal methods instead of service methods directly [\#13](https://github.com/feathersjs/feathers-sequelize/pull/13) ([daffl](https://github.com/daffl))
- Use internal methods instead of service methods directly [\#13](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/13) ([daffl](https://github.com/daffl))
## [v1.0.10](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.10) (2016-01-24)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.9...v1.0.10)
## [v1.0.10](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.10) (2016-01-24)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.9...v1.0.10)
**Merged pull requests:**
- Adding nsp check [\#10](https://github.com/feathersjs/feathers-sequelize/pull/10) ([marshallswain](https://github.com/marshallswain))
- Adding nsp check [\#10](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/10) ([marshallswain](https://github.com/marshallswain))
## [v1.0.9](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.9) (2016-01-11)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.8...v1.0.9)
## [v1.0.9](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.9) (2016-01-11)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.8...v1.0.9)
**Merged pull requests:**
- added value conversion for $sort to utils `getOrder` [\#9](https://github.com/feathersjs/feathers-sequelize/pull/9) ([startupthekid](https://github.com/startupthekid))
- added value conversion for $sort to utils `getOrder` [\#9](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/9) ([startupthekid](https://github.com/startupthekid))
## [v1.0.8](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.8) (2016-01-09)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.7...v1.0.8)
## [v1.0.8](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.8) (2016-01-09)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.7...v1.0.8)
**Merged pull requests:**
- Use Model.findById\(\) rather than get\(\) [\#7](https://github.com/feathersjs/feathers-sequelize/pull/7) ([evanbarter](https://github.com/evanbarter))
- Use Model.findById\(\) rather than get\(\) [\#7](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/7) ([evanbarter](https://github.com/evanbarter))
## [v1.0.7](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.7) (2016-01-06)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.6...v1.0.7)
## [v1.0.7](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.7) (2016-01-06)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.6...v1.0.7)
**Closed issues:**
- Expose Sequelize lib [\#6](https://github.com/feathersjs/feathers-sequelize/issues/6)
- Expose Sequelize lib [\#6](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/6)
## [v1.0.6](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.6) (2015-12-29)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.5...v1.0.6)
## [v1.0.6](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.6) (2015-12-29)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.5...v1.0.6)
## [v1.0.5](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.5) (2015-12-21)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.4...v1.0.5)
## [v1.0.5](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.5) (2015-12-21)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.4...v1.0.5)
## [v1.0.4](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.4) (2015-12-21)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.3...v1.0.4)
## [v1.0.4](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.4) (2015-12-21)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.3...v1.0.4)
## [v1.0.3](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.3) (2015-12-21)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.2...v1.0.3)
## [v1.0.3](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.3) (2015-12-21)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.2...v1.0.3)
## [v1.0.2](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.2) (2015-12-21)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.1...v1.0.2)
## [v1.0.2](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.2) (2015-12-21)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.1...v1.0.2)
## [v1.0.1](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.1) (2015-12-19)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v1.0.0...v1.0.1)
## [v1.0.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.1) (2015-12-19)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v1.0.0...v1.0.1)
## [v1.0.0](https://github.com/feathersjs/feathers-sequelize/tree/v1.0.0) (2015-12-19)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v0.2.1...v1.0.0)
## [v1.0.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v1.0.0) (2015-12-19)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v0.2.1...v1.0.0)
**Merged pull requests:**
- Error mapping [\#5](https://github.com/feathersjs/feathers-sequelize/pull/5) ([ekryski](https://github.com/ekryski))
- Error mapping [\#5](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/5) ([ekryski](https://github.com/ekryski))
## [v0.2.1](https://github.com/feathersjs/feathers-sequelize/tree/v0.2.1) (2015-12-18)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v0.2.0...v0.2.1)
## [v0.2.1](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v0.2.1) (2015-12-18)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v0.2.0...v0.2.1)
**Closed issues:**
- only one instance of babel-polyfill is allowed [\#3](https://github.com/feathersjs/feathers-sequelize/issues/3)
- only one instance of babel-polyfill is allowed [\#3](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/3)
**Merged pull requests:**
- load babel-polyfill only once [\#4](https://github.com/feathersjs/feathers-sequelize/pull/4) ([jgillich](https://github.com/jgillich))
- load babel-polyfill only once [\#4](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/4) ([jgillich](https://github.com/jgillich))
## [v0.2.0](https://github.com/feathersjs/feathers-sequelize/tree/v0.2.0) (2015-12-13)
[Full Changelog](https://github.com/feathersjs/feathers-sequelize/compare/v0.1.0...v0.2.0)
## [v0.2.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v0.2.0) (2015-12-13)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sequelize/compare/v0.1.0...v0.2.0)
**Closed issues:**
- Take a look at feathers-orm-service which uses sequelize [\#1](https://github.com/feathersjs/feathers-sequelize/issues/1)
- Take a look at feathers-orm-service which uses sequelize [\#1](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/1)
**Merged pull requests:**
- Migration to ES6 classes and Promises, support for pagination [\#2](https://github.com/feathersjs/feathers-sequelize/pull/2) ([daffl](https://github.com/daffl))
- Migration to ES6 classes and Promises, support for pagination [\#2](https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/2) ([daffl](https://github.com/daffl))
## [v0.1.0](https://github.com/feathersjs/feathers-sequelize/tree/v0.1.0) (2015-11-23)
## [v0.1.0](https://github.com/feathersjs-ecosystem/feathers-sequelize/tree/v0.1.0) (2015-11-23)
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

@@ -1,7 +0,2 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var serialize = function serialize(item) {
const serialize = (item) => {
if (typeof item.toJSON === 'function') {

@@ -13,3 +8,3 @@ return item.toJSON();

exports.default = function () {
module.exports = () => {
return function (hook) {

@@ -42,3 +37,1 @@ switch (hook.method) {

};
module.exports = exports['default'];

@@ -1,17 +0,12 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var factory = function factory(Model) {
var include = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
return function (item) {
const factory = (Model, include = null) => {
return item => {
// (Darren): We have to check that the Model.Instance static property exists
// first since it's been deprecated in Sequelize 4.x.
// See: http://docs.sequelizejs.com/manual/tutorial/upgrade-to-v4.html
var shouldBuild = Model.Instance ? !(item instanceof Model.Instance) : !(item instanceof Model);
const shouldBuild = Model.Instance
? !(item instanceof Model.Instance)
: !(item instanceof Model);
if (shouldBuild) {
return Model.build(item, { isNewRecord: false, include: include });
return Model.build(item, { isNewRecord: false, include });
}

@@ -23,3 +18,3 @@

exports.default = function (options) {
module.exports = options => {
options = options || {};

@@ -32,3 +27,3 @@

var makeInstance = factory(this.Model, options.include);
const makeInstance = factory(this.Model, options.include);
switch (hook.method) {

@@ -60,3 +55,1 @@ case 'find':

};
module.exports = exports['default'];

@@ -1,47 +0,10 @@

'use strict';
const omit = require('lodash.omit');
const Proto = require('uberproto');
const errors = require('@feathersjs/errors');
const { select, filterQuery } = require('@feathersjs/commons');
Object.defineProperty(exports, "__esModule", {
value: true
});
const utils = require('./utils');
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = init;
var _lodash = require('lodash.omit');
var _lodash2 = _interopRequireDefault(_lodash);
var _uberproto = require('uberproto');
var _uberproto2 = _interopRequireDefault(_uberproto);
var _feathersQueryFilters = require('feathers-query-filters');
var _feathersQueryFilters2 = _interopRequireDefault(_feathersQueryFilters);
var _feathersErrors = require('feathers-errors');
var _feathersErrors2 = _interopRequireDefault(_feathersErrors);
var _feathersCommons = require('feathers-commons');
var _utils = require('./utils');
var utils = _interopRequireWildcard(_utils);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Service = function () {
function Service(options) {
_classCallCheck(this, Service);
class Service {
constructor (options) {
if (!options) {

@@ -62,303 +25,269 @@ throw new Error('Sequelize options have to be provided');

_createClass(Service, [{
key: 'getModel',
value: function getModel(params) {
return this.Model;
getModel (params) {
return this.Model;
}
applyScope (params) {
if ((params.sequelize || {}).scope) {
return this.getModel(params).scope(params.sequelize.scope);
}
}, {
key: 'applyScope',
value: function applyScope(params) {
if ((params.sequelize || {}).scope) {
return this.getModel(params).scope(params.sequelize.scope);
}
return this.getModel(params);
}
}, {
key: 'extend',
value: function extend(obj) {
return _uberproto2.default.extend(obj, this);
}
}, {
key: '_find',
value: function _find(params) {
var getFilter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _feathersQueryFilters2.default;
var paginate = arguments[2];
return this.getModel(params);
}
var _getFilter = getFilter(params.query || {}),
filters = _getFilter.filters,
query = _getFilter.query;
extend (obj) {
return Proto.extend(obj, this);
}
var where = utils.getWhere(query);
var order = utils.getOrder(filters.$sort);
_find (params, getFilter = filterQuery, paginate) {
const { filters, query } = getFilter(params.query || {});
const where = utils.getWhere(query);
const order = utils.getOrder(filters.$sort);
var q = _extends({
where: where,
order: order,
limit: filters.$limit,
offset: filters.$skip,
raw: this.raw,
distinct: true
}, params.sequelize);
const q = Object.assign({
where,
order,
limit: filters.$limit,
offset: filters.$skip,
raw: this.raw,
distinct: true
}, params.sequelize);
if (filters.$select) {
q.attributes = filters.$select;
}
if (filters.$select) {
q.attributes = filters.$select;
}
var Model = this.applyScope(params);
let Model = this.applyScope(params);
// Until Sequelize fix all the findAndCount issues, a few 'hacks' are needed to get the total count correct
// Until Sequelize fix all the findAndCount issues, a few 'hacks' are needed to get the total count correct
// Adding an empty include changes the way the count is done
// See: https://github.com/sequelize/sequelize/blob/7e441a6a5ca44749acd3567b59b1d6ceb06ae64b/lib/model.js#L1780-L1782
q.include = q.include || [];
// Adding an empty include changes the way the count is done
// See: https://github.com/sequelize/sequelize/blob/7e441a6a5ca44749acd3567b59b1d6ceb06ae64b/lib/model.js#L1780-L1782
q.include = q.include || [];
// Non-raw is the default but setting it manually breaks paging
// See: https://github.com/sequelize/sequelize/issues/7931
if (q.raw === false) {
delete q.raw;
}
// Non-raw is the default but setting it manually breaks paging
// See: https://github.com/sequelize/sequelize/issues/7931
if (q.raw === false) {
delete q.raw;
}
if (paginate) {
return Model.findAndCountAll(q).then(function (result) {
return {
total: result.count,
limit: filters.$limit,
skip: filters.$skip || 0,
data: result.rows
};
}).catch(utils.errorHandler);
} else {
return Model.findAll(q).then(function (result) {
return {
data: result
};
}).catch(utils.errorHandler);
}
if (paginate) {
return Model.findAndCountAll(q).then(result => {
return {
total: result.count,
limit: filters.$limit,
skip: filters.$skip || 0,
data: result.rows
};
}).catch(utils.errorHandler);
} else {
return Model.findAll(q).then(result => {
return {
data: result
};
}).catch(utils.errorHandler);
}
}, {
key: 'find',
value: function find(params) {
var paginate = params && typeof params.paginate !== 'undefined' ? params.paginate : this.paginate;
var result = this._find(params, function (where) {
return (0, _feathersQueryFilters2.default)(where, paginate);
}, paginate);
}
if (!paginate.default) {
return result.then(function (page) {
return page.data;
});
}
find (params) {
const paginate = (params && typeof params.paginate !== 'undefined') ? params.paginate : this.paginate;
const result = this._find(params, where => filterQuery(where, paginate), paginate);
return result;
if (!paginate.default) {
return result.then(page => page.data);
}
}, {
key: '_get',
value: function _get(id, params) {
var where = utils.getWhere(params.query);
// Attach 'where' constraints, if any were used.
var q = _extends({
raw: this.raw,
where: _extends(_defineProperty({}, this.id, id), where)
}, params.sequelize);
return result;
}
var Model = this.applyScope(params);
_get (id, params) {
const where = utils.getWhere(params.query);
// findById calls findAll under the hood. We use findAll so that
// eager loading can be used without a separate code path.
return Model.findAll(q).then(function (result) {
if (result.length === 0) {
throw new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\'');
}
// Attach 'where' constraints, if any were used.
const q = Object.assign({
raw: this.raw,
where: Object.assign({[this.id]: id}, where)
}, params.sequelize);
return result[0];
}).then((0, _feathersCommons.select)(params, this.id)).catch(function (error) {
throw new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\'', error);
});
}
let Model = this.applyScope(params);
// returns either the model intance for an id or all unpaginated
// items for `params` if id is null
}, {
key: '_getOrFind',
value: function _getOrFind(id, params) {
if (id === null) {
return this._find(params).then(function (page) {
return page.data;
});
// findById calls findAll under the hood. We use findAll so that
// eager loading can be used without a separate code path.
return Model.findAll(q).then(result => {
if (result.length === 0) {
throw new errors.NotFound(`No record found for id '${id}'`);
}
return this._get(id, params);
return result[0];
})
.then(select(params, this.id))
.catch(error => {
throw new errors.NotFound(`No record found for id '${id}'`, error);
});
}
// returns either the model intance for an id or all unpaginated
// items for `params` if id is null
_getOrFind (id, params) {
if (id === null) {
return this._find(params).then(page => page.data);
}
}, {
key: 'get',
value: function get(id, params) {
return this._get(id, params).then((0, _feathersCommons.select)(params, this.id));
}
}, {
key: 'create',
value: function create(data, params) {
var _this = this;
var options = _extends({ raw: this.raw }, params.sequelize);
// Model.create's `raw` option is different from other methods.
// In order to use `raw` consistently to serialize the result,
// we need to shadow the Model.create use of raw, which we provide
// access to by specifying `ignoreSetters`.
var ignoreSetters = Boolean(options.ignoreSetters);
var createOptions = _extends({}, options, { raw: ignoreSetters });
var isArray = Array.isArray(data);
var promise = void 0;
return this._get(id, params);
}
var Model = this.applyScope(params);
get (id, params) {
return this._get(id, params).then(select(params, this.id));
}
create (data, params) {
const options = Object.assign({raw: this.raw}, params.sequelize);
// Model.create's `raw` option is different from other methods.
// In order to use `raw` consistently to serialize the result,
// we need to shadow the Model.create use of raw, which we provide
// access to by specifying `ignoreSetters`.
const ignoreSetters = Boolean(options.ignoreSetters);
const createOptions = Object.assign({}, options, {raw: ignoreSetters});
const isArray = Array.isArray(data);
let promise;
let Model = this.applyScope(params);
if (isArray) {
promise = Model.bulkCreate(data, createOptions);
} else {
promise = Model.create(data, createOptions);
}
return promise.then(result => {
const sel = select(params, this.id);
if (options.raw === false) {
return result;
}
if (isArray) {
promise = Model.bulkCreate(data, createOptions);
} else {
promise = Model.create(data, createOptions);
return result.map(item => sel(item.toJSON()));
}
return sel(result.toJSON());
}).catch(utils.errorHandler);
}
return promise.then(function (result) {
var sel = (0, _feathersCommons.select)(params, _this.id);
if (options.raw === false) {
return result;
}
if (isArray) {
return result.map(function (item) {
return sel(item.toJSON());
});
}
return sel(result.toJSON());
}).catch(utils.errorHandler);
patch (id, data, params) {
const where = Object.assign({}, filterQuery(params.query || {}).query);
const mapIds = page => page.data.map(current => current[this.id]);
if (id !== null) {
where[this.id] = id;
}
}, {
key: 'patch',
value: function patch(id, data, params) {
var _this2 = this;
var where = _extends({}, (0, _feathersQueryFilters2.default)(params.query || {}).query);
var mapIds = function mapIds(page) {
return page.data.map(function (current) {
return current[_this2.id];
});
};
const options = Object.assign({raw: this.raw}, params.sequelize, { where });
if (id !== null) {
where[this.id] = id;
}
let Model = this.applyScope(params);
var options = _extends({ raw: this.raw }, params.sequelize, { where: where });
// This is the best way to implement patch in sql, the other dialects 'should' use a transaction.
if (Model.sequelize.options.dialect === 'postgres' && params.$returning !== false) {
options.returning = true;
var Model = this.applyScope(params);
return this._getOrFind(id, params)
.then(results => this.getModel(params).update(omit(data, this.id), options))
.then(results => {
if (id === null) {
return results[1];
}
// This is the best way to implement patch in sql, the other dialects 'should' use a transaction.
if (Model.sequelize.options.dialect === 'postgres' && params.$returning !== false) {
options.returning = true;
if (!results[1].length) {
throw new errors.NotFound(`No record found for id '${id}'`);
}
return this._getOrFind(id, params).then(function (results) {
return _this2.getModel(params).update((0, _lodash2.default)(data, _this2.id), options);
}).then(function (results) {
if (id === null) {
return results[1];
}
return results[1][0];
})
.then(select(params, this.id))
.catch(utils.errorHandler);
}
if (!results[1].length) {
throw new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\'');
}
// By default we will just query for the one id. For multi patch
// we create a list of the ids of all items that will be changed
// to re-query them after the update
const ids = id === null ? this._find(params)
.then(mapIds) : Promise.resolve([ id ]);
return results[1][0];
}).then((0, _feathersCommons.select)(params, this.id)).catch(utils.errorHandler);
}
// By default we will just query for the one id. For multi patch
// we create a list of the ids of all items that will be changed
// to re-query them after the update
var ids = id === null ? this._find(params).then(mapIds) : Promise.resolve([id]);
return ids.then(function (idList) {
return ids
.then(idList => {
// Create a new query that re-queries all ids that
// were originally changed
var findParams = _extends({}, params, {
query: _defineProperty({}, _this2.id, { $in: idList })
const findParams = Object.assign({}, params, {
query: { [this.id]: { $in: idList } }
});
return Model.update((0, _lodash2.default)(data, _this2.id), options).then(function () {
if (params.$returning !== false) {
return _this2._getOrFind(id, findParams);
} else {
return Promise.resolve([]);
}
});
}).then((0, _feathersCommons.select)(params, this.id)).catch(utils.errorHandler);
return Model.update(omit(data, this.id), options)
.then(() => {
if (params.$returning !== false) {
return this._getOrFind(id, findParams);
} else {
return Promise.resolve([]);
}
});
})
.then(select(params, this.id))
.catch(utils.errorHandler);
}
update (id, data, params) {
const options = Object.assign({ raw: this.raw }, params.sequelize);
if (Array.isArray(data)) {
return Promise.reject(new errors.BadRequest('Not replacing multiple records. Did you mean `patch`?'));
}
}, {
key: 'update',
value: function update(id, data, params) {
var _this3 = this;
var options = _extends({ raw: this.raw }, params.sequelize);
// Force the {raw: false} option as the instance is needed to properly
// update
if (Array.isArray(data)) {
return Promise.reject(new _feathersErrors2.default.BadRequest('Not replacing multiple records. Did you mean `patch`?'));
return this._get(id, { sequelize: { raw: false } }).then(instance => {
if (!instance) {
throw new errors.NotFound(`No record found for id '${id}'`);
}
// Force the {raw: false} option as the instance is needed to properly
// update
return this._get(id, { sequelize: { raw: false } }).then(function (instance) {
if (!instance) {
throw new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\'');
let copy = {};
Object.keys(instance.toJSON()).forEach(key => {
if (typeof data[key] === 'undefined') {
copy[key] = null;
} else {
copy[key] = data[key];
}
});
var copy = {};
Object.keys(instance.toJSON()).forEach(function (key) {
if (typeof data[key] === 'undefined') {
copy[key] = null;
} else {
copy[key] = data[key];
}
});
return instance.update(copy, {raw: false}).then(() => this._get(id, {sequelize: options}));
})
.then(select(params, this.id))
.catch(utils.errorHandler);
}
return instance.update(copy, { raw: false }).then(function () {
return _this3._get(id, { sequelize: options });
});
}).then((0, _feathersCommons.select)(params, this.id)).catch(utils.errorHandler);
remove (id, params) {
const opts = Object.assign({ raw: this.raw }, params);
const where = Object.assign({}, filterQuery(params.query || {}).query);
if (id !== null) {
where[this.id] = id;
}
}, {
key: 'remove',
value: function remove(id, params) {
var opts = _extends({ raw: this.raw }, params);
var where = _extends({}, (0, _feathersQueryFilters2.default)(params.query || {}).query);
if (id !== null) {
where[this.id] = id;
}
const options = Object.assign({}, params.sequelize, { where });
var options = _extends({}, params.sequelize, { where: where });
let Model = this.applyScope(params);
var Model = this.applyScope(params);
if (params.$returning !== false) {
return this._getOrFind(id, opts).then(function (data) {
return Model.destroy(options).then(function () {
return data;
});
}).then((0, _feathersCommons.select)(params, this.id)).catch(utils.errorHandler);
} else {
return Model.destroy(options).then(function () {
return Promise.resolve([]);
}).then((0, _feathersCommons.select)(params, this.id)).catch(utils.errorHandler);
}
if (params.$returning !== false) {
return this._getOrFind(id, opts).then(data => {
return Model.destroy(options).then(() => data);
})
.then(select(params, this.id))
.catch(utils.errorHandler);
} else {
return Model.destroy(options).then(() => Promise.resolve([]))
.then(select(params, this.id))
.catch(utils.errorHandler);
}
}]);
}
}
return Service;
}();
function init(options) {
module.exports = function init (options) {
return new Service(options);
}
};
init.Service = Service;
module.exports = exports['default'];
module.exports.Service = Service;

@@ -1,22 +0,6 @@

'use strict';
const errors = require('@feathersjs/errors');
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.errorHandler = function errorHandler (error) {
let feathersError = error;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.errorHandler = errorHandler;
exports.getOrder = getOrder;
exports.getWhere = getWhere;
var _feathersErrors = require('feathers-errors');
var _feathersErrors2 = _interopRequireDefault(_feathersErrors);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function errorHandler(error) {
var feathersError = error;
if (error.name) {

@@ -29,17 +13,17 @@ switch (error.name) {

case 'SequelizeInvalidConnectionError':
feathersError = new _feathersErrors2.default.BadRequest(error);
feathersError = new errors.BadRequest(error);
break;
case 'SequelizeTimeoutError':
case 'SequelizeConnectionTimedOutError':
feathersError = new _feathersErrors2.default.Timeout(error);
feathersError = new errors.Timeout(error);
break;
case 'SequelizeConnectionRefusedError':
case 'SequelizeAccessDeniedError':
feathersError = new _feathersErrors2.default.Forbidden(error);
feathersError = new errors.Forbidden(error);
break;
case 'SequelizeHostNotReachableError':
feathersError = new _feathersErrors2.default.Unavailable(error);
feathersError = new errors.Unavailable(error);
break;
case 'SequelizeHostNotFoundError':
feathersError = new _feathersErrors2.default.NotFound(error);
feathersError = new errors.NotFound(error);
break;

@@ -50,18 +34,15 @@ }

throw feathersError;
}
};
function getOrder() {
var sort = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
exports.getOrder = function getOrder (sort = {}) {
let order = [];
var order = [];
Object.keys(sort).forEach(name =>
order.push([ name, parseInt(sort[name], 10) === 1 ? 'ASC' : 'DESC' ]));
Object.keys(sort).forEach(function (name) {
return order.push([name, parseInt(sort[name], 10) === 1 ? 'ASC' : 'DESC']);
});
return order;
}
};
function getWhere(query) {
var where = _extends({}, query);
exports.getWhere = function getWhere (query) {
let where = Object.assign({}, query);

@@ -72,6 +53,6 @@ if (where.$select) {

Object.keys(where).forEach(function (prop) {
var value = where[prop];
Object.keys(where).forEach(prop => {
let value = where[prop];
if (value && value.$nin) {
value = _extends({}, value);
value = Object.assign({}, value);

@@ -86,2 +67,2 @@ value.$notIn = value.$nin;

return where;
}
};
{
"name": "feathers-sequelize",
"description": "A service adapter for Sequelize an SQL ORM",
"version": "2.4.0",
"version": "3.0.0",
"homepage": "https://github.com/feathersjs-ecosystem/feathers-sequelize",

@@ -34,6 +34,5 @@ "main": "lib/",

"engines": {
"node": ">= 4"
"node": ">= 6"
},
"scripts": {
"prepublish": "npm run compile",
"publish": "git push origin --tags && npm run changelog && git push origin",

@@ -44,5 +43,3 @@ "changelog": "github_changelog_generator && git add CHANGELOG.md && git commit -am \"Updating changelog\"",

"release:major": "npm version major && npm publish",
"compile": "rimraf lib/ && babel -d lib/ src/",
"watch": "babel --watch -d lib/ src/",
"lint": "eslint-if-supported semistandard --fix",
"lint": "semistandard --fix",
"mocha": "mocha --opts mocha.opts --timeout 5000",

@@ -59,5 +56,2 @@ "test": "npm run lint && npm run coverage",

"mocha"
],
"ignore": [
"/lib"
]

@@ -69,20 +63,13 @@ },

"dependencies": {
"feathers-commons": "^0.8.4",
"feathers-errors": "^2.0.1",
"feathers-query-filters": "^2.0.0",
"@feathersjs/commons": "^1.3.0",
"@feathersjs/errors": "^3.2.0",
"lodash.omit": "^4.3.0",
"sequelize": "^4.3.1",
"sequelize": "^4.25.1",
"uberproto": "^1.1.2"
},
"devDependencies": {
"babel-cli": "^6.1.2",
"babel-core": "^6.1.2",
"babel-plugin-add-module-exports": "^0.2.0",
"babel-plugin-transform-object-assign": "^6.1.18",
"babel-preset-es2015": "^6.18.0",
"@feathersjs/express": "^1.1.2",
"@feathersjs/feathers": "^3.0.1",
"body-parser": "^1.14.1",
"chai": "^4.0.0",
"eslint-if-supported": "^1.0.1",
"feathers": "^2.0.0",
"feathers-rest": "^1.3.0",
"feathers-service-tests": "^0.10.0",

@@ -92,5 +79,4 @@ "istanbul": "^1.1.0-alpha.1",

"mysql2": "^1.4.2",
"pg": "^6.1.5",
"pg": "^7.3.0",
"pg-hstore": "^2.3.2",
"rimraf": "^2.5.4",
"semistandard": "^11.0.0",

@@ -97,0 +83,0 @@ "sqlite3": "^3.1.7"

@@ -6,37 +6,95 @@ # feathers-sequelize

[![Build Status](https://travis-ci.org/feathersjs-ecosystem/feathers-sequelize.png?branch=master)](https://travis-ci.org/feathersjs-ecosystem/feathers-sequelize)
[![Code Climate](https://codeclimate.com/github/feathersjs-ecosystem/feathers-sequelize.png)](https://codeclimate.com/github/feathersjs-ecosystem/feathers-sequelize)
[![Test Coverage](https://codeclimate.com/github/feathersjs-ecosystem/feathers-sequelize/badges/coverage.svg)](https://codeclimate.com/github/feathersjs-ecosystem/feathers-sequelize/coverage)
[![Dependency Status](https://img.shields.io/david/feathersjs-ecosystem/feathers-sequelize.svg?style=flat-square)](https://david-dm.org/feathersjs-ecosystem/feathers-sequelize)
[![Download Status](https://img.shields.io/npm/dm/feathers-sequelize.svg?style=flat-square)](https://www.npmjs.com/package/feathers-sequelize)
[![Slack Status](http://slack.feathersjs.com/badge.svg)](http://slack.feathersjs.com)
> A service adapter for [Sequelize](http://sequelizejs.com), an SQL ORM
A [Feathers](https://feathersjs.com) database adapter for [Sequelize](http://sequelizejs.com), an ORM for Node.js. It supports PostgreSQL, MySQL, MariaDB, SQLite and MSSQL and features transaction support, relations, read replication and more.
## Installation
```bash
npm install --save feathers-sequelize
```
And [one of the following](http://docs.sequelizejs.com/en/latest/docs/getting-started/):
```bash
npm install feathers-sequelize --save
npm install --save pg pg-hstore
npm install --save mysql // For both mysql and mariadb dialects
npm install --save sqlite3
npm install --save tedious // MSSQL
```
## Documentation
> __Important:__ `feathers-sequelize` implements the [Feathers Common database adapter API](https://docs.feathersjs.com/api/databases/common.html) and [querying syntax](https://docs.feathersjs.com/api/databases/querying.html).
Please refer to the [Feathers database adapter documentation](https://docs.feathersjs.com/api/databases/common.html) for more details or directly at:
> For more information about models and general Sequelize usage, follow up in the [Sequelize documentation](http://docs.sequelizejs.com/en/latest/).
- [Sequelize](https://docs.feathersjs.com/api/databases/sequelize.html) - The detailed documentation for this adapter
- [Extending](https://docs.feathersjs.com/api/databases/common.html#extending-adapters) - How to extend a database adapter
- [Pagination](https://docs.feathersjs.com/api/databases/common.html#pagination) - How to use pagination
- [Querying and Sorting](https://docs.feathersjs.com/api/databases/querying.html) - The common adapter querying mechanism and sorting for the database adapter
## API
### Complete Example
### `service(options)`
Here is an example of a Feathers server with a `todos` SQLite Sequelize Model:
Returns a new service instance initialized with the given options.
```js
import path from 'path';
import feathers from 'feathers';
import rest from 'feathers-rest';
import bodyParser from 'body-parser';
import Sequelize from 'sequelize';
import service from 'feathers-sequelize';
const Model = require('./models/mymodel');
const service = require('feathers-sequelize');
app.use('/messages', service({ Model }));
app.use('/messages', service({ Model, id, events, paginate }));
```
__Options:__
- `Model` (**required**) - The Sequelize model definition
- `id` (*optional*, default: `'_id'`) - The name of the id field property.
- `raw` (*optional*, default: `true`) - Runs queries faster by returning plain objects instead of Sequelize models.
- `events` (*optional*) - A list of [custom service events](https://docs.feathersjs.com/api/events.html#custom-events) sent by this service
- `paginate` (*optional*) - A [pagination object](https://docs.feathersjs.com/api/databases/common.html#pagination) containing a `default` and `max` page size
### params.sequelize
When making a [service method](https://docs.feathersjs.com/api/services.html) call, `params` can contain an `sequelize` property which allows to pass additional Sequelize options. This can e.g. be used to **retrieve associations**. Normally this wil be set in a before [hook](https://docs.feathersjs.com/api/hooks.html):
```js
app.service('messages').hooks({
before: {
find(context) {
// Get the Sequelize instance. In the generated application via:
const sequelize = context.app.get('sequelizeClient');
context.params.sequelize = {
include: [ User ]
}
}
}
});
```
## Sequelize `raw` queries
By default, all `feathers-sequelize` operations will return `raw` data (using `raw: true` when querying the database). This results in faster execution and allows feathers-sequelize to interoperate with feathers-common hooks and other 3rd party integrations. However, this will bypass some of the "goodness" you get when using Sequelize as an ORM:
- custom getters/setters will be bypassed
- model-level validations are bypassed
- associated data loads a bit differently
- ...and several other issues that one might not expect
Don't worry! The solution is easy. Please read the guides about [working with model instances](#working-with-sequelize-model-instances).
## Example
Here is an example of a Feathers server with a `messages` SQLite Sequelize Model:
```
$ npm install @feathersjs/feathers @feathersjs/errors @feathersjs/express @feathersjs/socketio sequelize feathers-sequelize sqlite3
```
In `app.js`:
```js
const path = require('path');
const feathers = require('@feathersjs/feathers');
const express = require('@feathersjs/express');
const socketio = require('@feathersjs/socketio');
const Sequelize = require('sequelize');
const service = require('feathers-sequelize');
const sequelize = new Sequelize('sequelize', '', '', {

@@ -47,10 +105,6 @@ dialect: 'sqlite',

});
const Todo = sequelize.define('todo', {
const Message = sequelize.define('message', {
text: {
type: Sequelize.STRING,
allowNull: false
},
complete: {
type: Sequelize.BOOLEAN,
defaultValue: false
}

@@ -61,18 +115,17 @@ }, {

// Create a feathers instance.
const app = feathers()
// Enable REST services
.configure(rest())
// Turn on JSON parser for REST services
.use(bodyParser.json())
// Turn on URL-encoded parser for REST services
.use(bodyParser.urlencoded({ extended: true }));
// Create an Express compatible Feathers application instance.
const app = express(feathers());
// Removes all database content
Todo.sync({ force: true });
// Create an sqlite backed Feathers service with a default page size of 2 items
// Turn on JSON parser for REST services
app.use(express.json());
// Turn on URL-encoded parser for REST services
app.use(express.urlencoded({ extended: true }));
// Enable REST services
app.configure(express.rest());
// Enable Socket.io services
app.configure(socketio());
// Create an in-memory Feathers service with a default page size of 2 items
// and a maximum size of 4
app.use('/todos', service({
Model: Todo,
app.use('/messages', service({
Model: Message,
paginate: {

@@ -83,15 +136,262 @@ default: 2,

}));
app.use(express.errorHandler());
Message.sync({ force: true }).then(() => {
// Create a dummy Message
app.service('messages').create({
text: 'Message created on server'
}).then(message => console.log('Created message', message));
});
// Start the server
app.listen(3030);
const port = 3030;
console.log('Feathers Todo Sequelize service running on 127.0.0.1:3030');
app.listen(port, () => {
console.log(`Feathers server listening on port ${port}`);
});
```
You can run this example by using `node examples/app` and going to [localhost:3030/todos](http://localhost:3030/todos). You should see an empty array. That's because you don't have any Todos yet but you now have full CRUD for your new todos service.
Run the example with `node app` and go to [localhost:3030/messages](http://localhost:3030/messages).
## Querying
Additionally to the [common querying mechanism](https://docs.feathersjs.com/api/databases/querying.html) this adapter also supports all [Sequelize query operators](http://docs.sequelizejs.com/manual/tutorial/querying.html).
> **Note**: This adapter supports an additional `$returning` parameter for patch and remove queries. By setting `params.$returning = false` it will disable feathers and sequelize from returning what was changed, so mass updates can be done without overwhelming node and/or clients.
## Associations and relations
Follow up in the [Sequelize documentation for associations](http://docs.sequelizejs.com/manual/tutorial/associations.html), [this issue](https://github.com/feathersjs-ecosystem/feathers-sequelize/issues/20) and [this Stackoverflow answer](https://stackoverflow.com/questions/42841810/feathers-js-sequelize-service-with-relations-between-two-models/42846215#42846215).
## Working with Sequelize Model instances
It is highly recommended to use `raw` queries, which is the default. However, there are times when you will want to take advantage of [Sequelize Instance](http://docs.sequelizejs.com/en/latest/api/instance/) methods. There are two ways to tell feathers to return Sequelize instances:
1. Set `{ raw: false }` in a "before" hook:
```js
function rawFalse(context) {
if (!context.params.sequelize) context.params.sequelize = {};
Object.assign(context.params.sequelize, { raw: false });
return context;
}
hooks.before.find = [rawFalse];
```
1. Use the new `hydrate` hook in the "after" phase:
```js
const hydrate = require('feathers-sequelize/hooks/hydrate');
hooks.after.find = [hydrate()];
// Or, if you need to include associated models, you can do the following:
function includeAssociated (context) {
return hydrate({
include: [{ model: context.app.services.fooservice.Model }]
}).call(this, context);
}
hooks.after.find = [includeAssociated];
```
For a more complete example see this [gist](https://gist.github.com/sicruse/bfaa17008990bab2fd1d76a670c3923f).
> **Important:** When working with Sequelize Instances, most of the feathers-hooks-common will no longer work. If you need to use a common hook or other 3rd party hooks, you should use the "dehydrate" hook to convert data back to a plain object:
> ```js
> const hydrate = require('feathers-sequelize/hooks/hydrate');
> const dehydrate = require('feathers-sequelize/hooks/dehydrate');
> const { populate } = require('feathers-hooks-common');
>
> hooks.after.find = [hydrate(), doSomethingCustom(), dehydrate(), populate()];
> ```
## Validation
Sequelize by default gives you the ability to [add validations at the model level](http://docs.sequelizejs.com/en/latest/docs/models-definition/#validations). Using an error handler like the one that [comes with Feathers](https://github.com/feathersjs/feathers-errors/blob/master/src/error-handler.js) your validation errors will be formatted nicely right out of the box!
## Migrations
Migrations with feathers and sequelize are quite simple. This guide will walk you through creating the recommended file structure, but you are free to rearrange things as you see fit. The following assumes you have a `migrations` folder in the root of your app.
### Initial Setup: one-time tasks
- Install the [sequelize CLI](https://github.com/sequelize/cli):
```
npm install sequelize-cli --save -g
```
- Create a `.sequelizerc` file in your project root with the following content:
```js
const path = require('path');
module.exports = {
'config': path.resolve('migrations/config/config.js'),
'migrations-path': path.resolve('migrations'),
'seeders-path': path.resolve('migrations/seeders'),
'models-path': path.resolve('migrations/models')
};
```
- Create the migrations config in `migrations/config/config.js`:
```js
const app = require('../../src/app');
const env = process.env.NODE_ENV || 'development';
const dialect = 'mysql'|'sqlite'|'postgres'|'mssql';
module.exports = {
[env]: {
dialect,
url: app.get(dialect),
migrationStorageTableName: '_migrations'
}
};
```
- Define your models config in `migrations/models/index.js`:
```js
const Sequelize = require('sequelize');
const app = require('../../src/app');
const sequelize = app.get('sequelizeClient');
const models = sequelize.models;
// The export object must be a dictionary of model names -> models
// It must also include sequelize (instance) and Sequelize (constructor) properties
module.exports = Object.assign({
Sequelize,
sequelize
}, models);
```
### Migrations workflow
The migration commands will load your application and it is therefore required that you define the same environment variables as when running you application. For example, many applications will define the database connection string in the startup command:
```
DATABASE_URL=postgres://user:pass@host:port/dbname npm start
```
All of the following commands assume that you have defined the same environment variables used by your application.
> **ProTip:** To save typing, you can export environment variables for your current bash/terminal session:
> ```
export DATABASE_URL=postgres://user:pass@host:port/db
```
### Create a new migration
To create a new migration file, run the following command and provide a meaningful name:
```
sequelize migration:create --name="meaningful-name"
```
This will create a new file in the migrations folder. All migration file names will be prefixed with a sortable data/time string: `20160421135254-meaninful-name.js`. This prefix is crucial for making sure your migrations are executed in the proper order.
> **NOTE:** The order of your migrations is determined by the alphabetical order of the migration scripts in the file system. The file names generated by the CLI tools will always ensure that the most recent migration comes last.
#### Add the up/down scripts:
Open the newly created migration file and write the code to both apply and undo the migration. Please refer to the [sequelize migration functions](http://docs.sequelizejs.com/en/latest/docs/migrations/#functions) for available operations. **Do not be lazy - write the down script too and test!** Here is an example of converting a `NOT NULL` column accept null values:
```js
'use strict';
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.changeColumn('tableName', 'columnName', {
type: Sequelize.STRING,
allowNull: true
});
},
down: function (queryInterface, Sequelize) {
return queryInterface.changeColumn('tableName', 'columnName', {
type: Sequelize.STRING,
allowNull: false
});
}
};
```
> **ProTip:** As of this writing, if you use the `changeColumn` method you must **always** specify the `type`, even if the type is not changing.
> **ProTip:** Down scripts are typically easy to create and should be nearly identical to the up script except with inverted logic and inverse method calls.
#### Keeping your app code in sync with migrations
The application code should always be up to date with the migrations. This allows the app to be freshly installed with everything up-to-date without running the migration scripts. Your migrations should also never break a freshly installed app. This often times requires that you perform any necessary checks before executing a task. For example, if you update a model to include a new field, your migration should first check to make sure that new field does not exist:
```js
'use strict';
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.describeTable('tableName').then(attributes => {
if ( !attributes.columnName ) {
return queryInterface.addColumn('tableName', 'columnName', {
type: Sequelize.INTEGER,
defaultValue: 0
});
}
})
},
down: function (queryInterface, Sequelize) {
return queryInterface.describeTable('tableName').then(attributes => {
if ( attributes.columnName ) {
return queryInterface.removeColumn('tableName', 'columnName');
}
});
}
};
```
### Apply a migration
The CLI tools will always run your migrations in the correct order and will keep track of which migrations have been applied and which have not. This data is stored in the database under the `_migrations` table. To ensure you are up to date, simply run the following:
```
sequelize db:migrate
```
> **ProTip:** You can add the migrations script to your application startup command to ensure that all migrations have run every time your app is started. Try updating your package.json `scripts` attribute and run `npm start`:
```
scripts: {
start: "sequelize db:migrate && node src/"
}
```
### Undo the previous migration
To undo the last migration, run the following command:
```
sequelize db:migrate:undo
```
Continue running the command to undo each migration one at a time - the migrations will be undone in the proper order.
> **Note:** - You shouldn't really have to undo a migration unless you are the one developing a new migration and you want to test that it works. Applications rarely have to revert to a previous state, but when they do you will be glad you took the time to write and test your `down` scripts!
### Reverting your app to a previous state
In the unfortunate case where you must revert your app to a previous state, it is important to take your time and plan your method of attack. Every application is different and there is no one-size-fits-all strategy for rewinding an application. However, most applications should be able to follow these steps (order is important):
1. Stop your application (kill the process)
1. Find the last stable version of your app
1. Count the number of migrations which have been added since that version
1. Undo your migrations one at a time until the db is in the correct state
1. Revert your code back to the previous state
1. Start your app
## License
Copyright (c) 2015
Copyright (c) 2017
Licensed under the [MIT license](LICENSE).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc