mg-dbx 2.4.28 → 2.4.30

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 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
- 7 November 2023, MGateway Ltd [http://www.mgateway.com](http://www.mgateway.com)
6
+ 29 May 2025, MGateway Ltd [http://www.mgateway.com](http://www.mgateway.com)
7
7
 
8
- * Verified to work with Node.js v8 to v20.
8
+ * Verified to work with Node.js v8 to v24.
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
 
@@ -16,6 +16,7 @@ Contents
16
16
  * [Connecting to the database](#Connect)
17
17
  * [Invocation of database commands](#DBCommands)
18
18
  * [Invocation of database functions](#DBFunctions)
19
+ * [Cursor based data retrieval](#Cursors)
19
20
  * [Transaction Processing](#TProcessing)
20
21
  * [Direct access to InterSystems classes (IRIS and Cache)](#DBClasses)
21
22
  * [Direct access to SQL: MGSQL and InterSystems SQL (IRIS and Cache)](#DBSQL)
@@ -88,26 +89,26 @@ Change to your development UCI and check the installation:
88
89
  do ^%zmgsi
89
90
 
90
91
  MGateway Ltd - Service Integration Gateway
91
- Version: 4.5; Revision 28 (3 February 2023)
92
+ Version: 4.5; Revision 31 (18 November 2023)
92
93
 
93
94
 
94
95
  #### Installation for YottaDB
95
96
 
96
- The instructions given here assume a standard 'out of the box' installation of **YottaDB** (version 1.30) deployed in the following location:
97
+ The instructions given here assume a standard 'out of the box' installation of **YottaDB** (version 1.38) deployed in the following location:
97
98
 
98
- /usr/local/lib/yottadb/r130
99
+ /usr/local/lib/yottadb/r138
99
100
 
100
101
  The primary default location for routines:
101
102
 
102
- /root/.yottadb/r1.30_x86_64/r
103
+ /root/.yottadb/r1.38_x86_64/r
103
104
 
104
105
  Copy all the routines (i.e. all files with an 'm' extension) held in the GitHub **/yottadb** directory to:
105
106
 
106
- /root/.yottadb/r1.30_x86_64/r
107
+ /root/.yottadb/r1.38_x86_64/r
107
108
 
108
109
  Change directory to the following location and start a **YottaDB** command shell:
109
110
 
110
- cd /usr/local/lib/yottadb/r130
111
+ cd /usr/local/lib/yottadb/r138
111
112
  ./ydb
112
113
 
113
114
  Link all the **zmgsi** routines and check the installation:
@@ -117,7 +118,7 @@ Link all the **zmgsi** routines and check the installation:
117
118
  do ^%zmgsi
118
119
 
119
120
  MGateway Ltd - Service Integration Gateway
120
- Version: 4.5; Revision 28 (3 February 2023)
121
+ Version: 4.5; Revision 31 (18 November 2023)
121
122
 
122
123
  Note that the version of **zmgsi** is successfully displayed.
123
124
 
@@ -227,19 +228,19 @@ Assuming IRIS is accessed via **localhost** listening on TCP port **7041**
227
228
 
228
229
  ##### API based connectivity
229
230
 
230
- Assuming an 'out of the box' YottaDB installation under **/usr/local/lib/yottadb/r130**.
231
+ Assuming an 'out of the box' YottaDB installation under **/usr/local/lib/yottadb/r138**.
231
232
 
232
233
  var envvars = "";
233
234
  envvars = envvars + "ydb_dir=/root/.yottadb\n"
234
- envvars = envvars + "ydb_rel=r1.30_x86_64\n"
235
- envvars = envvars + "ydb_gbldir=/root/.yottadb/r1.30_x86_64/g/yottadb.gld\n"
236
- envvars = envvars + "ydb_routines=/root/.yottadb/r1.30_x86_64/o*(/root/.yottadb/r1.30_x86_64/r /root/.yottadb/r) /usr/local/lib/yottadb/r130/libyottadbutil.so\n"
237
- envvars = envvars + "ydb_ci=/usr/local/lib/yottadb/r130/zmgsi.ci\n"
235
+ envvars = envvars + "ydb_rel=r1.38_x86_64\n"
236
+ envvars = envvars + "ydb_gbldir=/root/.yottadb/r1.38_x86_64/g/yottadb.gld\n"
237
+ envvars = envvars + "ydb_routines=/root/.yottadb/r1.38_x86_64/o*(/root/.yottadb/r1.38_x86_64/r /root/.yottadb/r) /usr/local/lib/yottadb/r138/libyottadbutil.so\n"
238
+ envvars = envvars + "ydb_ci=/usr/local/lib/yottadb/r138/zmgsi.ci\n"
238
239
  envvars = envvars + "\n"
239
240
 
240
241
  var open = db.open({
241
242
  type: "YottaDB",
242
- path: "/usr/local/lib/yottadb/r130",
243
+ path: "/usr/local/lib/yottadb/r138",
243
244
  env_vars: envvars
244
245
  });
245
246
 
@@ -544,10 +545,10 @@ This facility provides high-performance techniques for traversing records held i
544
545
 
545
546
  The first task is to specify the 'query' for the global traverse.
546
547
 
547
- query = new mcursor(db, {global: <global_name>, key: [<seed_key>]}[, <options>]);
548
+ query = new mcursor(db, {global: <global_name>, key: [<seed_key>]}[, {<options>}]);
548
549
  Or:
549
550
 
550
- query = db.mglobalquery({global: <global_name>, key: [<seed_key>]}[, <options>]);
551
+ query = db.mglobalquery({global: <global_name>, key: [<seed_key>]}[, {<options>}]);
551
552
 
552
553
  The 'options' object can contain the following properties:
553
554
 
@@ -582,7 +583,7 @@ Example 1 (return all key values from the 'Person' global - returns a simple var
582
583
 
583
584
  Example 2 (return all key values and names from the 'Person' global - returns an object):
584
585
 
585
- query = db.mglobalquery({global: "Person", key: [""]}, multilevel: false, getdata: true);
586
+ query = db.mglobalquery({global: "Person", key: [""]}, {multilevel: false, getdata: true});
586
587
  while ((result = query.next()) !== null) {
587
588
  console.log("result: " + JSON.stringify(result, null, '\t'));
588
589
  }
@@ -590,14 +591,14 @@ Example 2 (return all key values and names from the 'Person' global - returns an
590
591
 
591
592
  Example 3 (return all key values and names from the 'Person' global - returns a string):
592
593
 
593
- query = db.mglobalquery({global: "Person", key: [""]}, multilevel: false, getdata: true, format: "url"});
594
+ query = db.mglobalquery({global: "Person", key: [""]}, {multilevel: false, getdata: true, format: "url"});
594
595
  while ((result = query.next()) !== null) {
595
596
  console.log("result: " + result);
596
597
  }
597
598
 
598
599
  Example 4 (return all key values and names from the 'Person' global, including any descendant nodes):
599
600
 
600
- query = db.mglobalquery({global: "Person", key: [""]}, {{multilevel: true, getdata: true});
601
+ query = db.mglobalquery({global: "Person", key: [""]}, {multilevel: true, getdata: true});
601
602
  while ((result = query.next()) !== null) {
602
603
  console.log("result: " + JSON.stringify(result, null, '\t'));
603
604
  }
@@ -788,10 +789,10 @@ Example 2 Reset a container to hold an existing instance (object %Id of 2):
788
789
 
789
790
  The first task is to specify the SQL query.
790
791
 
791
- query = new mcursor(db, {sql: <sql_statement>[, type: <sql_engine>]);
792
+ query = new mcursor(db, {sql: <sql_statement>[, type: <sql_engine>]});
792
793
  Or:
793
794
 
794
- query = db.sql({sql: <sql_statement>[, type: <sql_engine>]);
795
+ query = db.sql({sql: <sql_statement>[, type: <sql_engine>]});
795
796
 
796
797
  Example 1 (using MGSQL):
797
798
 
@@ -1026,7 +1027,7 @@ Logging can be switched off by calling the **setloglevel** function without spec
1026
1027
 
1027
1028
  ## <a name="License"></a> License
1028
1029
 
1029
- Copyright (c) 2018-2023 MGateway Ltd,
1030
+ Copyright (c) 2018-2025 MGateway Ltd,
1030
1031
  Surrey UK.
1031
1032
  All rights reserved.
1032
1033
 
@@ -1228,3 +1229,11 @@ Unless required by applicable law or agreed to in writing, software distributed
1228
1229
 
1229
1230
  * Correct a fault affecting the return of Unicode data to Node.js through SQL.
1230
1231
 
1232
+ ### v2.4.29 (21 May 2024)
1233
+
1234
+ * Verify that **mg-dbx** will build and work with Node.js v22.x.x.
1235
+ * Correct a fault in the InterSystems get and change namespace operations under network connections (db.namespace()).
1236
+
1237
+ ### v2.4.30 (29 May 2025)
1238
+
1239
+ * Verify that **mg-dbx** will build and work with Node.js v24.x.x.
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.28",
5
+ "version": "2.4.30",
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
@@ -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) 2019-2023 MGateway Ltd |
6
+ | Copyright (c) 2019-2025 MGateway Ltd |
7
7
  | Surrey UK. |
8
8
  | All rights reserved. |
9
9
  | |
@@ -108,7 +108,12 @@ void mclass::New(const FunctionCallbackInfo<Value>& args)
108
108
  if (otype) {
109
109
  fc = obj->InternalFieldCount();
110
110
  if (fc == 3) {
111
+ /* v2.4.29 */
112
+ #if DBX_NODE_VERSION >= 220000
113
+ mn = obj->GetInternalField(2).As<v8::Value>().As<v8::External>()->Int32Value(icontext).FromJust();
114
+ #else
111
115
  mn = DBX_INT32_VALUE(obj->GetInternalField(2));
116
+ #endif
112
117
  if (mn == DBX_MAGIC_NUMBER) {
113
118
  c = ObjectWrap::Unwrap<DBX_DBNAME>(obj);
114
119
  }
@@ -133,7 +138,7 @@ void mclass::New(const FunctionCallbackInfo<Value>& args)
133
138
  pmeth->argc = argc;
134
139
  if (argc > 1) {
135
140
  cname = DBX_TO_STRING(args[1]);
136
- dbx_write_char8(isolate, cname, obj->class_name, obj->c->pcon->utf8);
141
+ dbx_write_char8(isolate, cname, obj->class_name, sizeof(obj->class_name), obj->c->pcon->utf8);
137
142
  obj->class_name_len = (int) strlen(obj->class_name);
138
143
  if (pcon->utf16) {
139
144
  dbx_write_char16(isolate, cname, obj->class_name16);
@@ -737,7 +742,7 @@ void mclass::Reset(const FunctionCallbackInfo<Value>& args)
737
742
  }
738
743
 
739
744
  cname = DBX_TO_STRING(args[0]);
740
- dbx_write_char8(isolate, cname, class_name, pcon->utf8);
745
+ dbx_write_char8(isolate, cname, class_name, sizeof(class_name), pcon->utf8);
741
746
  if (class_name[0] == '\0') {
742
747
  isolate->ThrowException(Exception::Error(dbx_new_string8(isolate, (char *) "The class:reset method takes at least one argument (the class name)", 1)));
743
748
  dbx_request_memory_free(pcon, pmeth, 0);
package/src/mg-class.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) 2019-2023 MGateway Ltd |
6
+ | Copyright (c) 2019-2025 MGateway Ltd |
7
7
  | Surrey UK. |
8
8
  | All rights reserved. |
9
9
  | |
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) 2019-2023 MGateway Ltd |
6
+ | Copyright (c) 2019-2025 MGateway Ltd |
7
7
  | Surrey UK. |
8
8
  | All rights reserved. |
9
9
  | |
@@ -104,7 +104,12 @@ void mcursor::New(const FunctionCallbackInfo<Value>& args)
104
104
  if (otype) {
105
105
  fc = obj->InternalFieldCount();
106
106
  if (fc == 3) {
107
+ /* v2.4.29 */
108
+ #if DBX_NODE_VERSION >= 220000
109
+ mn = obj->GetInternalField(2).As<v8::Value>().As<v8::External>()->Int32Value(icontext).FromJust();
110
+ #else
107
111
  mn = DBX_INT32_VALUE(obj->GetInternalField(2));
112
+ #endif
108
113
  if (mn == DBX_MAGIC_NUMBER) {
109
114
  c = ObjectWrap::Unwrap<DBX_DBNAME>(obj);
110
115
  }
package/src/mg-cursor.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) 2019-2023 MGateway Ltd |
6
+ | Copyright (c) 2019-2025 MGateway Ltd |
7
7
  | Surrey UK. |
8
8
  | All rights reserved. |
9
9
  | |