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:
parent
c85413ec72
commit
f8ef06c849
|
@ -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
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
Loading…
Reference in New Issue