more types

This commit is contained in:
Martin McKeaveney 2024-11-19 19:16:10 +00:00
parent 70b9e4680f
commit 941aa181dd
2 changed files with 17 additions and 8 deletions

View File

@ -282,8 +282,13 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
const { domain, trustServerCertificate } =
this.config.ntlmConfig || {}
if (!domain) {
throw Error("Domain must be provided for NTLM config")
}
clientCfg.authentication = {
type: "ntlm",
// @ts-ignore
options: {
domain,
},

View File

@ -6,7 +6,7 @@ import {
QueryType,
SqlQuery,
} from "@budibase/types"
import snowflakeSdk from "snowflake-sdk"
import snowflakeSdk, { SnowflakeError } from "snowflake-sdk"
import { promisify } from "util"
interface SnowflakeConfig {
@ -89,16 +89,20 @@ class SnowflakePromise {
}
async execute(sql: string) {
if (!this.client) {
throw Error(
"No snowflake client present to execute query. Run connect() first to initialise."
)
}
return new Promise((resolve, reject) => {
if (!this.client) {
throw Error(
"No snowflake client present to execute query. Run connect() first to initialise."
)
}
this.client.execute({
sqlText: sql,
complete: function (err: Error, statementExecuted: string, rows: any) {
complete: function (
err: SnowflakeError | undefined,
statementExecuted: any,
rows: any
) {
if (err) {
return reject(err)
}