sails-redox-postgresql

1.3.0 • Public • Published

sails-redox-postgresql

A Redox extension to the sails-postgresql Waterline adapter.

The only functional change is adding support for an afterFind(values, callback) lifecycle hook on Waterline models. This hook is called once for each record returned -- e.g. if you do Model.find().populate('OtherModel'), then Model.afterFind will be called on each Model object returned, and OtherModel.afterFind will be called on each populated OtherModel sub-object.

The adapter supports the following adapter-specific query extension:

Model.find({
  _adapter: { // Adapter-specific config
    skipAfterSave: false // disable afterFind hook for this query
  }
});

Testing

Waterline adapters come with a built-in integration test suite. This repo also has unit tests for the additional functionality it provides. Run:

createdb redox-postgresql-adapter-test
npm test

Note that there is one test that's known to fail -- it fails for the underlying sails-postgresql adapter, too:

Queryable Interface Modifiers greaterThanOrEqual (>=) dates should return records with symbolic usage >= usage when searc
hing dates as strings

Publishing

This repo is published as the sails-redox-postgresql package on npm.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    1
    • latest

Version History

Package Sidebar

Install

npm i sails-redox-postgresql

Weekly Downloads

12

Version

1.3.0

License

none

Unpacked Size

81.1 kB

Total Files

11

Last publish

Collaborators

  • luketurner