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 { UserCtx, Datasource, Row } from "@budibase/types"
|
||||
import sdk from "../../sdk"
|
||||
import { mergeConfigs } from "../../sdk/app/datasources/datasources"
|
||||
|
||||
export async function fetch(ctx: UserCtx) {
|
||||
// Get internal tables
|
||||
|
|
|
@ -26,7 +26,7 @@ interface MSSQLConfig {
|
|||
user: string
|
||||
password: string
|
||||
server: string
|
||||
port: number
|
||||
port: number | string
|
||||
database: string
|
||||
schema: string
|
||||
encrypt?: boolean
|
||||
|
@ -108,6 +108,9 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
|
|||
constructor(config: MSSQLConfig) {
|
||||
super(SqlClient.MS_SQL)
|
||||
this.config = config
|
||||
if (typeof this.config?.port === "string") {
|
||||
this.config.port = parseInt(this.config.port)
|
||||
}
|
||||
const clientCfg = {
|
||||
...this.config,
|
||||
options: {
|
||||
|
|
Loading…
Reference in New Issue