diff --git a/apps/studio/package.json b/apps/studio/package.json index 9585425ca..503306a10 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -11,7 +11,6 @@ "scripts": { "serve": "vue-cli-service serve", "test:unit": "TEST_MODE=1 ELECTRON_RUN_AS_NODE=1 yarn electron ../../node_modules/jest/bin/jest.js", - "test:integration": "TEST_MODE=1 ELECTRON_RUN_AS_NODE=1 yarn electron ../../node_modules/jest/bin/jest.js --config ./jest.integration.config.js", "lint": "vue-cli-service lint", "electron:build": "vue-cli-service electron:build", "electron:serve": "vue-cli-service electron:serve --host localhost --ozone-platform-hint=auto", diff --git a/apps/studio/src/lib/db/clients/oracle.ts b/apps/studio/src/lib/db/clients/oracle.ts index 8b622aa72..554569fbe 100644 --- a/apps/studio/src/lib/db/clients/oracle.ts +++ b/apps/studio/src/lib/db/clients/oracle.ts @@ -491,15 +491,18 @@ export class OracleClient extends BasicDatabaseClient { async connect() { const cliLocation = this.platformPath(this.server.config.instantClientLocation) - // https://oracle.github.io/node-oracledb/doc/api.html#-152-optional-oracle-net-configuration const configLocation = this.platformPath(this.server.config.oracleConfigLocation) + console.log("Connecting to oracle") + console.log("CLI LOCATION", cliLocation) + try { const payload = {} if (cliLocation) payload['libDir'] = cliLocation if (configLocation) payload['configDir'] = configLocation - oracle.initOracleClient(payload) + // oracle.initOracleClient(payload) + oracle.initOracleClient() oracle.fetchAsString = [oracle.CLOB] oracle.fetchAsBuffer = [oracle.BLOB] } catch { @@ -529,9 +532,9 @@ export class OracleClient extends BasicDatabaseClient { poolMax: 4, } } - + console.log("MAKING POOL") this.pool = await oracle.createPool(poolConfig) - + console.log("POOL MADE") const vSQL = ` SELECT BANNER as BANNER FROM v$version WHERE BANNER LIKE 'Oracle%'; diff --git a/apps/studio/tests/integration/lib/db/clients/oracle.spec.js b/apps/studio/tests/integration/lib/db/clients/oracle.spec.js index 22b15e914..38c39f5cb 100644 --- a/apps/studio/tests/integration/lib/db/clients/oracle.spec.js +++ b/apps/studio/tests/integration/lib/db/clients/oracle.spec.js @@ -13,6 +13,8 @@ describe("Oracle Tests", () => { beforeAll(async () => { // this is the testcontainers default startup wait time. + console.log("ENV/ORACLE CLI: ", process.env['ORACLE_CLI_PATH']) + console.log("ENV/LD_LIBRARY_PATH: ", process.env['LD_LIBRARY_PATH']) const timeoutDefault = 120000 jest.setTimeout(timeoutDefault) const localDir = path.resolve('./tests/docker/oracle_init') @@ -39,6 +41,7 @@ describe("Oracle Tests", () => { client: 'oracle', host: container.getHost(), port: container.getMappedPort(1521), + instantClientLocation: process.env['ORACLE_CLI_PATH'], user: 'beekeeper', password: 'password', serviceName: 'BEEKEEPER', @@ -46,6 +49,7 @@ describe("Oracle Tests", () => { connectionMethod: 'manual' } } + console.log("connecting with config", config) util = new DBTestUtil(config, "BEEKEEPER", { defaultSchema: 'BEEKEEPER', dialect: 'oracle' }) await util.setupdb() diff --git a/bin/get-instant-client.sh b/bin/get-instant-client.sh index caa4ff03c..1b82181cb 100755 --- a/bin/get-instant-client.sh +++ b/bin/get-instant-client.sh @@ -11,7 +11,8 @@ then else wget -q -O cli.zip \ https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-basic-linux.x64-21.6.0.0.0dbru.zip - + # wget -q -O cli.zip \ + # https://download.oracle.com/otn_software/linux/instantclient/23c/instantclient-basic-linux.x64-23.3.0.0.0.zip rm -rf $LOCATION/* unzip cli.zip -d $LOCATION fi diff --git a/bin/integration-tests.sh b/bin/integration-tests.sh index e12badf0d..9aacbe4c7 100755 --- a/bin/integration-tests.sh +++ b/bin/integration-tests.sh @@ -8,7 +8,8 @@ LOCATION="$BASE/.instant" eval "$BINBASE/get-instant-client.sh '$LOCATION'" -export LD_LIBRARY_PATH="$LOCATION/instantclient_21_6" +export ORACLE_CLI_PATH="$LOCATION/instantclient_21_6/" +export LD_LIBRARY_PATH="$ORACLE_CLI_PATH" export ELECTRON_RUN_AS_NODE=1 export TEST_MODE=1 diff --git a/docs/user_guide/connecting/oracle-database.md b/docs/user_guide/connecting/oracle-database.md index 122f6aec3..980a064fa 100644 --- a/docs/user_guide/connecting/oracle-database.md +++ b/docs/user_guide/connecting/oracle-database.md @@ -11,7 +11,16 @@ There are a number of ways you can connect to an Oracle database using Beekeeper 2. TSA alias 3. Host and port -## First set Oracle Instant Client location +## Prerequisites + +### Linux: Install libaio + +```bash +sudo apt-get install libaio1 libaio-dev #debian/ubuntu +sudo yum install libaio #redhat/fedora +``` + +### Download Oracle Instant Client Before you can connect to Oracle at all you need to tell Beekeeper where on your computer the Oracle Instant Client libraries are stored. This is a downloadable set of files provided by Oracle.