@pi-r/oracle 0.2.8 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/client/index.d.ts +2 -2
- package/client/index.js +4 -5
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright 2023
|
|
1
|
+
Copyright 2023 Studio Trigger
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/README.md
CHANGED
package/client/index.d.ts
CHANGED
package/client/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DB_SOURCE_TYPE = exports.DB_SOURCE_CLIENT = exports.checkTimeout = exports.executeBatchQuery = exports.executeQuery = exports.setCredential = void 0;
|
|
4
|
+
const oracledb = require("oracledb");
|
|
4
5
|
const util_1 = require("@e-mc/db/util");
|
|
5
6
|
const types_1 = require("@e-mc/types");
|
|
6
7
|
const Db = require("@e-mc/db");
|
|
@@ -125,7 +126,6 @@ async function setCredential(item) {
|
|
|
125
126
|
const poolKey = getPoolKey(credential);
|
|
126
127
|
if (poolKey) {
|
|
127
128
|
if (!(pool = POOL_STATE[poolKey]) || pool.closed) {
|
|
128
|
-
const { createPool } = require("oracledb");
|
|
129
129
|
const config = this.getPoolConfig("oracle", password);
|
|
130
130
|
if (config) {
|
|
131
131
|
const { min, max, idle, queue_max, queue_idle } = config;
|
|
@@ -145,7 +145,7 @@ async function setCredential(item) {
|
|
|
145
145
|
credential.queueTimeout ?? (credential.queueTimeout = queue_idle);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
new OraclePool(await createPool(credential), poolKey, username && password ? { username, password } : undefined).add(item).parent = POOL_STATE;
|
|
148
|
+
new OraclePool(await oracledb.createPool(credential), poolKey, username && password ? { username, password } : undefined).add(item).parent = POOL_STATE;
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
151
|
pool.add(item);
|
|
@@ -166,7 +166,6 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
166
166
|
if (length === 0) {
|
|
167
167
|
return [];
|
|
168
168
|
}
|
|
169
|
-
const db = require("oracledb");
|
|
170
169
|
let parallel, connectOnce, errorQuery, sessionKey, outCacheMiss;
|
|
171
170
|
if ((0, types_1.isPlainObject)(options)) {
|
|
172
171
|
({ parallel, connectOnce, errorQuery, sessionKey } = options);
|
|
@@ -227,7 +226,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
227
226
|
pool.connected = false;
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
|
-
clients.push(client || (client = await
|
|
229
|
+
clients.push(client || (client = await oracledb.getConnection((oracleCredential || credential))));
|
|
231
230
|
if (connectOnce) {
|
|
232
231
|
if (!parallel) {
|
|
233
232
|
oracleClient = client;
|
|
@@ -298,7 +297,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
298
297
|
if (oracleClient && parallel) {
|
|
299
298
|
oracleClient = undefined;
|
|
300
299
|
}
|
|
301
|
-
const executeOptions = { outFormat:
|
|
300
|
+
const executeOptions = { outFormat: oracledb.OUT_FORMAT_OBJECT, ...clientOptions, resultSet: false, autoCommit: true };
|
|
302
301
|
commandType = this.commandType.SELECT;
|
|
303
302
|
if (streamRow) {
|
|
304
303
|
const rows = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/oracle",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Oracle client driver for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"types": "client/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@e-mc/db": "^0.
|
|
25
|
-
"@e-mc/types": "^0.
|
|
26
|
-
"oracledb": "^
|
|
24
|
+
"@e-mc/db": "^0.6.1",
|
|
25
|
+
"@e-mc/types": "^0.6.1",
|
|
26
|
+
"oracledb": "^6.3.0"
|
|
27
27
|
}
|
|
28
28
|
}
|