mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[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:
committed by
Mohamed Hegazy
parent
5ddccbbc61
commit
d93d6a53a4
@@ -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 */
|
||||
|
||||
Vendored
+1
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user