@zowe/db2-for-zowe-cli 6.1.17 → 6.1.18
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/README.md +12 -10
- package/lib/Db2PluginLifeCycle.d.ts +11 -9
- package/lib/Db2PluginLifeCycle.js +18 -13
- package/lib/Db2PluginLifeCycle.js.map +1 -1
- package/node_modules/axios/CHANGELOG.md +62 -0
- package/node_modules/axios/README.md +233 -5
- package/node_modules/axios/dist/axios.js +387 -89
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +458 -98
- package/node_modules/axios/dist/esm/axios.js +458 -98
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +568 -116
- package/node_modules/axios/index.d.cts +4 -0
- package/node_modules/axios/index.d.ts +4 -0
- package/node_modules/axios/lib/adapters/fetch.js +64 -11
- package/node_modules/axios/lib/adapters/http.js +134 -50
- package/node_modules/axios/lib/adapters/xhr.js +52 -3
- package/node_modules/axios/lib/core/Axios.js +19 -14
- package/node_modules/axios/lib/core/InterceptorManager.js +107 -8
- package/node_modules/axios/lib/core/buildFullPath.js +1 -13
- package/node_modules/axios/lib/core/dispatchRequest.js +8 -2
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/defaults/index.js +2 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +11 -1
- package/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +4 -2
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +182 -6
- package/node_modules/axios/lib/helpers/throttle.js +3 -2
- package/node_modules/axios/lib/helpers/toFormData.js +14 -21
- package/node_modules/axios/lib/utils.js +134 -13
- package/node_modules/axios/package.json +1 -1
- package/node_modules/ibm_db/APIDocumentation.md +2883 -2024
- package/node_modules/ibm_db/LICENSE +23 -23
- package/node_modules/ibm_db/README.md +735 -735
- package/node_modules/ibm_db/binding.gyp +99 -98
- package/node_modules/ibm_db/installer/driverInstall.js +984 -958
- package/node_modules/ibm_db/installer/ifx.sh +38 -38
- package/node_modules/ibm_db/installer/setenv.sh +23 -23
- package/node_modules/ibm_db/installer/testODBCConnection.bat +51 -51
- package/node_modules/ibm_db/installer/testODBCConnection.sh +61 -61
- package/node_modules/ibm_db/lib/climacros.js +431 -431
- package/node_modules/ibm_db/lib/odbc.js +4293 -3487
- package/node_modules/ibm_db/lib/simple-queue.js +41 -41
- package/node_modules/ibm_db/package.json +70 -70
- package/node_modules/ibm_db/src/odbc.cpp +1495 -1396
- package/node_modules/ibm_db/src/odbc.h +477 -473
- package/node_modules/ibm_db/src/odbc_connection.cpp +1762 -1612
- package/node_modules/ibm_db/src/odbc_connection.h +228 -215
- package/node_modules/ibm_db/src/odbc_result.cpp +1547 -1547
- package/node_modules/ibm_db/src/odbc_result.h +152 -152
- package/node_modules/ibm_db/src/odbc_statement.cpp +2047 -861
- package/node_modules/ibm_db/src/odbc_statement.h +257 -135
- package/node_modules/ibm_db/src/strptime.c +389 -389
- package/node_modules/ibm_db/src/strptime.h +46 -46
- package/node_modules/ibm_db/test/README +23 -23
- package/node_modules/ibm_db/test/bench-insert.js +62 -62
- package/node_modules/ibm_db/test/bench-insertBatch10.js +74 -74
- package/node_modules/ibm_db/test/bench-insertBatch100.js +75 -75
- package/node_modules/ibm_db/test/bench-insertBatch1000.js +75 -75
- package/node_modules/ibm_db/test/bench-insertBatch10000.js +75 -75
- package/node_modules/ibm_db/test/bench-prepare-bind-execute-closeSync.js +60 -60
- package/node_modules/ibm_db/test/bench-prepare-bind-executeNonQuery.js +53 -53
- package/node_modules/ibm_db/test/bench-prepare-bindSync-execute-closeSync.js +50 -50
- package/node_modules/ibm_db/test/bench-prepare-bindSync-executeNonQuery.js +48 -48
- package/node_modules/ibm_db/test/bench-prepare-execute-closeSync.js +51 -51
- package/node_modules/ibm_db/test/bench-prepare-executeNonQuery.js +47 -47
- package/node_modules/ibm_db/test/bench-prepare-not.js +43 -43
- package/node_modules/ibm_db/test/bench-query-fetch.js +59 -59
- package/node_modules/ibm_db/test/bench-query-fetchAll.js +49 -49
- package/node_modules/ibm_db/test/bench-query-fetchAllSync.js +43 -43
- package/node_modules/ibm_db/test/bench-query.js +40 -40
- package/node_modules/ibm_db/test/bench-querySync-fetchArray.js +28 -28
- package/node_modules/ibm_db/test/bench-querySync.js +29 -29
- package/node_modules/ibm_db/test/common.d.ts +10 -10
- package/node_modules/ibm_db/test/common.js +127 -127
- package/node_modules/ibm_db/test/config.json +7 -7
- package/node_modules/ibm_db/test/config.zos.json +4 -4
- package/node_modules/ibm_db/test/data/sample1.txt +9 -9
- package/node_modules/ibm_db/test/data/trc.fmt +30114 -30114
- package/node_modules/ibm_db/test/nodeEE-leak-huge-query.js +152 -152
- package/node_modules/ibm_db/test/nodeEE-leak-multiple-query-multiple-connections.js +148 -148
- package/node_modules/ibm_db/test/nodeEE-leak-multiple-query-pool-connections.js +154 -154
- package/node_modules/ibm_db/test/nodeEE-leak-multiple-query.js +133 -133
- package/node_modules/ibm_db/test/nodeEE-stress-async-waterfall-multiple-connections.js +174 -174
- package/node_modules/ibm_db/test/nodeEE-stress-async-waterfall.js +169 -169
- package/node_modules/ibm_db/test/nodeEE-stress-mixed-query-multiple-connections.js +159 -159
- package/node_modules/ibm_db/test/nodeEE-stress-mixed-query.js +148 -148
- package/node_modules/ibm_db/test/odbc-bench.c +123 -123
- package/node_modules/ibm_db/test/perfTest.js +53 -53
- package/node_modules/ibm_db/test/quick-example.sh +30 -30
- package/node_modules/ibm_db/test/quick-example.ts +80 -80
- package/node_modules/ibm_db/test/run-bench.js +96 -96
- package/node_modules/ibm_db/test/run-nodeEE.js +132 -132
- package/node_modules/ibm_db/test/run-tests.js +132 -138
- package/node_modules/ibm_db/test/sql-cli.js +28 -28
- package/node_modules/ibm_db/test/test-all-data-types.js +109 -109
- package/node_modules/ibm_db/test/test-array-insert.js +178 -178
- package/node_modules/ibm_db/test/test-async-await.js +105 -105
- package/node_modules/ibm_db/test/test-attributes.js +34 -34
- package/node_modules/ibm_db/test/test-bad-pool-connection-prepare-execute.js +57 -57
- package/node_modules/ibm_db/test/test-basic-test.js +138 -138
- package/node_modules/ibm_db/test/test-binary-array-insert.js +73 -73
- package/node_modules/ibm_db/test/test-blob-from-file.js +90 -90
- package/node_modules/ibm_db/test/test-blob-insert.js +144 -144
- package/node_modules/ibm_db/test/test-blob-stream-insert.js +321 -299
- package/node_modules/ibm_db/test/test-blob-to-file.js +370 -370
- package/node_modules/ibm_db/test/test-block-fetch.js +364 -364
- package/node_modules/ibm_db/test/test-blocking-issue210.js +123 -123
- package/node_modules/ibm_db/test/test-call-async.js +64 -64
- package/node_modules/ibm_db/test/test-call-stmt.js +53 -53
- package/node_modules/ibm_db/test/test-cancel.js +703 -0
- package/node_modules/ibm_db/test/test-chinese-char.js +59 -59
- package/node_modules/ibm_db/test/test-connection.js +306 -0
- package/node_modules/ibm_db/test/test-date.js +32 -32
- package/node_modules/ibm_db/test/test-dbclob.js +93 -93
- package/node_modules/ibm_db/test/test-decimals.js +135 -135
- package/node_modules/ibm_db/test/test-describe-metadata.js +148 -0
- package/node_modules/ibm_db/test/test-executeFile.js +167 -167
- package/node_modules/ibm_db/test/test-executeFileSync.js +85 -85
- package/node_modules/ibm_db/test/test-fetch-apis.js +146 -146
- package/node_modules/ibm_db/test/test-fetchN.js +130 -130
- package/node_modules/ibm_db/test/test-getinfo.js +197 -197
- package/node_modules/ibm_db/test/test-ibm-db-issue14.js +58 -58
- package/node_modules/ibm_db/test/test-ibm-db-issue17.js +54 -54
- package/node_modules/ibm_db/test/test-ibm-db-issue18.js +54 -54
- package/node_modules/ibm_db/test/test-issue-1059-fetchAll-undefined.js +67 -67
- package/node_modules/ibm_db/test/test-issue-1080-array-blob-insert.js +40 -0
- package/node_modules/ibm_db/test/test-issue-54.js +39 -39
- package/node_modules/ibm_db/test/test-issue-get-column-value-2.js +44 -44
- package/node_modules/ibm_db/test/test-issue211.js +80 -80
- package/node_modules/ibm_db/test/test-issue253.js +39 -39
- package/node_modules/ibm_db/test/test-max-pool-size.js +96 -96
- package/node_modules/ibm_db/test/test-memory-leaks-new-objects.js +32 -32
- package/node_modules/ibm_db/test/test-multi-open-query-close.js +75 -75
- package/node_modules/ibm_db/test/test-param-put-data.js +713 -0
- package/node_modules/ibm_db/test/test-pool-idle-connection.js +72 -72
- package/node_modules/ibm_db/test/test-pool-operations.js +325 -0
- package/node_modules/ibm_db/test/test-pool-stale-connections.js +111 -111
- package/node_modules/ibm_db/test/test-pool-uncommited.js +33 -33
- package/node_modules/ibm_db/test/test-prepare-execute.js +339 -0
- package/node_modules/ibm_db/test/test-prepareSync-multiple-execution.js +93 -93
- package/node_modules/ibm_db/test/test-primary-foreign-keys.js +246 -0
- package/node_modules/ibm_db/test/test-procedures.js +243 -0
- package/node_modules/ibm_db/test/test-promise-all-data-types.js +42 -42
- package/node_modules/ibm_db/test/test-query-operations.js +405 -0
- package/node_modules/ibm_db/test/test-quick-example.js +25 -25
- package/node_modules/ibm_db/test/test-row-array-insert.js +167 -167
- package/node_modules/ibm_db/test/test-sp-array.js +54 -54
- package/node_modules/ibm_db/test/test-sp-dbc-6000.js +88 -88
- package/node_modules/ibm_db/test/test-sp-memleak.js +136 -136
- package/node_modules/ibm_db/test/test-sp-resultset-execute.js +269 -269
- package/node_modules/ibm_db/test/test-sp-resultset.js +228 -228
- package/node_modules/ibm_db/test/test-transactions.js +261 -0
- package/node_modules/ibm_db/test/test-typescript.js +48 -48
- package/node_modules/ibm_db/test/test-xml-datatype.js +70 -70
- package/node_modules/ibm_db/test/testWebApp.js +56 -56
- package/node_modules/ibm_db/test/trace +51 -51
- package/node_modules/ibm_db/test/typescript-apis-test.js +978 -978
- package/node_modules/ibm_db/test/webapp.html +17 -17
- package/node_modules/ibm_db/test/webapp.js +79 -79
- package/node_modules/ibm_db/typescript/README.md +28 -28
- package/node_modules/ibm_db/typescript/dist/Database.d.ts +26 -0
- package/node_modules/ibm_db/typescript/dist/ODBCStatement.d.ts +93 -0
- package/package.json +10 -6
- package/node_modules/ibm_db/test/disabled/test-binding-statement-rebinding.js +0 -59
- package/node_modules/ibm_db/test/disabled/test-open-dont-close.js +0 -12
- package/node_modules/ibm_db/test/disabled/test-param-select-with-booleans-only.js +0 -21
- package/node_modules/ibm_db/test/disabled/test-param-select-with-decimals-only.js +0 -20
- package/node_modules/ibm_db/test/disabled/test-param-select-with-null.js +0 -21
- package/node_modules/ibm_db/test/disabled/test-param-select-with-nulls-mixed.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-param-select-with-numbers-mixed.js +0 -22
- package/node_modules/ibm_db/test/disabled/test-param-select-with-numbers-only.js +0 -24
- package/node_modules/ibm_db/test/disabled/test-param-select-with-strings-only.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-param-select-with-unicode.js +0 -15
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-execute-closeSync.js +0 -62
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-execute-error.js +0 -49
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-execute-long-string.js +0 -63
- package/node_modules/ibm_db/test/disabled/test-prepare-bind-executeNonQuery.js +0 -63
- package/node_modules/ibm_db/test/disabled/test-prepare-bindSync-execute-closeSync.js +0 -46
- package/node_modules/ibm_db/test/disabled/test-prepare-bindSync-executeNonQuery.js +0 -50
- package/node_modules/ibm_db/test/disabled/test-prepare.js +0 -34
- package/node_modules/ibm_db/test/disabled/test-prepareSync.js +0 -29
- package/node_modules/ibm_db/test/disabled/test-query-select-fetchAll.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-query-select-fetchAllSync.js +0 -23
- package/node_modules/ibm_db/test/disabled/test-query-select-unicode.js +0 -15
- package/node_modules/ibm_db/test/disabled/test-querySync-select-unicode.js +0 -20
- package/node_modules/ibm_db/test/test-affected-rows.js +0 -55
- package/node_modules/ibm_db/test/test-bad-connection-string.js +0 -30
- package/node_modules/ibm_db/test/test-binding-connection-timeOut.js +0 -31
- package/node_modules/ibm_db/test/test-binding-statement-executeSync.js +0 -84
- package/node_modules/ibm_db/test/test-binding-transaction-commit.js +0 -79
- package/node_modules/ibm_db/test/test-binding-transaction-commitSync.js +0 -53
- package/node_modules/ibm_db/test/test-closed.js +0 -14
- package/node_modules/ibm_db/test/test-connection-object.js +0 -16
- package/node_modules/ibm_db/test/test-describe-column.js +0 -92
- package/node_modules/ibm_db/test/test-describe-database.js +0 -18
- package/node_modules/ibm_db/test/test-describe-table.js +0 -31
- package/node_modules/ibm_db/test/test-domains-open.js +0 -19
- package/node_modules/ibm_db/test/test-global-open-close.js +0 -11
- package/node_modules/ibm_db/test/test-instantiate-one-and-end.js +0 -9
- package/node_modules/ibm_db/test/test-multi-open-close.js +0 -45
- package/node_modules/ibm_db/test/test-multi-openSync-closeSync.js +0 -52
- package/node_modules/ibm_db/test/test-open-close.js +0 -29
- package/node_modules/ibm_db/test/test-open-connectTimeout.js +0 -33
- package/node_modules/ibm_db/test/test-openSync.js +0 -31
- package/node_modules/ibm_db/test/test-pool-close.js +0 -120
- package/node_modules/ibm_db/test/test-pool-connect.js +0 -36
- package/node_modules/ibm_db/test/test-pool-rollbackTransaction.js +0 -35
- package/node_modules/ibm_db/test/test-prepareSync-bad-sql.js +0 -34
- package/node_modules/ibm_db/test/test-promise-open-close.js +0 -33
- package/node_modules/ibm_db/test/test-query-create-table-fetchSync.js +0 -23
- package/node_modules/ibm_db/test/test-query-create-table.js +0 -12
- package/node_modules/ibm_db/test/test-query-drop-table.js +0 -13
- package/node_modules/ibm_db/test/test-query-insert.js +0 -38
- package/node_modules/ibm_db/test/test-query-select-fetch.js +0 -21
- package/node_modules/ibm_db/test/test-query-select-fetchMode-array.js +0 -17
- package/node_modules/ibm_db/test/test-query-select.js +0 -64
- package/node_modules/ibm_db/test/test-queryResult.js +0 -35
- package/node_modules/ibm_db/test/test-queryStream.js +0 -43
- package/node_modules/ibm_db/test/test-querySync-select-with-exception.js +0 -25
- package/node_modules/ibm_db/test/test-querySync-select.js +0 -28
- package/node_modules/ibm_db/test/test-require-and-end.js +0 -8
- package/node_modules/ibm_db/test/test-statement-close.js +0 -118
- package/node_modules/ibm_db/test/test-transaction-commit-sync.js +0 -54
- package/node_modules/ibm_db/test/test-transaction-commit.js +0 -79
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Node.js App</title>
|
|
5
|
-
</head>
|
|
6
|
-
<body>
|
|
7
|
-
|
|
8
|
-
<h1>Click on link to display image.</h1>
|
|
9
|
-
<a href="#">HOME</a>
|
|
10
|
-
<BR>
|
|
11
|
-
<p><a href="/1" target="iframe_a">Show Image1</a>
|
|
12
|
-
<a href="/2" target="iframe_a">Show Image2</a></p>
|
|
13
|
-
<iframe height="200px" width="30%" src="" name="iframe_a"></iframe>
|
|
14
|
-
<BR>
|
|
15
|
-
</body>
|
|
16
|
-
</html>
|
|
17
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Node.js App</title>
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
|
|
8
|
+
<h1>Click on link to display image.</h1>
|
|
9
|
+
<a href="#">HOME</a>
|
|
10
|
+
<BR>
|
|
11
|
+
<p><a href="/1" target="iframe_a">Show Image1</a>
|
|
12
|
+
<a href="/2" target="iframe_a">Show Image2</a></p>
|
|
13
|
+
<iframe height="200px" width="30%" src="" name="iframe_a"></iframe>
|
|
14
|
+
<BR>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
17
|
+
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
var ibmdb = require("../")
|
|
2
|
-
, common = require("./common")
|
|
3
|
-
, pool = new ibmdb.Pool()
|
|
4
|
-
, app = require('express')()
|
|
5
|
-
, cn = common.connectionString
|
|
6
|
-
, requestNo = 0
|
|
7
|
-
, img1 = "data/pushpa.jpg"
|
|
8
|
-
, img2 = "data/panda.jpg"
|
|
9
|
-
;
|
|
10
|
-
|
|
11
|
-
app.disable('x-powered-by');
|
|
12
|
-
//ibmdb.debug(true);
|
|
13
|
-
pool.init(5, cn);
|
|
14
|
-
function getConnection() {
|
|
15
|
-
var conn;
|
|
16
|
-
pool.open(cn, function(err, connection) {
|
|
17
|
-
if(err) return console.log(err);
|
|
18
|
-
conn = connection;
|
|
19
|
-
});
|
|
20
|
-
return conn;
|
|
21
|
-
}
|
|
22
|
-
pool.open(cn, function(err, conn) {
|
|
23
|
-
if(err) {
|
|
24
|
-
console.log(err);
|
|
25
|
-
exit(1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
try{
|
|
29
|
-
conn.querySync("drop table imgtab");
|
|
30
|
-
} catch (e) {};
|
|
31
|
-
try{
|
|
32
|
-
conn.querySync("create table imgtab (id int, filename varchar(50), image BLOB(200K))");
|
|
33
|
-
} catch (e) {};
|
|
34
|
-
|
|
35
|
-
conn.prepare("insert into imgtab (id, filename, image) values(?, ? , ?)", function(err, stmt){
|
|
36
|
-
if(err) return console.log(err);
|
|
37
|
-
stmt.execute([1, 'img1.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img1}],
|
|
38
|
-
function(err, result){
|
|
39
|
-
if(err) return console.log(err);
|
|
40
|
-
console.log("image 1 inserted.");
|
|
41
|
-
stmt.execute([2, 'img2.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img2}],
|
|
42
|
-
function(err, result){
|
|
43
|
-
if(err) return console.log(err);
|
|
44
|
-
else {result.closeSync();
|
|
45
|
-
console.log("image 2 inserted.");}
|
|
46
|
-
conn.close(function(){console.log("done.");});
|
|
47
|
-
console.log("App is running on localhost:3000 ");
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
app.listen(3000);
|
|
54
|
-
|
|
55
|
-
app.get('/', function(req, res) {
|
|
56
|
-
res.sendFile('webapp.html', {root: __dirname });
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
app.get('/:id', function(req, res) {
|
|
60
|
-
var imgid = req.params.id;
|
|
61
|
-
var no = ++requestNo;
|
|
62
|
-
console.log("Received id = " + imgid + " for request no "+no);
|
|
63
|
-
if(imgid != parseInt(imgid)) return console.log("id is not int.");
|
|
64
|
-
var conn = getConnection();
|
|
65
|
-
if(typeof(conn) !== 'object') { console.log("Invalid connection..");res.send(conn); res.end(); }
|
|
66
|
-
else
|
|
67
|
-
conn.query("SELECT id, filename, image FROM imgtab WHERE id=?", [imgid], function(err, rows) {
|
|
68
|
-
if(err){
|
|
69
|
-
return console.log(err);
|
|
70
|
-
} else {
|
|
71
|
-
res.set('Content-Type', 'image/jpeg');
|
|
72
|
-
res.send(Buffer.from(rows[0].IMAGE, 'binary'));
|
|
73
|
-
res.end();
|
|
74
|
-
console.log("File "+ rows[0].FILENAME + " sent for request no = "+no+", id = "+ imgid);
|
|
75
|
-
conn.close(function(){console.log("Done for request ", no);});
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
})
|
|
79
|
-
|
|
1
|
+
var ibmdb = require("../")
|
|
2
|
+
, common = require("./common")
|
|
3
|
+
, pool = new ibmdb.Pool()
|
|
4
|
+
, app = require('express')()
|
|
5
|
+
, cn = common.connectionString
|
|
6
|
+
, requestNo = 0
|
|
7
|
+
, img1 = "data/pushpa.jpg"
|
|
8
|
+
, img2 = "data/panda.jpg"
|
|
9
|
+
;
|
|
10
|
+
|
|
11
|
+
app.disable('x-powered-by');
|
|
12
|
+
//ibmdb.debug(true);
|
|
13
|
+
pool.init(5, cn);
|
|
14
|
+
function getConnection() {
|
|
15
|
+
var conn;
|
|
16
|
+
pool.open(cn, function(err, connection) {
|
|
17
|
+
if(err) return console.log(err);
|
|
18
|
+
conn = connection;
|
|
19
|
+
});
|
|
20
|
+
return conn;
|
|
21
|
+
}
|
|
22
|
+
pool.open(cn, function(err, conn) {
|
|
23
|
+
if(err) {
|
|
24
|
+
console.log(err);
|
|
25
|
+
exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
try{
|
|
29
|
+
conn.querySync("drop table imgtab");
|
|
30
|
+
} catch (e) {};
|
|
31
|
+
try{
|
|
32
|
+
conn.querySync("create table imgtab (id int, filename varchar(50), image BLOB(200K))");
|
|
33
|
+
} catch (e) {};
|
|
34
|
+
|
|
35
|
+
conn.prepare("insert into imgtab (id, filename, image) values(?, ? , ?)", function(err, stmt){
|
|
36
|
+
if(err) return console.log(err);
|
|
37
|
+
stmt.execute([1, 'img1.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img1}],
|
|
38
|
+
function(err, result){
|
|
39
|
+
if(err) return console.log(err);
|
|
40
|
+
console.log("image 1 inserted.");
|
|
41
|
+
stmt.execute([2, 'img2.jpg', {ParamType:"FILE", DataType:"BLOB", Data:img2}],
|
|
42
|
+
function(err, result){
|
|
43
|
+
if(err) return console.log(err);
|
|
44
|
+
else {result.closeSync();
|
|
45
|
+
console.log("image 2 inserted.");}
|
|
46
|
+
conn.close(function(){console.log("done.");});
|
|
47
|
+
console.log("App is running on localhost:3000 ");
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
app.listen(3000);
|
|
54
|
+
|
|
55
|
+
app.get('/', function(req, res) {
|
|
56
|
+
res.sendFile('webapp.html', {root: __dirname });
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
app.get('/:id', function(req, res) {
|
|
60
|
+
var imgid = req.params.id;
|
|
61
|
+
var no = ++requestNo;
|
|
62
|
+
console.log("Received id = " + imgid + " for request no "+no);
|
|
63
|
+
if(imgid != parseInt(imgid)) return console.log("id is not int.");
|
|
64
|
+
var conn = getConnection();
|
|
65
|
+
if(typeof(conn) !== 'object') { console.log("Invalid connection..");res.send(conn); res.end(); }
|
|
66
|
+
else
|
|
67
|
+
conn.query("SELECT id, filename, image FROM imgtab WHERE id=?", [imgid], function(err, rows) {
|
|
68
|
+
if(err){
|
|
69
|
+
return console.log(err);
|
|
70
|
+
} else {
|
|
71
|
+
res.set('Content-Type', 'image/jpeg');
|
|
72
|
+
res.send(Buffer.from(rows[0].IMAGE, 'binary'));
|
|
73
|
+
res.end();
|
|
74
|
+
console.log("File "+ rows[0].FILENAME + " sent for request no = "+no+", id = "+ imgid);
|
|
75
|
+
conn.close(function(){console.log("Done for request ", no);});
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
})
|
|
79
|
+
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# Typescript types
|
|
2
|
-
|
|
3
|
-
## Building the types
|
|
4
|
-
|
|
5
|
-
The types are written as standard Typescript code (.ts files). After making any changes, be sure to
|
|
6
|
-
run `npm run build:types` to build the types and populate the dist/ folder before publishing
|
|
7
|
-
the npm module.
|
|
8
|
-
|
|
9
|
-
## New APIs
|
|
10
|
-
|
|
11
|
-
### ODBCResult
|
|
12
|
-
|
|
13
|
-
- **fetchN(count, options?, cb?)** — Fetch up to `count` rows at a time (block fetch). Returns an array of rows. Supports callback and Promise styles.
|
|
14
|
-
- **fetchNSync(count, options?)** — Synchronous version of `fetchN`.
|
|
15
|
-
- **bindFileToCol(colNum, filePath, fileOption?, cb?)** — Bind a LOB column to an output file for direct file I/O during fetch. Supports callback and Promise styles.
|
|
16
|
-
- **bindFileToColSync(colNum, filePath, fileOption?)** — Synchronous version of `bindFileToCol`.
|
|
17
|
-
|
|
18
|
-
### Chunked LOB Insert (SQLPutData)
|
|
19
|
-
|
|
20
|
-
The `Data` field of `SQLParamObject` now accepts:
|
|
21
|
-
- **`Buffer[]`** — Array of Buffers for chunked LOB insert (sync and async). Each Buffer is sent as a separate chunk via SQLPutData.
|
|
22
|
-
- **`Readable`** — A Readable stream for chunked LOB insert (async only). Stream data is collected into chunks before sending.
|
|
23
|
-
|
|
24
|
-
### File Option Constants (attributes.ts)
|
|
25
|
-
|
|
26
|
-
- `SQL_FILE_READ` (2) — Used internally for input file parameters.
|
|
27
|
-
- `SQL_FILE_CREATE` (8) — Create new file; fail if it already exists.
|
|
28
|
-
- `SQL_FILE_OVERWRITE` (16) — Create or overwrite the file (default for `bindFileToCol`).
|
|
1
|
+
# Typescript types
|
|
2
|
+
|
|
3
|
+
## Building the types
|
|
4
|
+
|
|
5
|
+
The types are written as standard Typescript code (.ts files). After making any changes, be sure to
|
|
6
|
+
run `npm run build:types` to build the types and populate the dist/ folder before publishing
|
|
7
|
+
the npm module.
|
|
8
|
+
|
|
9
|
+
## New APIs
|
|
10
|
+
|
|
11
|
+
### ODBCResult
|
|
12
|
+
|
|
13
|
+
- **fetchN(count, options?, cb?)** — Fetch up to `count` rows at a time (block fetch). Returns an array of rows. Supports callback and Promise styles.
|
|
14
|
+
- **fetchNSync(count, options?)** — Synchronous version of `fetchN`.
|
|
15
|
+
- **bindFileToCol(colNum, filePath, fileOption?, cb?)** — Bind a LOB column to an output file for direct file I/O during fetch. Supports callback and Promise styles.
|
|
16
|
+
- **bindFileToColSync(colNum, filePath, fileOption?)** — Synchronous version of `bindFileToCol`.
|
|
17
|
+
|
|
18
|
+
### Chunked LOB Insert (SQLPutData)
|
|
19
|
+
|
|
20
|
+
The `Data` field of `SQLParamObject` now accepts:
|
|
21
|
+
- **`Buffer[]`** — Array of Buffers for chunked LOB insert (sync and async). Each Buffer is sent as a separate chunk via SQLPutData.
|
|
22
|
+
- **`Readable`** — A Readable stream for chunked LOB insert (async only). Stream data is collected into chunks before sending.
|
|
23
|
+
|
|
24
|
+
### File Option Constants (attributes.ts)
|
|
25
|
+
|
|
26
|
+
- `SQL_FILE_READ` (2) — Used internally for input file parameters.
|
|
27
|
+
- `SQL_FILE_CREATE` (8) — Create new file; fail if it already exists.
|
|
28
|
+
- `SQL_FILE_OVERWRITE` (16) — Create or overwrite the file (default for `bindFileToCol`).
|
|
29
29
|
- `SQL_FILE_APPEND` (32) — Append LOB data to an existing file.
|
|
@@ -93,6 +93,18 @@ export declare class Database {
|
|
|
93
93
|
columns(catalog: string | null, schema: string | null, table: string | null, column: string | null): Promise<SQLResults | null>;
|
|
94
94
|
tables(catalog: string | null, schema: string | null, table: string | null, type: string | null, cb: (err: null | DB2Error, res: SQLResults | null, errInColumnsCall?: false) => void): void;
|
|
95
95
|
tables(catalog: string | null, schema: string | null, table: string | null, type: string | null): Promise<SQLResults | null>;
|
|
96
|
+
primaryKeys(catalog: string | null, schema: string | null, table: string, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
97
|
+
primaryKeys(catalog: string | null, schema: string | null, table: string): Promise<object[]>;
|
|
98
|
+
primaryKeysSync(catalog: string | null, schema: string | null, table: string): object[];
|
|
99
|
+
foreignKeys(pkCatalog: string | null, pkSchema: string | null, pkTable: string | null, fkCatalog: string | null, fkSchema: string | null, fkTable: string | null, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
100
|
+
foreignKeys(pkCatalog: string | null, pkSchema: string | null, pkTable: string | null, fkCatalog: string | null, fkSchema: string | null, fkTable: string | null): Promise<object[]>;
|
|
101
|
+
foreignKeysSync(pkCatalog: string | null, pkSchema: string | null, pkTable: string | null, fkCatalog: string | null, fkSchema: string | null, fkTable: string | null): object[];
|
|
102
|
+
procedures(catalog: string | null, schema: string | null, procedure: string | null, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
103
|
+
procedures(catalog: string | null, schema: string | null, procedure: string | null): Promise<object[]>;
|
|
104
|
+
proceduresSync(catalog: string | null, schema: string | null, procedure: string | null): object[];
|
|
105
|
+
procedureColumns(catalog: string | null, schema: string | null, procedure: string | null, column: string | null, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
106
|
+
procedureColumns(catalog: string | null, schema: string | null, procedure: string | null, column: string | null): Promise<object[]>;
|
|
107
|
+
procedureColumnsSync(catalog: string | null, schema: string | null, procedure: string | null, column: string | null): object[];
|
|
96
108
|
describe(obj: DescribeObject, cb: (err: null | DB2Error, res: SQLResults | null, errInColumnsCall?: false) => void): void;
|
|
97
109
|
describe(obj: DescribeObject): Promise<SQLResults | null>;
|
|
98
110
|
prepare(sql: string, cb: (err: DB2Error | null, stmt: ODBCStatement) => void): void;
|
|
@@ -113,4 +125,18 @@ export declare class Database {
|
|
|
113
125
|
setAttr(attr: number | string, value: number | null | string, cb: (err: DB2Error | null, res?: true) => void): void;
|
|
114
126
|
setAttr(attr: number | string, value: number | null | string): Promise<true>;
|
|
115
127
|
setAttrSync(attr: number, value: number | null | string): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Cancel an executing SQL statement on the specified statement handle.
|
|
130
|
+
* Calls SQLCancel ODBC API.
|
|
131
|
+
* @param statement - The statement object to cancel
|
|
132
|
+
* @param cb - Optional callback. If not provided, returns a Promise.
|
|
133
|
+
*/
|
|
134
|
+
cancel(statement: ODBCStatement, cb: (err: DB2Error | null, result?: boolean) => void): void;
|
|
135
|
+
cancel(statement: ODBCStatement): Promise<boolean>;
|
|
136
|
+
/**
|
|
137
|
+
* Synchronous version of cancel.
|
|
138
|
+
* @param statement - The statement object to cancel
|
|
139
|
+
* @returns true on success
|
|
140
|
+
*/
|
|
141
|
+
cancelSync(statement: ODBCStatement): boolean | Error;
|
|
116
142
|
}
|
|
@@ -30,4 +30,97 @@ export declare class ODBCStatement {
|
|
|
30
30
|
close(closeOption: number, cb: (err: DB2Error | null) => void): void;
|
|
31
31
|
close(cb: (err: DB2Error | null) => void): void;
|
|
32
32
|
close(closeOption?: number): Promise<false>;
|
|
33
|
+
primaryKeys(catalog: string | null, schema: string | null, table: string, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
34
|
+
primaryKeys(catalog: string | null, schema: string | null, table: string): Promise<object[]>;
|
|
35
|
+
primaryKeysSync(catalog: string | null, schema: string | null, table: string): object[];
|
|
36
|
+
foreignKeys(pkCatalog: string | null, pkSchema: string | null, pkTable: string | null, fkCatalog: string | null, fkSchema: string | null, fkTable: string | null, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
37
|
+
foreignKeys(pkCatalog: string | null, pkSchema: string | null, pkTable: string | null, fkCatalog: string | null, fkSchema: string | null, fkTable: string | null): Promise<object[]>;
|
|
38
|
+
foreignKeysSync(pkCatalog: string | null, pkSchema: string | null, pkTable: string | null, fkCatalog: string | null, fkSchema: string | null, fkTable: string | null): object[];
|
|
39
|
+
procedures(catalog: string | null, schema: string | null, procedure: string | null, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
40
|
+
procedures(catalog: string | null, schema: string | null, procedure: string | null): Promise<object[]>;
|
|
41
|
+
proceduresSync(catalog: string | null, schema: string | null, procedure: string | null): object[];
|
|
42
|
+
procedureColumns(catalog: string | null, schema: string | null, procedure: string | null, column: string | null, cb: (err: DB2Error | null, rows?: object[]) => void): void;
|
|
43
|
+
procedureColumns(catalog: string | null, schema: string | null, procedure: string | null, column: string | null): Promise<object[]>;
|
|
44
|
+
procedureColumnsSync(catalog: string | null, schema: string | null, procedure: string | null, column: string | null): object[];
|
|
45
|
+
/**
|
|
46
|
+
* Result object returned by paramData/paramDataSync
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* Get next parameter for which a data value is needed.
|
|
50
|
+
* Used with putData for sending large data in chunks.
|
|
51
|
+
*/
|
|
52
|
+
paramData(cb: (err: DB2Error | null, result?: ParamDataResult) => void): void;
|
|
53
|
+
paramData(): Promise<ParamDataResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Synchronously get next parameter for which a data value is needed.
|
|
56
|
+
*/
|
|
57
|
+
paramDataSync(): ParamDataResult;
|
|
58
|
+
/**
|
|
59
|
+
* Send data value for a parameter.
|
|
60
|
+
* Used with paramData for sending large data in chunks.
|
|
61
|
+
*/
|
|
62
|
+
putData(data: Buffer | string | null, length: number, cb: (err: DB2Error | null, result?: boolean) => void): void;
|
|
63
|
+
putData(data: Buffer | string | null, cb: (err: DB2Error | null, result?: boolean) => void): void;
|
|
64
|
+
putData(data: Buffer | string | null, length?: number): Promise<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Synchronously send data value for a parameter.
|
|
67
|
+
*/
|
|
68
|
+
putDataSync(data: Buffer | string | null, length?: number): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Execute the prepared statement for streaming.
|
|
71
|
+
* Does NOT auto-complete the data-at-execution loop.
|
|
72
|
+
* Returns { needsData: boolean } to indicate if paramData/putData calls are required.
|
|
73
|
+
*/
|
|
74
|
+
executeForStreaming(cb: (err: DB2Error | null, result?: ExecuteStreamingResult) => void): void;
|
|
75
|
+
executeForStreaming(): Promise<ExecuteStreamingResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Synchronous version of executeForStreaming.
|
|
78
|
+
*/
|
|
79
|
+
executeForStreamingSync(): ExecuteStreamingResult;
|
|
80
|
+
/**
|
|
81
|
+
* High-level streaming helper.
|
|
82
|
+
* Executes the statement and streams data from a Readable stream
|
|
83
|
+
* to a data-at-execution parameter without buffering.
|
|
84
|
+
*/
|
|
85
|
+
executeWithStream(streamParamIndex: number, stream: NodeJS.ReadableStream, cb: (err: DB2Error | null, result?: StreamResult) => void): void;
|
|
86
|
+
executeWithStream(stream: NodeJS.ReadableStream, cb: (err: DB2Error | null, result?: StreamResult) => void): void;
|
|
87
|
+
executeWithStream(streamParamIndex: number, stream: NodeJS.ReadableStream): Promise<StreamResult>;
|
|
88
|
+
executeWithStream(stream: NodeJS.ReadableStream): Promise<StreamResult>;
|
|
89
|
+
/**
|
|
90
|
+
* Cancel this executing SQL statement.
|
|
91
|
+
* Calls SQLCancel ODBC API.
|
|
92
|
+
* @param cb - Optional callback. If not provided, returns a Promise.
|
|
93
|
+
*/
|
|
94
|
+
cancel(cb: (err: DB2Error | null, result?: boolean) => void): void;
|
|
95
|
+
cancel(): Promise<boolean>;
|
|
96
|
+
/**
|
|
97
|
+
* Synchronous version of cancel.
|
|
98
|
+
* @returns true on success
|
|
99
|
+
*/
|
|
100
|
+
cancelSync(): boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Result object returned by executeForStreaming/executeForStreamingSync
|
|
104
|
+
*/
|
|
105
|
+
export interface ExecuteStreamingResult {
|
|
106
|
+
/** True if data-at-execution parameters need data via paramData/putData */
|
|
107
|
+
needsData: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Result object returned by executeWithStream
|
|
111
|
+
*/
|
|
112
|
+
export interface StreamResult {
|
|
113
|
+
/** True if streaming was performed */
|
|
114
|
+
streamed: boolean;
|
|
115
|
+
/** Index of the parameter that received streamed data */
|
|
116
|
+
paramIndex?: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Result object returned by paramData/paramDataSync
|
|
120
|
+
*/
|
|
121
|
+
export interface ParamDataResult {
|
|
122
|
+
/** True if SQL_NEED_DATA was returned, meaning more data is needed */
|
|
123
|
+
needsData: boolean;
|
|
124
|
+
/** The parameter index that needs data (only set when needsData is true) */
|
|
125
|
+
paramIndex: number | null;
|
|
33
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zowe/db2-for-zowe-cli",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.18",
|
|
4
4
|
"description": "IBM® Db2® Plug-in for Zowe CLI",
|
|
5
5
|
"author": "Zowe",
|
|
6
6
|
"license": "EPL-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"configurationModule": "lib/imperative.js"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"ibm_db": "4.0
|
|
39
|
+
"ibm_db": "4.1.0"
|
|
40
40
|
},
|
|
41
41
|
"bundleDependencies": [
|
|
42
42
|
"ibm_db"
|
|
@@ -49,14 +49,17 @@
|
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@zowe/imperative": "^8.0.0"
|
|
51
51
|
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=22.0.0"
|
|
54
|
+
},
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
"@types/jest": "^29.5.14",
|
|
54
|
-
"@types/node": "^
|
|
57
|
+
"@types/node": "^22.0.0",
|
|
55
58
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
56
59
|
"@typescript-eslint/parser": "^7.18.0",
|
|
57
|
-
"@zowe/cli": "^8.
|
|
58
|
-
"@zowe/cli-test-utils": "^8.
|
|
59
|
-
"@zowe/imperative": "^8.
|
|
60
|
+
"@zowe/cli": "^8.41.0",
|
|
61
|
+
"@zowe/cli-test-utils": "^8.41.0",
|
|
62
|
+
"@zowe/imperative": "^8.41.0",
|
|
60
63
|
"env-cmd": "^10.1.0",
|
|
61
64
|
"eslint": "^8.57.1",
|
|
62
65
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
@@ -74,6 +77,7 @@
|
|
|
74
77
|
"typedoc": "^0.25.13",
|
|
75
78
|
"typescript": "^5.4.5"
|
|
76
79
|
},
|
|
80
|
+
"packageManager": "npm@10.9.8",
|
|
77
81
|
"jest": {
|
|
78
82
|
"setupFilesAfterEnv": [
|
|
79
83
|
"./__tests__/setUpJest.js"
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.ODBC()
|
|
4
|
-
, assert = require("assert")
|
|
5
|
-
, exitCode = 0
|
|
6
|
-
;
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* The purpose of this test is to test binding an array and then
|
|
10
|
-
* changing the values of the array before an execute[Sync]
|
|
11
|
-
* call and have the new array values be used.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
db.createConnection(function (err, conn) {
|
|
15
|
-
|
|
16
|
-
console.log(common.connectionString);
|
|
17
|
-
conn.openSync(common.connectionString);
|
|
18
|
-
|
|
19
|
-
conn.createStatement(function (err, stmt) {
|
|
20
|
-
var r, result, caughtError;
|
|
21
|
-
|
|
22
|
-
var a = ['hello', 'world'];
|
|
23
|
-
|
|
24
|
-
stmt.prepareSync('select ? as col1, ? as col2');
|
|
25
|
-
|
|
26
|
-
stmt.bindSync(a);
|
|
27
|
-
|
|
28
|
-
result = stmt.executeSync();
|
|
29
|
-
|
|
30
|
-
console.log(result.fetchAllSync());
|
|
31
|
-
result.closeSync();
|
|
32
|
-
|
|
33
|
-
a[0] = 'goodbye';
|
|
34
|
-
a[1] = 'steven';
|
|
35
|
-
|
|
36
|
-
result = stmt.executeSync();
|
|
37
|
-
|
|
38
|
-
r = result.fetchAllSync();
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
assert.deepEqual(r, [ { col1: 'goodbye', col2: 'steven' } ]);
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
console.log(e);
|
|
45
|
-
exitCode = 1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
conn.closeSync();
|
|
49
|
-
|
|
50
|
-
if (exitCode) {
|
|
51
|
-
console.log("failed");
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
console.log("success");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
process.exit(exitCode);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.Database();
|
|
4
|
-
|
|
5
|
-
db.open(common.connectionString, function(err) {
|
|
6
|
-
console.error('db.open callback');
|
|
7
|
-
console.error('node should just sit and wait');
|
|
8
|
-
//console.log(err);
|
|
9
|
-
//reference db here so it isn't garbage collected:
|
|
10
|
-
|
|
11
|
-
console.log(db.connected);
|
|
12
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.Database()
|
|
4
|
-
, assert = require("assert");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
db.open(common.testConnectionStrings[0].connectionString, function (err) {
|
|
8
|
-
assert.equal(err, null);
|
|
9
|
-
|
|
10
|
-
db.query("select ? as \"TRUECOL\", ? as \"FALSECOL\" FROM SYSIBM.SYSDUMMY1"
|
|
11
|
-
, [true, false]
|
|
12
|
-
, function (err, data, more) {
|
|
13
|
-
db.close(function () {
|
|
14
|
-
assert.equal(err, null);
|
|
15
|
-
assert.deepEqual(data, [{
|
|
16
|
-
TRUECOL: true,
|
|
17
|
-
FALSECOL: false
|
|
18
|
-
}]);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.Database()
|
|
4
|
-
, assert = require("assert");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
db.open(common.connectionString, function (err) {
|
|
8
|
-
assert.equal(err, null);
|
|
9
|
-
|
|
10
|
-
db.query("select ? as \"DECCOL1\" "
|
|
11
|
-
, [5.5]
|
|
12
|
-
, function (err, data, more) {
|
|
13
|
-
db.close(function () {
|
|
14
|
-
assert.equal(err, null);
|
|
15
|
-
assert.deepEqual(data, [{
|
|
16
|
-
DECCOL1: 5.5
|
|
17
|
-
}]);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.Database()
|
|
4
|
-
, assert = require("assert");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
db.open(common.connectionString, function (err) {
|
|
8
|
-
assert.equal(err, null);
|
|
9
|
-
|
|
10
|
-
db.query("select ? as \"NULLCOL1\" "
|
|
11
|
-
, [null]
|
|
12
|
-
, function (err, data, more) {
|
|
13
|
-
if (err) { console.error(err) }
|
|
14
|
-
db.close(function () {
|
|
15
|
-
assert.equal(err, null);
|
|
16
|
-
assert.deepEqual(data, [{
|
|
17
|
-
NULLCOL1: null
|
|
18
|
-
}]);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.Database()
|
|
4
|
-
, assert = require("assert");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
db.open(common.connectionString, function (err) {
|
|
8
|
-
assert.equal(err, null);
|
|
9
|
-
|
|
10
|
-
db.query("select ? as \"TEXTCOL1\", ? as \"TEXTCOL2\", ? as \"NULLCOL1\" "
|
|
11
|
-
, ["something", "something", null]
|
|
12
|
-
, function (err, data, more) {
|
|
13
|
-
if (err) { console.error(err) }
|
|
14
|
-
db.close(function () {
|
|
15
|
-
assert.equal(err, null);
|
|
16
|
-
assert.deepEqual(data, [{
|
|
17
|
-
TEXTCOL1: "something",
|
|
18
|
-
TEXTCOL2: "something",
|
|
19
|
-
NULLCOL1: null
|
|
20
|
-
}]);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.Database()
|
|
4
|
-
, assert = require("assert");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
db.open(common.connectionString, function (err) {
|
|
8
|
-
assert.equal(err, null);
|
|
9
|
-
|
|
10
|
-
db.query("select ? as TEXTCOL, ? as TEXTCOL2, ? as INTCOL "
|
|
11
|
-
, ["fish", "asdf", 1]
|
|
12
|
-
, function (err, data, more) {
|
|
13
|
-
db.close(function () {
|
|
14
|
-
assert.equal(err, null);
|
|
15
|
-
assert.deepEqual(data, [{
|
|
16
|
-
TEXTCOL: 'fish',
|
|
17
|
-
TEXTCOL2: 'asdf',
|
|
18
|
-
INTCOL: 1
|
|
19
|
-
}]);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var common = require("./common")
|
|
2
|
-
, odbc = require("../")
|
|
3
|
-
, db = new odbc.Database()
|
|
4
|
-
, assert = require("assert");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
db.open(common.connectionString, function (err) {
|
|
8
|
-
assert.equal(err, null);
|
|
9
|
-
|
|
10
|
-
db.query("select ? as INTCOL1, ? as INTCOL2, ? as INTCOL3, ? as FLOATCOL4, ? as FLOATYINT"
|
|
11
|
-
, [5, 3, 1, 1.23456789012345, 12345.000]
|
|
12
|
-
, function (err, data, more) {
|
|
13
|
-
db.close(function () {
|
|
14
|
-
assert.equal(err, null);
|
|
15
|
-
assert.deepEqual(data, [{
|
|
16
|
-
INTCOL1: 5,
|
|
17
|
-
INTCOL2: 3,
|
|
18
|
-
INTCOL3: 1,
|
|
19
|
-
FLOATCOL4 : 1.23456789012345,
|
|
20
|
-
FLOATYINT : 12345
|
|
21
|
-
}]);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|