loopback-datasource-juggler/lib
Partap Davis 1e6c453191 Add Promises to DAO
When a callback is omitted from a DAO method, return a Promise that
resolves to the value normally passed to the callback of that method.
If a callback is provided, behave normally.

This API will use native ES6 promises if available.  If not available,
or to force the use of another Promise library, you must assign the
global.Promise object.

e.g.:
global.Promise = require('bluebird')

Class methods affected:

- create
- updateOrCreate / upsert
- findOrCreate
- exists
- find
- findOne
- findById
- findByIds
- remove / deleteAll / destroyAll
- removeById / deleteById / destroyById
- count
- update / updateAll

Prototype methods affected:

- save
- delete / remove / destroy
- updateAttribute
- updateAttributes
- reload

Exceptions / edge cases:

- create() used to return the data object that was passed in, even if
  no callback was provided.  Now, if a callback is provided, it will
  return the data object, otherwise it will return a Promise.

- If create() is provided an array of data objects for creation, it
  will continue to always return the array. This batch creation mode
  does not support promises.

- findOrCreate() has a callback of the form: cb(err, instance, created),
  with the extra parameter indicating whether the instance was created
  or not. When called with its promise variant, the resolver will
  receive a single array parameter: [instance, created]
2015-02-26 13:45:37 -07:00
..
connectors Fix id type issue for update 2015-02-02 08:44:36 -08:00
dao.js Add Promises to DAO 2015-02-26 13:45:37 -07:00
datasource.js Create model foreign key matching type of opposite part of relation (even if it has a custom field type) 2015-02-03 13:13:00 +03:00
geo.js Added support for inline parameters like: new GeoPoint(-34, 150) 2014-12-18 10:47:06 -05:00
hooks.js Allow before hooks to pass arguments to next() 2014-07-15 12:51:33 -07:00
include.js Add support for multiple includes that use relation syntax 2014-11-04 20:45:25 -08:00
introspection.js Tidy up model building from data sources 2014-09-12 14:25:35 -07:00
jutil.js Fix the forEach closure 2014-06-06 09:59:57 -07:00
list.js Return 400 when client provides an incorrect value 2015-02-05 16:58:42 +05:30
mixins.js Clean up the mixin processing 2014-08-08 01:20:57 -07:00
model-builder.js Merge pull request #436 from strongloop/feature/fix-issue-293 2015-02-11 16:13:00 -08:00
model-definition.js fix id properties should sort by its index 2015-01-21 20:16:34 +08:00
model.js Add a new property option `defaultFn` 2015-02-20 20:08:25 +01:00
relation-definition.js relation-definition: remove trailing whitespace 2015-02-24 11:36:13 +01:00
relations.js Implemented embedsOne 2014-08-20 08:58:08 -07:00
scope.js Extract mergeQuery and setScopeValuesFromWhere 2014-10-09 18:13:40 +02:00
types.js Rewrite the List class for typed array 2014-02-14 10:41:00 -08:00
utils.js ModelBaseClass: promise mode for notifyObserversOf 2015-02-17 18:19:21 +01:00
validations.js Fixed nullCheck in validations to correct behavior when dealing with undefined attributes 2015-01-27 22:18:47 +00:00