Merge pull request #10603 from Budibase/budi-6932/verify_snowflake
Verify snowflake connection
This commit is contained in:
commit
6b2db71f87
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
ConnectionInfo,
|
||||||
DatasourceFeature,
|
DatasourceFeature,
|
||||||
Integration,
|
Integration,
|
||||||
QueryType,
|
QueryType,
|
||||||
|
@ -71,6 +72,18 @@ class SnowflakeIntegration {
|
||||||
this.client = new Snowflake(config)
|
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) {
|
async internalQuery(query: SqlQuery) {
|
||||||
await this.client.connect()
|
await this.client.connect()
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue