Fix issue with MS-SQL, port needs to be a number for the node-mssql package, with env vars it isn't anymore.

This commit is contained in:
mike12345567 2023-02-10 11:54:16 +00:00
parent c85413ec72
commit f8ef06c849
2 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,6 @@ import { invalidateDynamicVariables } from "../../threads/utils"
import { db as dbCore, context, events } from "@budibase/backend-core" import { db as dbCore, context, events } from "@budibase/backend-core"
import { UserCtx, Datasource, Row } from "@budibase/types" import { UserCtx, Datasource, Row } from "@budibase/types"
import sdk from "../../sdk" import sdk from "../../sdk"
import { mergeConfigs } from "../../sdk/app/datasources/datasources"
export async function fetch(ctx: UserCtx) { export async function fetch(ctx: UserCtx) {
// Get internal tables // Get internal tables

View File

@ -26,7 +26,7 @@ interface MSSQLConfig {
user: string user: string
password: string password: string
server: string server: string
port: number port: number | string
database: string database: string
schema: string schema: string
encrypt?: boolean encrypt?: boolean
@ -108,6 +108,9 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
constructor(config: MSSQLConfig) { constructor(config: MSSQLConfig) {
super(SqlClient.MS_SQL) super(SqlClient.MS_SQL)
this.config = config this.config = config
if (typeof this.config?.port === "string") {
this.config.port = parseInt(this.config.port)
}
const clientCfg = { const clientCfg = {
...this.config, ...this.config,
options: { options: {