From 7e5c4be14f33223bd3fa2627290d13b24553c68f Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 13 Jul 2021 17:11:11 +0100 Subject: [PATCH 1/2] fix postgres query array value --- packages/server/src/integrations/base/definitions.ts | 8 +++++--- packages/server/src/integrations/postgres.ts | 2 +- packages/server/src/integrations/tests/postgres.spec.js | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/server/src/integrations/base/definitions.ts b/packages/server/src/integrations/base/definitions.ts index 9d5567b6c8..c202a828d0 100644 --- a/packages/server/src/integrations/base/definitions.ts +++ b/packages/server/src/integrations/base/definitions.ts @@ -99,9 +99,11 @@ export interface QueryJson { export interface SqlQuery { sql: string - bindings?: { - [key: string]: any - } + bindings?: + | string[] + | { + [key: string]: any + } } export interface QueryOptions { diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index 27286ebd02..787bce7e4e 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -92,7 +92,7 @@ module PostgresModule { async function internalQuery(client: any, query: SqlQuery) { try { - return await client.query(query.sql, query.bindings || {}) + return await client.query(query.sql, query.bindings || []) } catch (err) { throw new Error(err) } diff --git a/packages/server/src/integrations/tests/postgres.spec.js b/packages/server/src/integrations/tests/postgres.spec.js index 348fa20b6f..5d0283ec90 100644 --- a/packages/server/src/integrations/tests/postgres.spec.js +++ b/packages/server/src/integrations/tests/postgres.spec.js @@ -20,7 +20,7 @@ describe("Postgres Integration", () => { const response = await config.integration.create({ sql }) - expect(pg.queryMock).toHaveBeenCalledWith(sql, {}) + expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) it("calls the read method with the correct params", async () => { @@ -28,7 +28,7 @@ describe("Postgres Integration", () => { const response = await config.integration.read({ sql }) - expect(pg.queryMock).toHaveBeenCalledWith(sql, {}) + expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) it("calls the update method with the correct params", async () => { @@ -36,7 +36,7 @@ describe("Postgres Integration", () => { const response = await config.integration.update({ sql }) - expect(pg.queryMock).toHaveBeenCalledWith(sql, {}) + expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) it("calls the delete method with the correct params", async () => { @@ -44,7 +44,7 @@ describe("Postgres Integration", () => { await config.integration.delete({ sql }) - expect(pg.queryMock).toHaveBeenCalledWith(sql, {}) + expect(pg.queryMock).toHaveBeenCalledWith(sql, []) }) describe("no rows returned", () => { From 23bb4215c26582fd7acac91aae058a6ee29c4b85 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 13 Jul 2021 16:53:42 +0000 Subject: [PATCH 2/2] v0.9.74 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index f6924bc632..0982cc8bb4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.73", + "version": "0.9.74", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 5429392362..d93a57b47d 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.73", + "version": "0.9.74", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 3250b4ab34..5118c1b7cf 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.73", + "version": "0.9.74", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index b6aa86c925..261db322d7 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.73", + "version": "0.9.74", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.73", - "@budibase/client": "^0.9.73", + "@budibase/bbui": "^0.9.74", + "@budibase/client": "^0.9.74", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.73", + "@budibase/string-templates": "^0.9.74", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index f08d508ef6..84ed8b7c91 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.73", + "version": "0.9.74", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index c22a3e807e..c9f3935569 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.73", + "version": "0.9.74", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.73", - "@budibase/standard-components": "^0.9.73", - "@budibase/string-templates": "^0.9.73", + "@budibase/bbui": "^0.9.74", + "@budibase/standard-components": "^0.9.74", + "@budibase/string-templates": "^0.9.74", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index d37fed9b7a..4e225bd108 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.73", + "version": "0.9.74", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -59,9 +59,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.73", - "@budibase/client": "^0.9.73", - "@budibase/string-templates": "^0.9.73", + "@budibase/auth": "^0.9.74", + "@budibase/client": "^0.9.74", + "@budibase/string-templates": "^0.9.74", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -114,7 +114,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.73", + "@budibase/standard-components": "^0.9.74", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index b583bb666b..92fb39c914 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.73", + "version": "0.9.74", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.73", + "@budibase/bbui": "^0.9.74", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 34c1843c28..f75a11cf4b 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.73", + "version": "0.9.74", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index c818b19dd7..4d06b614ef 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.73", + "version": "0.9.74", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.73", - "@budibase/string-templates": "^0.9.73", + "@budibase/auth": "^0.9.74", + "@budibase/string-templates": "^0.9.74", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3",