1
0
Fork 0
mirror of synced 2024-07-01 04:21:06 +12:00

Merge pull request #8062 from Budibase/fix/oracle-dev-fix

OracleDB development machine fix
This commit is contained in:
Michael Drury 2022-09-30 15:48:40 +01:00 committed by GitHub
commit be5fb642e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 6 deletions

View file

@ -57,7 +57,11 @@ const INTEGRATIONS: { [key: string]: any } = {
}
// optionally add oracle integration if the oracle binary can be installed
if (process.arch && !process.arch.startsWith("arm")) {
if (
process.arch &&
!process.arch.startsWith("arm") &&
oracle.integration.isInstalled()
) {
DEFINITIONS[SourceName.ORACLE] = oracle.schema
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
}

View file

@ -15,17 +15,22 @@ import {
getSqlQuery,
SqlClient,
} from "./utils"
import oracledb, {
import Sql from "./base/sql"
import { FieldTypes } from "../constants"
import {
BindParameters,
Connection,
ConnectionAttributes,
ExecuteOptions,
Result,
} from "oracledb"
import Sql from "./base/sql"
import { FieldTypes } from "../constants"
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT
let oracledb: any
try {
oracledb = require("oracledb")
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT
} catch (err) {
console.log("ORACLEDB is not installed")
}
interface OracleConfig {
host: string
@ -183,6 +188,10 @@ class OracleIntegration extends Sql implements DatasourcePlus {
return parts.join(" || ")
}
static isInstalled() {
return oracledb != null
}
/**
* Map the flat tabular columns and constraints data into a nested object
*/