Merge pull request #1570 from Budibase/fix/stack-fixes
SSL fixes, update boolean in lucene
This commit is contained in:
commit
9f3a9f2383
|
@ -195,10 +195,10 @@
|
||||||
/>
|
/>
|
||||||
{:else if expression.type === "boolean"}
|
{:else if expression.type === "boolean"}
|
||||||
<Combobox
|
<Combobox
|
||||||
disabled
|
disabled={expression.noValue}
|
||||||
options={[
|
options={[
|
||||||
{ label: "True", value: true },
|
{ label: "True", value: "true" },
|
||||||
{ label: "False", value: false },
|
{ label: "False", value: "false" },
|
||||||
]}
|
]}
|
||||||
bind:value={expression.value}
|
bind:value={expression.value}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const { Pool } = require("pg")
|
const { Pool } = require("pg")
|
||||||
|
const { FIELD_TYPES } = require("./Integration")
|
||||||
|
|
||||||
let pool
|
let pool
|
||||||
|
|
||||||
|
@ -9,30 +10,34 @@ const SCHEMA = {
|
||||||
"PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.",
|
"PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.",
|
||||||
datasource: {
|
datasource: {
|
||||||
host: {
|
host: {
|
||||||
type: "string",
|
type: FIELD_TYPES.STRING,
|
||||||
default: "localhost",
|
default: "localhost",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
port: {
|
port: {
|
||||||
type: "number",
|
type: FIELD_TYPES.NUMBER,
|
||||||
required: true,
|
required: true,
|
||||||
default: 5432,
|
default: 5432,
|
||||||
},
|
},
|
||||||
database: {
|
database: {
|
||||||
type: "string",
|
type: FIELD_TYPES.STRING,
|
||||||
default: "postgres",
|
default: "postgres",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
user: {
|
user: {
|
||||||
type: "string",
|
type: FIELD_TYPES.STRING,
|
||||||
default: "root",
|
default: "root",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: "password",
|
type: FIELD_TYPES.PASSWORD,
|
||||||
default: "root",
|
default: "root",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
ssl: {
|
||||||
|
type: FIELD_TYPES.OBJECT,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
create: {
|
create: {
|
||||||
|
@ -53,6 +58,11 @@ const SCHEMA = {
|
||||||
class PostgresIntegration {
|
class PostgresIntegration {
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
this.config = config
|
this.config = config
|
||||||
|
if (this.config.ssl.rejectUnauthorized) {
|
||||||
|
this.config.ssl.rejectUnauthorized =
|
||||||
|
this.config.ssl.rejectUnauthorized === "true" ? true : false
|
||||||
|
}
|
||||||
|
|
||||||
if (!pool) {
|
if (!pool) {
|
||||||
pool = new Pool(this.config)
|
pool = new Pool(this.config)
|
||||||
}
|
}
|
||||||
|
@ -65,7 +75,9 @@ class PostgresIntegration {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error(err)
|
throw new Error(err)
|
||||||
} finally {
|
} finally {
|
||||||
this.client.release()
|
if (this.client) {
|
||||||
|
this.client.release()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue