diff --git a/packages/server/src/integrations/microsoftSqlServer.ts b/packages/server/src/integrations/microsoftSqlServer.ts index 3f14360d57..4391dbd07e 100644 --- a/packages/server/src/integrations/microsoftSqlServer.ts +++ b/packages/server/src/integrations/microsoftSqlServer.ts @@ -121,6 +121,15 @@ class SqlServerIntegration extends Sql implements DatasourcePlus { } } + async testConnection() { + try { + await this.connect() + return true + } catch (e: any) { + return { error: e.message as string } + } + } + getBindingIdentifier(): string { return `@p${this.index++}` } @@ -310,18 +319,7 @@ class SqlServerIntegration extends Sql implements DatasourcePlus { } } -async function validateConnection(config: MSSQLConfig) { - const integration = new SqlServerIntegration(config) - try { - await integration.connect() - return true - } catch (e: any) { - return { error: e.message as string } - } -} - export default { schema: SCHEMA, integration: SqlServerIntegration, - validateConnection, }