diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index 82d8382a31..73e41e1d79 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -8,6 +8,7 @@ import { Table, DatasourcePlus, DatasourceFeature, + ConnectionInfo, } from "@budibase/types" import { buildExternalTableId, @@ -21,7 +22,7 @@ import { FieldTypes } from "../constants" import { BindParameters, Connection, - ConnectionAttributes, + ConnectionAttributes, DBError, ExecuteOptions, Result, } from "oracledb" @@ -49,7 +50,7 @@ const SCHEMA: Integration = { type: "Relational", description: "Oracle Database is an object-relational database management system developed by Oracle Corporation", - features: [], + features: [DatasourceFeature.CONNECTION_CHECKING], datasource: { host: { type: DatasourceFieldType.STRING, @@ -322,6 +323,29 @@ class OracleIntegration extends Sql implements DatasourcePlus { this.schemaErrors = final.errors } + async testConnection() { + const response: ConnectionInfo = { + connected: false, + } + let connection + try { + connection = await this.getConnection() + } catch (err: any) { + response.connected = false + response.error = err.message + } finally { + if (connection) { + try { + await connection.close() + } catch (err: any) { + response.connected = false + response.error = err.message + } + } + } + return response + } + private async internalQuery(query: SqlQuery): Promise> { let connection try {