Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardograca committed Jun 7, 2020
1 parent 54928fe commit 58058a7
Show file tree
Hide file tree
Showing 24 changed files with 83 additions and 37 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,20 @@
## Change Log

**1.2.0** <small>_Jun 07, 2020_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/1.1.1...1.2.0)

#### Features

- Add option to control auto refresh after save: [#2070](https://github.com/bookshelf/bookshelf/pull/2070)

#### Tests

- Adds some more integration tests to `Collection#fetch`: [#2079](https://github.com/bookshelf/bookshelf/pull/2079)

#### Dependencies

- Support Knex version 0.21.0 and up: [#2072](https://github.com/bookshelf/bookshelf/pull/2072)
- Update some dependencies of dependencies to fix security warnings: [#2078](https://github.com/bookshelf/bookshelf/pull/2078)

**1.1.1** <small>_Mar 28, 2020_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/1.1.0...1.1.1)

#### Bug fixes
Expand Down
29 changes: 23 additions & 6 deletions docs/api.html
Expand Up @@ -9019,6 +9019,28 @@ <h5>Parameters</h5>

</li>

<li>
<code class="param"><span class="optional-bracket">[</span><span class="item-name">autoRefresh</span><span class="default-value"><span class="default-equals">=</span><span class="default-value">true</span></span><span class="optional-bracket">]</span></code>


<code class="param-type"><span class="param-type"
><code class="param-type"
>boolean</code
>
</span></code>


<div class="description">
<p>Weather to enable auto refresh such that after a model is saved it will be populated with all
the attributes that are present in the database, so you don't need to manually call
<a href="api.html#Model-instance-refresh"><code>refresh</code></a> to update it. This will use two queries unless
the database supports the <code>RETURNING</code> statement, in which case the model will
be saved and its data fetched with a single query.</p>

</div>

</li>

</ul>


Expand Down Expand Up @@ -9167,11 +9189,6 @@ <h5>Returns</h5>
// ...
})
</code></pre>
<p>After a model is saved it will be populated with all the attributes that are
present in the database, so you don't need to manually call
<a href="api.html#Model-instance-refresh"><code>refresh</code></a> to update it. This will use two queries unless
the database supports the <code>RETURNING</code> statement, in which case the model will
be saved and its data fetched with a single query.</p>
<p>Several events fire on the model when starting the save process:</p>
<ul>
<li><a href="api.html#Model-event-creating"><code>"creating"</code></a> if the model is being inserted.</li>
Expand Down Expand Up @@ -21305,7 +21322,7 @@ <h5>Returns</h5>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/bookshelf.js.html
Expand Up @@ -98,7 +98,7 @@ <h1 class="page-title">bookshelf.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
16 changes: 15 additions & 1 deletion docs/index.html
Expand Up @@ -280,6 +280,20 @@ <h3 id="which-opensource-projects-are-using-bookshelf">Which open-source project

<section id="changelog" class="changelog">
<h2>Change Log</h2>
<p><strong>1.2.0</strong> <small><em>Jun 07, 2020</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/1.1.1...1.2.0">Diff</a></p>
<h4>Features</h4>
<ul>
<li>Add option to control auto refresh after save: <a href="https://github.com/bookshelf/bookshelf/pull/2070">#2070</a></li>
</ul>
<h4>Tests</h4>
<ul>
<li>Adds some more integration tests to <code>Collection#fetch</code>: <a href="https://github.com/bookshelf/bookshelf/pull/2079">#2079</a></li>
</ul>
<h4>Dependencies</h4>
<ul>
<li>Support Knex version 0.21.0 and up: <a href="https://github.com/bookshelf/bookshelf/pull/2072">#2072</a></li>
<li>Update some dependencies of dependencies to fix security warnings: <a href="https://github.com/bookshelf/bookshelf/pull/2078">#2078</a></li>
</ul>
<p><strong>1.1.1</strong> <small><em>Mar 28, 2020</em></small> - <a href="https://github.com/bookshelf/bookshelf/compare/1.1.0...1.1.1">Diff</a></p>
<h4>Bug fixes</h4>
<ul>
Expand Down Expand Up @@ -1069,7 +1083,7 @@ <h4>Other changes</h4>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_base_collection.js.html
Expand Up @@ -892,7 +892,7 @@ <h1 class="page-title">lib/base/collection.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_base_events.js.html
Expand Up @@ -219,7 +219,7 @@ <h1 class="page-title">lib/base/events.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_base_model.js.html
Expand Up @@ -1085,7 +1085,7 @@ <h1 class="page-title">lib/base/model.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_base_relation.js.html
Expand Up @@ -159,7 +159,7 @@ <h1 class="page-title">lib/base/relation.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_bookshelf.js.html
Expand Up @@ -648,7 +648,7 @@ <h1 class="page-title">lib/bookshelf.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_collection.js.html
Expand Up @@ -635,7 +635,7 @@ <h1 class="page-title">lib/collection.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
16 changes: 8 additions & 8 deletions docs/lib_model.js.html
Expand Up @@ -1039,12 +1039,6 @@ <h1 class="page-title">lib/model.js</h1>
* // ...
* })
*
* After a model is saved it will be populated with all the attributes that are
* present in the database, so you don't need to manually call
* {@link Model#refresh refresh} to update it. This will use two queries unless
* the database supports the `RETURNING` statement, in which case the model will
* be saved and its data fetched with a single query.
*
* Several events fire on the model when starting the save process:
* - {@link Model#event:creating "creating"} if the model is being inserted.
* - {@link Model#event:updating "updating"} event if the model is being updated.
Expand Down Expand Up @@ -1104,6 +1098,12 @@ <h1 class="page-title">lib/model.js</h1>
* @param {boolean} [options.debug=false]
* Whether to enable debugging mode or not. When enabled will show information about the
* queries being run.
* @param {boolean} [options.autoRefresh=true]
* Weather to enable auto refresh such that after a model is saved it will be populated with all
* the attributes that are present in the database, so you don't need to manually call
* {@link Model#refresh refresh} to update it. This will use two queries unless
* the database supports the `RETURNING` statement, in which case the model will
* be saved and its data fetched with a single query.
* @fires Model#saving
* @fires Model#creating
* @fires Model#updating
Expand Down Expand Up @@ -1261,7 +1261,7 @@ <h1 class="page-title">lib/model.js</h1>

if (resp === 0 || resp.length === 0) return resp;
if (isObjectResponse) return this;

if (options.autoRefresh === false) return this;
return this.refresh({silent: true, transacting: options.transacting});
})
.then(function() {
Expand Down Expand Up @@ -1658,7 +1658,7 @@ <h1 class="page-title">lib/model.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_relation.js.html
Expand Up @@ -1037,7 +1037,7 @@ <h1 class="page-title">lib/relation.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
6 changes: 3 additions & 3 deletions docs/lib_sync.js.html
Expand Up @@ -283,7 +283,7 @@ <h1 class="page-title">lib/sync.js</h1>
const syncing = this.syncing;
return this.query.insert(
syncing.format(_.extend(Object.create(null), syncing.attributes)),
supportsReturning(this.query.client) ? '*' : null
supportsReturning(this.query.client) &amp;&amp; this.options.autoRefresh !== false ? '*' : null
);
}),

Expand All @@ -299,7 +299,7 @@ <h1 class="page-title">lib/sync.js</h1>
if (syncing.id === updating[syncing.idAttribute]) {
delete updating[syncing.idAttribute];
}
if (supportsReturning(query.client)) query.returning('*');
if (supportsReturning(query.client) &amp;&amp; this.options.autoRefresh !== false) query.returning('*');
return query.update(updating);
}),

Expand Down Expand Up @@ -334,7 +334,7 @@ <h1 class="page-title">lib/sync.js</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-associations.html
Expand Up @@ -102,7 +102,7 @@ <h3>More details about this topic on the following sections:</h3>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-events.html
Expand Up @@ -178,7 +178,7 @@ <h3>Available destroy related events</h3>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-many-to-many.html
Expand Up @@ -122,7 +122,7 @@ <h2>Many-to-many</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-models.html
Expand Up @@ -167,7 +167,7 @@ <h3>More details about this topic on the following sections:</h3>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-one-to-many.html
Expand Up @@ -118,7 +118,7 @@ <h2>One-to-many</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-one-to-one.html
Expand Up @@ -118,7 +118,7 @@ <h2>One-to-one</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-parse-and-format.html
Expand Up @@ -114,7 +114,7 @@ <h2>Parse and Format</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial-polymorphic.html
Expand Up @@ -114,7 +114,7 @@ <h2>Polymorphic</h2>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials.html
Expand Up @@ -95,7 +95,7 @@ <h1>Guides</h1>
<a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>

on
March 28, 2020
June 7, 2020

</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "bookshelf",
"version": "1.1.1",
"version": "1.2.0",
"description": "A lightweight ORM for PostgreSQL, MySQL, and SQLite3",
"main": "bookshelf.js",
"scripts": {
Expand Down

0 comments on commit 58058a7

Please sign in to comment.