sails-redox-postgresql
v1.3.0
Published
Redox's extended Postgresql adapter for Sails / Waterline
Downloads
3
Readme
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.