mg-dbx 2.4.27 → 2.4.28
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 +34 -8
- package/bin/winx64/mg-dbx-napi.node +0 -0
- package/bin/winx64/node16/mg-dbx.node +0 -0
- package/bin/winx64/node18/mg-dbx.node +0 -0
- package/bin/winx64/node19/mg-dbx.node +0 -0
- package/bin/winx64/node20/mg-dbx.node +0 -0
- package/package.json +1 -1
- package/src/mg-class.cpp +1 -1
- package/src/mg-class.h +1 -1
- package/src/mg-cursor.cpp +3 -2
- package/src/mg-cursor.h +1 -1
- package/src/mg-dbx.cpp +55 -13
- package/src/mg-dbx.h +4 -2
- package/src/mg-global.cpp +1 -1
- package/src/mg-global.h +1 -1
- package/src/mg-net.cpp +1 -1
- package/src/mg-net.h +1 -1
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
High speed Synchronous and Asynchronous access to InterSystems Cache/IRIS and YottaDB from Node.js.
|
|
4
4
|
|
|
5
5
|
Chris Munt <cmunt@mgateway.com>
|
|
6
|
-
|
|
6
|
+
7 November 2023, MGateway Ltd [http://www.mgateway.com](http://www.mgateway.com)
|
|
7
7
|
|
|
8
|
-
* Verified to work with Node.js v8 to
|
|
8
|
+
* Verified to work with Node.js v8 to v20.
|
|
9
9
|
* Two connectivity models to the InterSystems or YottaDB database are provided: High performance via the local database API or network based.
|
|
10
10
|
* [Release Notes](#RelNotes) can be found at the end of this document.
|
|
11
11
|
|
|
@@ -61,6 +61,9 @@ Assuming that Node.js is already installed and a C++ compiler is available to th
|
|
|
61
61
|
|
|
62
62
|
This command will create the **mg-dbx** addon (*mg-dbx.node*).
|
|
63
63
|
|
|
64
|
+
### Enabling the API for InterSystems IRIS and Cache
|
|
65
|
+
|
|
66
|
+
Before connecting to a local (relative to Node.js) InterSystems database via its API, check that the InterSystems ***'Callin API'*** is enabled. From the InterSystems Database Management Portal select ***System Administration***; then ***Security***; then ***Services***. Look for the row containing ***%Service_Callin*** and check that it is ***Enabled***. Edit the row and mark this service as ***Enabled*** if necessary.
|
|
64
67
|
|
|
65
68
|
### Installing the M support routines (also known as the DB Superserver)
|
|
66
69
|
|
|
@@ -70,6 +73,8 @@ The M support routines are required for:
|
|
|
70
73
|
* Direct access to SQL (either via the API or via the network).
|
|
71
74
|
* The Merge command under YottaDB (either via the API or via the network).
|
|
72
75
|
|
|
76
|
+
If none of the above apply you do not need to install these routines - proceed to [Connecting to the database](#Connect).
|
|
77
|
+
|
|
73
78
|
Two M routines need to be installed (%zmgsi and %zmgsis). These can be found in the *Service Integration Gateway* (**mgsi**) GitHub source code repository ([https://github.com/chrisemunt/mgsi](https://github.com/chrisemunt/mgsi)). Note that it is not necessary to install the whole *Service Integration Gateway*, just the two M routines held in that repository.
|
|
74
79
|
|
|
75
80
|
#### Installation for InterSystems Cache/IRIS
|
|
@@ -82,8 +87,8 @@ Change to your development UCI and check the installation:
|
|
|
82
87
|
|
|
83
88
|
do ^%zmgsi
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
Version: 4.
|
|
90
|
+
MGateway Ltd - Service Integration Gateway
|
|
91
|
+
Version: 4.5; Revision 28 (3 February 2023)
|
|
87
92
|
|
|
88
93
|
|
|
89
94
|
#### Installation for YottaDB
|
|
@@ -111,8 +116,8 @@ Link all the **zmgsi** routines and check the installation:
|
|
|
111
116
|
|
|
112
117
|
do ^%zmgsi
|
|
113
118
|
|
|
114
|
-
|
|
115
|
-
Version: 4.
|
|
119
|
+
MGateway Ltd - Service Integration Gateway
|
|
120
|
+
Version: 4.5; Revision 28 (3 February 2023)
|
|
116
121
|
|
|
117
122
|
Note that the version of **zmgsi** is successfully displayed.
|
|
118
123
|
|
|
@@ -1021,7 +1026,7 @@ Logging can be switched off by calling the **setloglevel** function without spec
|
|
|
1021
1026
|
|
|
1022
1027
|
## <a name="License"></a> License
|
|
1023
1028
|
|
|
1024
|
-
Copyright (c) 2018-
|
|
1029
|
+
Copyright (c) 2018-2023 MGateway Ltd,
|
|
1025
1030
|
Surrey UK.
|
|
1026
1031
|
All rights reserved.
|
|
1027
1032
|
|
|
@@ -1201,4 +1206,25 @@ Unless required by applicable law or agreed to in writing, software distributed
|
|
|
1201
1206
|
|
|
1202
1207
|
### v2.4.27 (20 October 2021)
|
|
1203
1208
|
|
|
1204
|
-
* Verify that **mg-dbx** will build and work with Node.js v17.x.x.
|
|
1209
|
+
* Verify that **mg-dbx** will build and work with Node.js v17.x.x.
|
|
1210
|
+
|
|
1211
|
+
### v2.4.27a (25 April 2022)
|
|
1212
|
+
|
|
1213
|
+
* Verify that **mg-dbx** will build and work with Node.js v18.x.x.
|
|
1214
|
+
|
|
1215
|
+
### v2.4.27b (4 November 2022)
|
|
1216
|
+
|
|
1217
|
+
* Verify that **mg-dbx** will build and work with Node.js v19.x.x.
|
|
1218
|
+
|
|
1219
|
+
### v2.4.27c (3 May 2023)
|
|
1220
|
+
|
|
1221
|
+
* Verify that **mg-dbx** will build and work with Node.js v20.x.x.
|
|
1222
|
+
|
|
1223
|
+
### v2.4.27d (22 June 2023)
|
|
1224
|
+
|
|
1225
|
+
* Documentation update.
|
|
1226
|
+
|
|
1227
|
+
### v2.4.28 (7 November 2023)
|
|
1228
|
+
|
|
1229
|
+
* Correct a fault affecting the return of Unicode data to Node.js through SQL.
|
|
1230
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Chris Munt <cmunt@mgateway.com> (http://www.gateway.com/)",
|
|
3
3
|
"name": "mg-dbx",
|
|
4
4
|
"description": "High speed Synchronous and Asynchronous access to InterSystems Cache/IRIS and YottaDB from Node.js.",
|
|
5
|
-
"version": "2.4.
|
|
5
|
+
"version": "2.4.28",
|
|
6
6
|
"maintainers": "Chris Munt <cmunt@mgateway.com>",
|
|
7
7
|
"homepage": "https://github.com/chrisemunt/mg-dbx",
|
|
8
8
|
"repository": {
|
package/src/mg-class.cpp
CHANGED
package/src/mg-class.h
CHANGED
package/src/mg-cursor.cpp
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
| mg-dbx.node |
|
|
4
4
|
| Author: Chris Munt cmunt@mgateway.com |
|
|
5
5
|
| chris.e.munt@gmail.com |
|
|
6
|
-
| Copyright (c)
|
|
6
|
+
| Copyright (c) 2019-2023 MGateway Ltd |
|
|
7
7
|
| Surrey UK. |
|
|
8
8
|
| All rights reserved. |
|
|
9
9
|
| |
|
|
@@ -552,7 +552,8 @@ void mcursor::Next(const FunctionCallbackInfo<Value>& args)
|
|
|
552
552
|
}
|
|
553
553
|
|
|
554
554
|
key = dbx_new_string8n(isolate, (char *) pmeth->psql->cols[n]->name.buf_addr, pmeth->psql->cols[n]->name.len_used, 0);
|
|
555
|
-
|
|
555
|
+
/* v2.4.28 add utf8 flag */
|
|
556
|
+
DBX_SET(obj, key, dbx_new_string8n(isolate, pmeth->output_val.svalue.buf_addr + pmeth->output_val.offs, len, pcon->utf8));
|
|
556
557
|
pmeth->output_val.offs += len;
|
|
557
558
|
}
|
|
558
559
|
|
package/src/mg-cursor.h
CHANGED
package/src/mg-dbx.cpp
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
| mg-dbx.node |
|
|
4
4
|
| Author: Chris Munt cmunt@mgateway.com |
|
|
5
5
|
| chris.e.munt@gmail.com |
|
|
6
|
-
| Copyright (c)
|
|
6
|
+
| Copyright (c) 2019-2023 MGateway Ltd |
|
|
7
7
|
| Surrey UK. |
|
|
8
8
|
| All rights reserved. |
|
|
9
9
|
| |
|
|
@@ -162,6 +162,21 @@ Version 2.4.26 2 September 2021:
|
|
|
162
162
|
Version 2.4.27 20 October 2021:
|
|
163
163
|
Verify that mg-dbx will build and work with Node.js v17.x.x. (ABI: 102).
|
|
164
164
|
|
|
165
|
+
Version 2.4.27a 25 April 2022:
|
|
166
|
+
Verify that mg-dbx will build and work with Node.js v18.x.x. (ABI: 108).
|
|
167
|
+
|
|
168
|
+
Version 2.4.27b 4 November 2022:
|
|
169
|
+
Verify that mg-dbx will build and work with Node.js v19.x.x. (ABI: 111).
|
|
170
|
+
|
|
171
|
+
Version 2.4.27c 3 May 2023:
|
|
172
|
+
Verify that mg-dbx will build and work with Node.js v20.x.x. (ABI: 115).
|
|
173
|
+
|
|
174
|
+
Version 2.4.27d 22 June 2023:
|
|
175
|
+
Documentation update.
|
|
176
|
+
|
|
177
|
+
Version 2.4.28 7 November 2023:
|
|
178
|
+
Correct a fault affecting the return of Unicode data to Node.js through SQL.
|
|
179
|
+
|
|
165
180
|
*/
|
|
166
181
|
|
|
167
182
|
|
|
@@ -7207,6 +7222,7 @@ __try {
|
|
|
7207
7222
|
|
|
7208
7223
|
if (pcon->p_isc_so->loaded) {
|
|
7209
7224
|
/* pcon->p_isc_so->p_CacheEnd(); */
|
|
7225
|
+
pcon->p_isc_so->p_CacheEnd();
|
|
7210
7226
|
dbx_dso_unload(pcon->p_isc_so->p_library);
|
|
7211
7227
|
pcon->p_isc_so->p_library = NULL;
|
|
7212
7228
|
pcon->p_isc_so->loaded = 0;
|
|
@@ -9104,6 +9120,7 @@ __except (EXCEPTION_EXECUTE_HANDLER) {
|
|
|
9104
9120
|
int dbx_sql_execute(DBXMETH *pmeth)
|
|
9105
9121
|
{
|
|
9106
9122
|
int rc, len, dsort, dtype, cn, no_cols;
|
|
9123
|
+
short utf16;
|
|
9107
9124
|
unsigned long offset;
|
|
9108
9125
|
char label[16], routine[16], params[9], buffer[8];
|
|
9109
9126
|
DBXFUN fun;
|
|
@@ -9119,6 +9136,9 @@ __try {
|
|
|
9119
9136
|
strcpy(pmeth->psql->sqlstate, "00000");
|
|
9120
9137
|
|
|
9121
9138
|
strcpy(params, "");
|
|
9139
|
+
if (pcon->utf8 == 2) { /* v2.4.28 */
|
|
9140
|
+
strcat(params,";utf16");
|
|
9141
|
+
}
|
|
9122
9142
|
if (pmeth->psql->sql_type == DBX_SQL_ISCSQL) {
|
|
9123
9143
|
strcpy(label, "sqleisc");
|
|
9124
9144
|
}
|
|
@@ -9144,13 +9164,15 @@ __try {
|
|
|
9144
9164
|
|
|
9145
9165
|
if (pcon->log_transmissions) {
|
|
9146
9166
|
int nx;
|
|
9167
|
+
char label_log[64]; /* v2.4.28 */
|
|
9147
9168
|
v8::Local<v8::String> str;
|
|
9148
9169
|
|
|
9149
9170
|
pmeth->ibuffer_used = 0;
|
|
9150
9171
|
nx = 0;
|
|
9151
|
-
|
|
9152
|
-
strcat(
|
|
9153
|
-
|
|
9172
|
+
strcpy(label_log, label);
|
|
9173
|
+
strcat(label_log, "^");
|
|
9174
|
+
strcat(label_log, routine);
|
|
9175
|
+
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) label_log, (int) strlen(label_log), 0, 0);
|
|
9154
9176
|
sprintf(buffer, "%d", pmeth->psql->sql_no);
|
|
9155
9177
|
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) buffer, (int) strlen(buffer), 0, 0);
|
|
9156
9178
|
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) pmeth->psql->sql_script, (int) strlen(pmeth->psql->sql_script), 0, 0);
|
|
@@ -9214,7 +9236,11 @@ __try {
|
|
|
9214
9236
|
rc = pcon->p_isc_so->p_CachePushStr((int) strlen(params), (Callin_char_t *) params);
|
|
9215
9237
|
rc = pcon->p_isc_so->p_CacheExtFun(fun.rflag, 3);
|
|
9216
9238
|
if (rc == CACHE_SUCCESS) {
|
|
9239
|
+
/* v2.4.28 */
|
|
9240
|
+
utf16 = pcon->utf16;
|
|
9241
|
+
pcon->utf16 = 0;
|
|
9217
9242
|
isc_pop_value(pmeth, &(pmeth->output_val), DBX_DTYPE_STR);
|
|
9243
|
+
pcon->utf16 = utf16;
|
|
9218
9244
|
}
|
|
9219
9245
|
isc_cleanup(pmeth);
|
|
9220
9246
|
}
|
|
@@ -9310,6 +9336,7 @@ __except (EXCEPTION_EXECUTE_HANDLER) {
|
|
|
9310
9336
|
int dbx_sql_row(DBXMETH *pmeth, int rn, int dir)
|
|
9311
9337
|
{
|
|
9312
9338
|
int rc, len, dsort, dtype, row_no, eod;
|
|
9339
|
+
short utf16;
|
|
9313
9340
|
unsigned long offset;
|
|
9314
9341
|
char label[16], routine[16], params[9], buffer[8], rowstr[8];
|
|
9315
9342
|
DBXFUN fun;
|
|
@@ -9329,6 +9356,11 @@ __try {
|
|
|
9329
9356
|
strcpy(params, "-1");
|
|
9330
9357
|
else
|
|
9331
9358
|
strcpy(params, "");
|
|
9359
|
+
|
|
9360
|
+
if (pcon->utf8 == 2) { /* v2.4.28 */
|
|
9361
|
+
strcat(params,";utf16");
|
|
9362
|
+
}
|
|
9363
|
+
|
|
9332
9364
|
strcpy(label, "sqlrow");
|
|
9333
9365
|
|
|
9334
9366
|
strcpy(routine, "%zmgsis");
|
|
@@ -9345,13 +9377,14 @@ __try {
|
|
|
9345
9377
|
|
|
9346
9378
|
if (pcon->log_transmissions) {
|
|
9347
9379
|
int nx;
|
|
9380
|
+
char label_log[64]; /* v2.4.28 */
|
|
9348
9381
|
v8::Local<v8::String> str;
|
|
9349
9382
|
|
|
9350
9383
|
pmeth->ibuffer_used = 0;
|
|
9351
9384
|
nx = 0;
|
|
9352
|
-
strcat(
|
|
9353
|
-
strcat(
|
|
9354
|
-
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *)
|
|
9385
|
+
strcat(label_log, "^");
|
|
9386
|
+
strcat(label_log, routine);
|
|
9387
|
+
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) label_log, (int) strlen(label_log), 0, 0);
|
|
9355
9388
|
sprintf(buffer, "%d", pmeth->psql->sql_no);
|
|
9356
9389
|
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) buffer, (int) strlen(buffer), 0, 0);
|
|
9357
9390
|
sprintf(rowstr, "%d", rn);
|
|
@@ -9418,7 +9451,11 @@ __try {
|
|
|
9418
9451
|
rc = pcon->p_isc_so->p_CachePushStr((int) strlen(params), (Callin_char_t *) params);
|
|
9419
9452
|
rc = pcon->p_isc_so->p_CacheExtFun(fun.rflag, 3);
|
|
9420
9453
|
if (rc == CACHE_SUCCESS) {
|
|
9454
|
+
/* v2.4.28 */
|
|
9455
|
+
utf16 = pcon->utf16;
|
|
9456
|
+
pcon->utf16 = 0;
|
|
9421
9457
|
isc_pop_value(pmeth, &(pmeth->output_val), DBX_DTYPE_STR);
|
|
9458
|
+
pcon->utf16 = utf16;
|
|
9422
9459
|
}
|
|
9423
9460
|
isc_cleanup(pmeth);
|
|
9424
9461
|
}
|
|
@@ -9468,9 +9505,9 @@ __try {
|
|
|
9468
9505
|
row_no = (int) strtol(buffer, NULL, 10);
|
|
9469
9506
|
pmeth->psql->row_no = row_no;
|
|
9470
9507
|
pmeth->output_val.offs = offset;
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9508
|
+
/*
|
|
9509
|
+
printf("\r\nROW NUMBER: len=%d; row_no=%d; pmeth->output_val.offs=%d; total=%d;", len, row_no, pmeth->output_val.offs, pmeth->output_val.svalue.len_used);
|
|
9510
|
+
*/
|
|
9474
9511
|
dbx_sql_row_exit:
|
|
9475
9512
|
|
|
9476
9513
|
return eod;
|
|
@@ -9512,6 +9549,10 @@ __try {
|
|
|
9512
9549
|
strcpy(pmeth->psql->sqlstate, "00000");
|
|
9513
9550
|
pmeth->output_val.offs = 0;
|
|
9514
9551
|
strcpy(params, "");
|
|
9552
|
+
if (pcon->utf8 == 2) { /* v2.4.28 */
|
|
9553
|
+
strcat(params,";utf16");
|
|
9554
|
+
}
|
|
9555
|
+
|
|
9515
9556
|
strcpy(label, "sqldel");
|
|
9516
9557
|
|
|
9517
9558
|
strcpy(routine, "%zmgsis");
|
|
@@ -9528,13 +9569,14 @@ __try {
|
|
|
9528
9569
|
|
|
9529
9570
|
if (pcon->log_transmissions) {
|
|
9530
9571
|
int nx;
|
|
9572
|
+
char label_log[64]; /* v2.4.28 */
|
|
9531
9573
|
v8::Local<v8::String> str;
|
|
9532
9574
|
|
|
9533
9575
|
pmeth->ibuffer_used = 0;
|
|
9534
9576
|
nx = 0;
|
|
9535
|
-
strcat(
|
|
9536
|
-
strcat(
|
|
9537
|
-
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *)
|
|
9577
|
+
strcat(label_log, "^");
|
|
9578
|
+
strcat(label_log, routine);
|
|
9579
|
+
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) label_log, (int) strlen(label_log), 0, 0);
|
|
9538
9580
|
sprintf(buffer, "%d", pmeth->psql->sql_no);
|
|
9539
9581
|
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) buffer, (int) strlen(buffer), 0, 0);
|
|
9540
9582
|
dbx_ibuffer_add(pmeth, NULL, nx ++, str, (void *) params, (int) strlen(params), 0, 0);
|
package/src/mg-dbx.h
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
| mg-dbx.node |
|
|
4
4
|
| Author: Chris Munt cmunt@mgateway.com |
|
|
5
5
|
| chris.e.munt@gmail.com |
|
|
6
|
-
| Copyright (c)
|
|
6
|
+
| Copyright (c) 2019-2023 MGateway Ltd |
|
|
7
7
|
| Surrey UK. |
|
|
8
8
|
| All rights reserved. |
|
|
9
9
|
| |
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
#define DBX_VERSION_MAJOR "2"
|
|
35
35
|
#define DBX_VERSION_MINOR "4"
|
|
36
|
-
#define DBX_VERSION_BUILD "
|
|
36
|
+
#define DBX_VERSION_BUILD "28"
|
|
37
37
|
|
|
38
38
|
#define DBX_VERSION DBX_VERSION_MAJOR "." DBX_VERSION_MINOR "." DBX_VERSION_BUILD
|
|
39
39
|
|
|
@@ -203,6 +203,8 @@ DISABLE_WCAST_FUNCTION_TYPE
|
|
|
203
203
|
#define DBX_CMND_CGETP 42
|
|
204
204
|
#define DBX_CMND_CSETP 43
|
|
205
205
|
#define DBX_CMND_CMETH 44
|
|
206
|
+
/* v2.4.28 */
|
|
207
|
+
#define DBX_CMND_CCLOSE 45
|
|
206
208
|
|
|
207
209
|
#define DBX_CMND_GNAMENEXT 51
|
|
208
210
|
#define DBX_CMND_GNAMEPREVIOUS 52
|
package/src/mg-global.cpp
CHANGED
package/src/mg-global.h
CHANGED
package/src/mg-net.cpp
CHANGED
package/src/mg-net.h
CHANGED