Merge pull request #10603 from Budibase/budi-6932/verify_snowflake

Verify snowflake connection
This commit is contained in:
Adria Navarro 2023-05-16 13:31:57 +02:00 committed by GitHub
commit 6b2db71f87
1 changed files with 13 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import {
ConnectionInfo,
DatasourceFeature,
Integration,
QueryType,
@ -71,6 +72,18 @@ class SnowflakeIntegration {
this.client = new Snowflake(config)
}
async testConnection(): Promise<ConnectionInfo> {
try {
await this.client.connect()
return { connected: true }
} catch (e: any) {
return {
connected: false,
error: e.message as string,
}
}
}
async internalQuery(query: SqlQuery) {
await this.client.connect()
try {