fix mssql encryption option

This commit is contained in:
Martin McKeaveney 2021-05-28 11:55:28 +01:00
parent faaf49c562
commit 09ce58aa95
3 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<script>
import { Label, Input, Layout } from "@budibase/bbui"
import { Label, Input, Layout, Toggle } from "@budibase/bbui"
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { capitalise } from "helpers"
@ -16,6 +16,11 @@
defaults={schema[configKey].default}
bind:object={integration[configKey]}
/>
{:else if schema[configKey].type === "boolean"}
<div class="form-row">
<Label>{capitalise(configKey)}</Label>
<Toggle text="" bind:value={integration[configKey]} />
</div>
{:else}
<div class="form-row">
<Label>{capitalise(configKey)}</Label>

View File

@ -6,6 +6,7 @@ exports.QUERY_TYPES = {
exports.FIELD_TYPES = {
STRING: "string",
BOOLEAN: "boolean",
NUMBER: "number",
PASSWORD: "password",
LIST: "list",

View File

@ -31,6 +31,10 @@ const SCHEMA = {
type: FIELD_TYPES.STRING,
default: "root",
},
encrypt: {
type: FIELD_TYPES.BOOLEAN,
default: true,
},
},
query: {
create: {
@ -51,6 +55,10 @@ const SCHEMA = {
class SqlServerIntegration {
constructor(config) {
this.config = config
this.config.options = {
encrypt: this.config.encrypt,
}
delete this.config.encrypt
if (!pool) {
pool = new sqlServer.ConnectionPool(this.config)
}