Merge pull request #8062 from Budibase/fix/oracle-dev-fix
OracleDB development machine fix
This commit is contained in:
commit
04dac2e445
|
@ -57,7 +57,11 @@ const INTEGRATIONS: { [key: string]: any } = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// optionally add oracle integration if the oracle binary can be installed
|
// 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
|
DEFINITIONS[SourceName.ORACLE] = oracle.schema
|
||||||
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
|
INTEGRATIONS[SourceName.ORACLE] = oracle.integration
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,17 +15,22 @@ import {
|
||||||
getSqlQuery,
|
getSqlQuery,
|
||||||
SqlClient,
|
SqlClient,
|
||||||
} from "./utils"
|
} from "./utils"
|
||||||
import oracledb, {
|
import Sql from "./base/sql"
|
||||||
|
import { FieldTypes } from "../constants"
|
||||||
|
import {
|
||||||
BindParameters,
|
BindParameters,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionAttributes,
|
ConnectionAttributes,
|
||||||
ExecuteOptions,
|
ExecuteOptions,
|
||||||
Result,
|
Result,
|
||||||
} from "oracledb"
|
} from "oracledb"
|
||||||
import Sql from "./base/sql"
|
let oracledb: any
|
||||||
import { FieldTypes } from "../constants"
|
try {
|
||||||
|
oracledb = require("oracledb")
|
||||||
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT
|
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT
|
||||||
|
} catch (err) {
|
||||||
|
console.log("ORACLEDB is not installed")
|
||||||
|
}
|
||||||
|
|
||||||
interface OracleConfig {
|
interface OracleConfig {
|
||||||
host: string
|
host: string
|
||||||
|
@ -183,6 +188,10 @@ class OracleIntegration extends Sql implements DatasourcePlus {
|
||||||
return parts.join(" || ")
|
return parts.join(" || ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isInstalled() {
|
||||||
|
return oracledb != null
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map the flat tabular columns and constraints data into a nested object
|
* Map the flat tabular columns and constraints data into a nested object
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue