@zowe/db2-for-zowe-cli 6.1.17 → 6.1.19
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/adm-zip/adm-zip.js +32 -6
- package/node_modules/adm-zip/headers/entryHeader.js +13 -1
- package/node_modules/adm-zip/methods/inflater.js +33 -3
- package/node_modules/adm-zip/package.json +2 -2
- package/node_modules/adm-zip/util/errors.js +3 -0
- package/node_modules/adm-zip/util/utils.js +102 -14
- package/node_modules/adm-zip/zipEntry.js +43 -18
- package/node_modules/adm-zip/zipFile.js +10 -0
- package/node_modules/axios/CHANGELOG.md +62 -0
- package/node_modules/axios/README.md +236 -73
- package/node_modules/axios/dist/axios.js +1308 -357
- 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 +1443 -403
- package/node_modules/axios/dist/esm/axios.js +1443 -403
- 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 +1483 -348
- package/node_modules/axios/index.d.cts +24 -1
- package/node_modules/axios/index.d.ts +22 -1
- package/node_modules/axios/lib/adapters/fetch.js +136 -30
- package/node_modules/axios/lib/adapters/http.js +277 -74
- package/node_modules/axios/lib/adapters/xhr.js +172 -16
- package/node_modules/axios/lib/core/Axios.js +87 -27
- package/node_modules/axios/lib/core/AxiosError.js +59 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +17 -4
- package/node_modules/axios/lib/core/InterceptorManager.js +118 -8
- package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
- package/node_modules/axios/lib/core/buildFullPath.js +1 -13
- package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +28 -2
- package/node_modules/axios/lib/core/mergeConfig.js +183 -120
- 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/defaults/transitional.js +1 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
- package/node_modules/axios/lib/helpers/Http2Sessions.js +4 -1
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +11 -1
- package/node_modules/axios/lib/helpers/composeSignals.js +6 -3
- package/node_modules/axios/lib/helpers/cookies.js +30 -6
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +34 -7
- package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +25 -1
- package/node_modules/axios/lib/helpers/fromDataURI.js +11 -4
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +2 -1
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/progressEventReducer.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +20 -5
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +197 -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 +192 -20
- package/node_modules/axios/package.json +1 -2
- package/node_modules/follow-redirects/README.md +27 -1
- package/node_modules/follow-redirects/index.js +11 -6
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/fs-extra/README.md +0 -1
- package/node_modules/fs-extra/lib/empty/index.js +4 -2
- package/node_modules/fs-extra/lib/util/stat.js +12 -2
- package/node_modules/fs-extra/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/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/which-typed-array/CHANGELOG.md +14 -0
- package/node_modules/which-typed-array/README.md +0 -2
- package/node_modules/which-typed-array/index.d.ts +288 -11
- package/node_modules/which-typed-array/index.js +6 -7
- package/node_modules/which-typed-array/package.json +12 -11
- package/package.json +10 -11
- 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
- package/node_modules/which-typed-array/eslint.config.mjs +0 -12
- package/node_modules/which-typed-array/test/index.js +0 -105
- /package/node_modules/{tar-fs/node_modules/chownr → chownr}/LICENSE +0 -0
- /package/node_modules/{tar-fs/node_modules/chownr → chownr}/README.md +0 -0
- /package/node_modules/{tar-fs/node_modules/chownr → chownr}/chownr.js +0 -0
- /package/node_modules/{tar-fs/node_modules/chownr → chownr}/package.json +0 -0
- /package/node_modules/{tar-stream/node_modules/string_decoder → string_decoder}/.travis.yml +0 -0
- /package/node_modules/{tar-stream/node_modules/string_decoder → string_decoder}/LICENSE +0 -0
- /package/node_modules/{tar-stream/node_modules/string_decoder → string_decoder}/README.md +0 -0
- /package/node_modules/{tar-stream/node_modules/string_decoder → string_decoder}/lib/string_decoder.js +0 -0
- /package/node_modules/{tar-stream/node_modules/string_decoder → string_decoder}/package.json +0 -0
|
@@ -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
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Feross Aboukhadijeh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|