Skip to content

Commit

Permalink
docs update for #670
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Nov 9, 2019
1 parent f06e609 commit fd98947
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 36 deletions.
2 changes: 1 addition & 1 deletion lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ function Database(cn, dc, config) {
* @param {array|value} [values]
* Parameters for the procedure - one value or an array of values.
*
* @returns {external:Promise>}
* @returns {external:Promise}
*
* @see
* {@link Database#func func}
Expand Down
6 changes: 0 additions & 6 deletions lib/formatting.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,6 @@ const $as = {
* Converts a numeric value into its PostgreSQL number presentation, with support
* for special values of `NaN`, `+Infinity` and `-Infinity`.
*
* **Added in v9.3.0:** support for `BigInt` type.
*
* @param {number|bigint|function} num
* Number to be converted, or a function that returns one.
*
Expand Down Expand Up @@ -671,8 +669,6 @@ const $as = {
* Array to be converted, or a function that returns one.
*
* @param {object} [options]
* **Added in v9.2.0**
*
* Array-Formatting Options.
*
* @param {boolean} [options.capSQL=false]
Expand Down Expand Up @@ -817,8 +813,6 @@ const $as = {
* Formatting Options.
*
* @param {boolean} [options.capSQL=false]
* **Added in v9.2.0**
*
* Formats reserved SQL words capitalized. Presently, this only concerns arrays, to output `ARRAY` when required.
*
* @param {boolean} [options.partial=false]
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const npm = {
* @module pg-promise
*
* @description
* ## pg-promise v9.3
* ## pg-promise v10
* Please note that all documentation here is for the latest official release only.
*
* ### Initialization Options
Expand Down
57 changes: 29 additions & 28 deletions lib/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ const callback = (ctx, obj, cb, config) => {

try {
if (cb.constructor.name === 'GeneratorFunction') {
// v9.0 dropped all support for ES6 generator functions:
// v9.0 dropped all support for ES6 generator functions;
// Clients should use the new ES7 async/await syntax.
throw new TypeError('ES6 generator functions are no longer supported!');
}
result = cb.call(obj, obj); // invoking the callback function;
Expand Down Expand Up @@ -258,38 +259,38 @@ const execute = (ctx, obj, isTX, config) => {
spName = 'level_' + ctx.txLevel;
return begin()
.then(() => callback(ctx, obj, ctx.cb, config)
.then(data => {
cbData = data; // save callback data;
success = true;
return commit();
}, err => {
cbReason = err; // save callback failure reason;
return rollback();
})
.then(() => {
if (success) {
update(false, true, cbData);
return cbData;
}
update(false, false, cbReason);
return $p.reject(cbReason);
},
.then(data => {
cbData = data; // save callback data;
success = true;
return commit();
}, err => {
cbReason = err; // save callback failure reason;
return rollback();
})
.then(() => {
if (success) {
update(false, true, cbData);
return cbData;
}
update(false, false, cbReason);
return $p.reject(cbReason);
},
err => {
// either COMMIT or ROLLBACK has failed, which is impossible
// to replicate in a test environment, so skipping from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
}),
err => {
// either COMMIT or ROLLBACK has failed, which is impossible
// to replicate in a test environment, so skipping from the test;
// BEGIN has failed, which is impossible to replicate in a test
// environment, so skipping the whole block from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
}),
err => {
// BEGIN has failed, which is impossible to replicate in a test
// environment, so skipping the whole block from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
});
});
}

function begin() {
Expand Down

0 comments on commit fd98947

Please sign in to comment.