Skip to content

Instantly share code, notes, and snippets.

View cjbj's full-sized avatar

Christopher Jones cjbj

View GitHub Profile
@cjbj
cjbj / oracledb.js.diff
Last active November 22, 2017 21:30
improve require() failure messages
diff --git a/lib/oracledb.js b/lib/oracledb.js
index 10025481..869a6fb2 100644
--- a/lib/oracledb.js
+++ b/lib/oracledb.js
@@ -41,28 +41,32 @@ var binaryDebugPath = '../build/Debug/oracledb.node';
try {
oracledbCLib = require(binaryReleasePath);
} catch (err) {
- if (err.code !== 'MODULE_NOT_FOUND') {
- throw err;
@cjbj
cjbj / issue980c.js
Last active November 20, 2018 00:30
'use strict';
/*
In CDB: (insecure, not for production)
alter system set remote_os_authent=true scope=spfile;
In PDB create a user:
create user ops$oracle identified externally;
grant connect,resource to ops$oracle;
'use strict';
process.env.ORA_SDTZ = 'UTC';
const oracledb = require('oracledb');
let config;
try {
config = require('./dbconfig.js');
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND')
'use strict';
process.env.UV_THREADPOOL_SIZE = 5;
const myPoolSize = 5; // poolMin & poolMax;
const numStmts = 5; // number of statements to run in parallel
console.log('UV_THREADPOOL_SIZE :', process.env.UV_THREADPOOL_SIZE );
console.log('poolMin & poolMax :', myPoolSize);
console.log('number of selects to run :', numStmts);
@cjbj
cjbj / Makefile
Created March 19, 2020 00:56
go-oci8 issue 379
#IC=$(HOME)/instantclient_18_5
IC=$(HOME)/instantclient_19_6
OLIB=$(IC)
OINC=$(IC)/sdk/include
#OH=/u01/app/oracle/product/12.1.0/dbhome_1
#OLIB=$(OH)/lib
#OINC=$(OH)/rdbms/public
oracle_break: clean
const http = require('http');
const oracledb = require('oracledb');
const dbConfig = require('./dbconfig.js');
const httpPort = 7000;
async function init() {
try {
await oracledb.createPool(dbConfig);
cjones@localhost:~/go/src/github.com/godror/godror$ echo $(git log --pretty=format:'%h ' -n 1)
ac04606
cjones@localhost:~/go/src/github.com/godror/godror$ go test ./dsn
--- FAIL: TestParse (0.00s)
--- FAIL: TestParse/logfmt (0.00s)
dsn_test.go:213: user=user password=pass connectString=localhost/sid heterogeneousPool=1
dsn_test.go:220: parse of "user=user password=pass connectString=localhost/sid heterogeneousPool=1"
got
dsn.ConnectionParams{CommonParams:dsn.CommonParams{Username:"user", ConnectString:"", Password:dsn.Password{secret:"pass"}, ConfigDir:"", LibDir:"", OnInit:(func(driver.Conn) error)(nil), OnInitStmts:[]string(nil), AlterSession:[][2]string(nil), Timezone:(*time.Location)(0x732ce0), EnableEvents:false}, ConnParams:dsn.ConnParams{NewPassword:dsn.Password{secret:""}, ConnClass:"", IsSysDBA:false, IsSysOper:false, IsSysASM:false, IsPrelim:false, ShardingKey:[]interface {}(nil), SuperShardingKey:[]interface {}(nil)}, PoolParams:dsn.PoolParams{MinSession
const oracledb = require('oracledb');
const dbConfig = require('./dbconfig.js');
if (process.platform === 'darwin') {
oracledb.initOracleClient({libDir: process.env.HOME + '/Downloads/instantclient_19_8'});
}
let result;
async function run() {
@cjbj
cjbj / issue1391.patch
Created July 21, 2021 23:42
Patch for node-oracledb 5.2 issue #1391
diff --git a/lib/queryStream.js b/lib/queryStream.js
index 08ddc72..09efc99 100644
--- a/lib/queryStream.js
+++ b/lib/queryStream.js
@@ -89,11 +89,6 @@ class QueryStream extends Readable {
this._fetching = true;
this._resultSet._allowGetRowCall = true;
const row = await this._resultSet.getRow();
- this._fetching = false;
- if (!this._resultSet) {
@cjbj
cjbj / dbora
Last active March 9, 2022 02:11
#! /bin/sh -x
#
# This is my old script for auto-starting Oracle DB on Linux.
# When I'm not using Cloud Databases, I now install the Oracle Database 21c RPM which includes its own script
#
# chkconfig: 2345 80 05
# description: start and stop Oracle Databases
#
# OL7: systemctl enable dbora