From 4ff906920b2a5a408c54ece1730eef7865d3cf0f Mon Sep 17 00:00:00 2001 From: Vitaly Tomilov Date: Fri, 30 Oct 2020 13:17:14 +0000 Subject: [PATCH 1/2] Update PostgresStorageAdapter.js Start moving toward better, ES7 syntax. --- .../Postgres/PostgresStorageAdapter.js | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index 3ca9cd43f9..5e52de3ba2 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -2463,20 +2463,19 @@ export class PostgresStorageAdapter implements StorageAdapter { }); return Promise.all(promises) .then(() => { - return this._client.tx('perform-initialization', t => { - return t.batch([ - t.none(sql.misc.jsonObjectSetKeys), - t.none(sql.array.add), - t.none(sql.array.addUnique), - t.none(sql.array.remove), - t.none(sql.array.containsAll), - t.none(sql.array.containsAllRegex), - t.none(sql.array.contains), - ]); + return this._client.tx('perform-initialization', async t => { + await t.none(sql.misc.jsonObjectSetKeys); + await t.none(sql.array.add); + await t.none(sql.array.addUnique); + await t.none(sql.array.remove); + await t.none(sql.array.containsAll); + await t.none(sql.array.containsAllRegex); + await t.none(sql.array.contains); + return t.ctx; }); }) - .then(data => { - debug(`initializationDone in ${data.duration}`); + .then(ctx => { + debug(`initializationDone in ${ctx.duration}`); }) .catch(error => { /* eslint-disable no-console */ From 9b3aa28afb4e6e3bf9cdad4b002453f642d6224c Mon Sep 17 00:00:00 2001 From: Vitaly Tomilov Date: Fri, 30 Oct 2020 13:27:20 +0000 Subject: [PATCH 2/2] Update PostgresStorageAdapter.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixing spaces 🤦‍♂️ --- .../Storage/Postgres/PostgresStorageAdapter.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index 5e52de3ba2..ada6c51ace 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -2464,14 +2464,14 @@ export class PostgresStorageAdapter implements StorageAdapter { return Promise.all(promises) .then(() => { return this._client.tx('perform-initialization', async t => { - await t.none(sql.misc.jsonObjectSetKeys); - await t.none(sql.array.add); - await t.none(sql.array.addUnique); - await t.none(sql.array.remove); - await t.none(sql.array.containsAll); - await t.none(sql.array.containsAllRegex); - await t.none(sql.array.contains); - return t.ctx; + await t.none(sql.misc.jsonObjectSetKeys); + await t.none(sql.array.add); + await t.none(sql.array.addUnique); + await t.none(sql.array.remove); + await t.none(sql.array.containsAll); + await t.none(sql.array.containsAllRegex); + await t.none(sql.array.contains); + return t.ctx; }); }) .then(ctx => {