[bookshelf] fetchAll supports same parameters as fetch (#16170)

* fetchAll supports same parameters as fetch

Latest Bookshelf's instance.fetchAll calls collection.fetch() with
given options, ie. it supports the same options than fetch.

For example

(new User).fetchAll({columns: ['id', 'name']}).then(...)

* Update version number

* Revert "Update version number"

This reverts commit cf4a3e6c51554d75f5408acd23bb0fade6acafef.

* remove extra slash from contributor's name
This commit is contained in:
Vesa Poikajärvi
2017-05-03 13:19:42 -07:00
committed by Mohamed Hegazy
parent 5ddccbbc61
commit d93d6a53a4
2 changed files with 10 additions and 2 deletions
+9
View File
@@ -481,6 +481,15 @@ new Book({'ISBN-13': '9780440180296'})
/* model.fetchAll(), see http://bookshelfjs.org/#Model-instance-fetchAll */
{
(new User).fetchAll({
columns: ['id', 'name'],
withRelated: ['posts.tags']
}).then((user: any) => {
console.log(user);
})
}
/* model.format(), see http://bookshelfjs.org/#Model-instance-format */
/* model.get(), see http://bookshelfjs.org/#Model-instance-get */
+1 -2
View File
@@ -282,8 +282,7 @@ declare namespace Bookshelf {
[index: string]: (query: Knex.QueryBuilder) => Knex.QueryBuilder;
}
interface FetchAllOptions extends SyncOptions {
require?: boolean;
interface FetchAllOptions extends FetchOptions {
}
interface SaveOptions extends SyncOptions {