oracledb 5.5.0 → 6.0.0

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +1 -1875
  2. package/LICENSE.txt +8 -222
  3. package/NOTICE.txt +1 -1
  4. package/README.md +38 -30
  5. package/SECURITY.md +38 -0
  6. package/build/Release/oracledb-6.0.0-darwin-x64.node +0 -0
  7. package/build/Release/oracledb-6.0.0-darwin-x64.node-buildinfo.txt +1 -0
  8. package/build/Release/oracledb-6.0.0-js-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.0.0-linux-arm64.node +0 -0
  10. package/build/Release/oracledb-6.0.0-linux-arm64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-6.0.0-linux-x64.node +0 -0
  12. package/build/Release/oracledb-6.0.0-linux-x64.node-buildinfo.txt +1 -0
  13. package/build/Release/oracledb-6.0.0-win32-x64.node +0 -0
  14. package/build/Release/oracledb-6.0.0-win32-x64.node-buildinfo.txt +1 -0
  15. package/examples/README.md +113 -0
  16. package/examples/dbconfig.js +100 -0
  17. package/examples/example.js +156 -0
  18. package/index.js +26 -0
  19. package/lib/aqDeqOptions.js +146 -7
  20. package/lib/aqEnqOptions.js +59 -7
  21. package/lib/aqMessage.js +118 -7
  22. package/lib/aqQueue.js +242 -53
  23. package/lib/connection.js +1324 -465
  24. package/lib/constants.js +203 -0
  25. package/lib/dbObject.js +346 -32
  26. package/lib/errors.js +781 -0
  27. package/lib/impl/aqDeqOptions.js +197 -0
  28. package/lib/impl/aqEnqOptions.js +89 -0
  29. package/lib/impl/aqMessage.js +134 -0
  30. package/lib/impl/aqQueue.js +81 -0
  31. package/lib/impl/connection.js +529 -0
  32. package/lib/impl/dbObject.js +159 -0
  33. package/lib/impl/index.js +59 -0
  34. package/lib/impl/lob.js +85 -0
  35. package/lib/impl/pool.js +195 -0
  36. package/lib/impl/resultset.js +223 -0
  37. package/lib/impl/sodaCollection.js +174 -0
  38. package/lib/impl/sodaDatabase.js +81 -0
  39. package/lib/impl/sodaDocCursor.js +63 -0
  40. package/lib/impl/sodaDocument.js +98 -0
  41. package/lib/impl/sodaOperation.js +109 -0
  42. package/lib/lob.js +156 -68
  43. package/lib/oracledb.js +1047 -345
  44. package/lib/pool.js +654 -465
  45. package/lib/poolStatistics.js +23 -9
  46. package/lib/queryStream.js +14 -7
  47. package/lib/resultset.js +291 -183
  48. package/lib/settings.js +191 -0
  49. package/lib/sodaCollection.js +214 -201
  50. package/lib/sodaDatabase.js +107 -71
  51. package/lib/sodaDocCursor.js +44 -32
  52. package/lib/sodaDocument.js +76 -14
  53. package/lib/sodaOperation.js +131 -118
  54. package/lib/thin/connection.js +1038 -0
  55. package/lib/thin/dbObject.js +629 -0
  56. package/lib/thin/index.js +40 -0
  57. package/lib/thin/lob.js +188 -0
  58. package/lib/thin/pool.js +481 -0
  59. package/lib/thin/protocol/buffer.js +1040 -0
  60. package/lib/thin/protocol/capabilities.js +116 -0
  61. package/lib/thin/protocol/constants.js +764 -0
  62. package/lib/thin/protocol/encryptDecrypt.js +185 -0
  63. package/lib/thin/protocol/messages/auth.js +348 -0
  64. package/lib/thin/protocol/messages/base.js +475 -0
  65. package/lib/thin/protocol/messages/commit.js +56 -0
  66. package/lib/thin/protocol/messages/dataType.js +382 -0
  67. package/lib/thin/protocol/messages/execute.js +312 -0
  68. package/lib/thin/protocol/messages/fetch.js +60 -0
  69. package/lib/thin/protocol/messages/index.js +53 -0
  70. package/lib/thin/protocol/messages/lobOp.js +200 -0
  71. package/lib/thin/protocol/messages/logOff.js +53 -0
  72. package/lib/thin/protocol/messages/ping.js +56 -0
  73. package/lib/thin/protocol/messages/protocol.js +78 -0
  74. package/lib/thin/protocol/messages/rollback.js +56 -0
  75. package/lib/thin/protocol/messages/sessionRelease.js +60 -0
  76. package/lib/thin/protocol/messages/withData.js +811 -0
  77. package/lib/thin/protocol/oson.js +660 -0
  78. package/lib/thin/protocol/packet.js +520 -0
  79. package/lib/thin/protocol/protocol.js +202 -0
  80. package/lib/thin/protocol/utils.js +88 -0
  81. package/lib/thin/resultSet.js +122 -0
  82. package/lib/thin/sqlnet/connStrategy.js +175 -0
  83. package/lib/thin/sqlnet/constants.js +199 -0
  84. package/lib/thin/sqlnet/ezConnectResolver.js +488 -0
  85. package/lib/thin/sqlnet/navNodes.js +870 -0
  86. package/lib/thin/sqlnet/networkSession.js +620 -0
  87. package/lib/thin/sqlnet/ntTcp.js +525 -0
  88. package/lib/thin/sqlnet/nvStrToNvPair.js +783 -0
  89. package/lib/thin/sqlnet/packet.js +405 -0
  90. package/lib/thin/sqlnet/paramParser.js +205 -0
  91. package/lib/thin/sqlnet/sessionAtts.js +160 -0
  92. package/lib/thin/statement.js +301 -0
  93. package/lib/thin/util.js +289 -0
  94. package/lib/transformer.js +250 -0
  95. package/lib/types.js +357 -0
  96. package/lib/util.js +194 -110
  97. package/lib/version.js +36 -0
  98. package/package/README.md +33 -30
  99. package/package/install.js +89 -64
  100. package/package/prunebinaries.js +60 -12
  101. package/package.json +3 -3
  102. package/build/Release/oracledb-5.5.0-darwin-x64.node +0 -0
  103. package/build/Release/oracledb-5.5.0-darwin-x64.node-buildinfo.txt +0 -1
  104. package/build/Release/oracledb-5.5.0-linux-x64.node +0 -0
  105. package/build/Release/oracledb-5.5.0-linux-x64.node-buildinfo.txt +0 -1
  106. package/build/Release/oracledb-5.5.0-win32-x64.node +0 -0
  107. package/build/Release/oracledb-5.5.0-win32-x64.node-buildinfo.txt +0 -1
@@ -0,0 +1,529 @@
1
+ // Copyright (c) 2022, 2023, Oracle and/or its affiliates.
2
+
3
+ //-----------------------------------------------------------------------------
4
+ //
5
+ // This software is dual-licensed to you under the Universal Permissive License
6
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8
+ // either license.
9
+ //
10
+ // If you elect to accept the software under the Apache License, Version 2.0,
11
+ // the following applies:
12
+ //
13
+ // Licensed under the Apache License, Version 2.0 (the "License");
14
+ // you may not use this file except in compliance with the License.
15
+ // You may obtain a copy of the License at
16
+ //
17
+ // https://www.apache.org/licenses/LICENSE-2.0
18
+ //
19
+ // Unless required by applicable law or agreed to in writing, software
20
+ // distributed under the License is distributed on an "AS IS" BASIS,
21
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ // See the License for the specific language governing permissions and
23
+ // limitations under the License.
24
+ //
25
+ //-----------------------------------------------------------------------------
26
+
27
+ 'use strict';
28
+
29
+ const settings = require('../settings.js');
30
+ const errors = require('../errors.js');
31
+ const util = require('util');
32
+
33
+ // define implementation class
34
+ class ConnectionImpl {
35
+
36
+ constructor() {
37
+ this._inProgress = false;
38
+ this._dbObjectTypes = new Map();
39
+ this._requestQueue = [];
40
+ }
41
+
42
+ //---------------------------------------------------------------------------
43
+ // _acquireLock()
44
+ //
45
+ // Acquire a lock on the connection in order to prevent concurrent use of the
46
+ // connection.
47
+ //---------------------------------------------------------------------------
48
+ async _acquireLock() {
49
+ if (this._inProgress) {
50
+ if (settings.errorOnConcurrentExecute) {
51
+ errors.throwErr(errors.ERR_CONCURRENT_OPS);
52
+ }
53
+ await new Promise((resolve, reject) => {
54
+ const payload = {resolve: resolve, reject: reject};
55
+ this._requestQueue.push(payload);
56
+ });
57
+ }
58
+ this._inProgress = true;
59
+ }
60
+
61
+ //---------------------------------------------------------------------------
62
+ // _getConnImpl()
63
+ //
64
+ // Common method on all classes that make use of a connection -- used to
65
+ // ensure serialization of all use of the connection.
66
+ // ---------------------------------------------------------------------------
67
+ _getConnImpl() {
68
+ return this;
69
+ }
70
+
71
+ //---------------------------------------------------------------------------
72
+ // _getDbObjectType()
73
+ //
74
+ // Return the object identifying the object type. These are cached by fully
75
+ // qualified name and by OID (thin mode only).
76
+ //---------------------------------------------------------------------------
77
+ _getDbObjectType(schema, name, packageName, oid) {
78
+ let dbObjectType;
79
+ if (oid) {
80
+ dbObjectType = this._dbObjectTypes.get(oid);
81
+ if (dbObjectType)
82
+ return dbObjectType;
83
+ }
84
+ const fqn = (packageName) ? `${schema}.${packageName}.${name}` :
85
+ `${schema}.${name}`;
86
+ dbObjectType = this._dbObjectTypes.get(fqn);
87
+ if (!dbObjectType) {
88
+ dbObjectType = {
89
+ oid: oid,
90
+ fqn: fqn,
91
+ schema: schema,
92
+ name: name,
93
+ packageName: packageName,
94
+ partial: true,
95
+ isXmlType: (schema === 'SYS' && name === 'XMLTYPE')
96
+ };
97
+ this._dbObjectTypes.set(fqn, dbObjectType);
98
+ }
99
+ if (oid && !dbObjectType.oid) {
100
+ dbObjectType.oid = oid;
101
+ this._dbObjectTypes.set(oid, dbObjectType);
102
+ }
103
+ return dbObjectType;
104
+ }
105
+
106
+ //---------------------------------------------------------------------------
107
+ // _isDate()
108
+ //
109
+ // Method for determining if a value is a Date object. This method can be
110
+ // removed once Node-API version 5 is used in the C extension.
111
+ // ---------------------------------------------------------------------------
112
+ _isDate(val) {
113
+ return (util.isDate(val));
114
+ }
115
+
116
+ //---------------------------------------------------------------------------
117
+ // _releaseLock()
118
+ //
119
+ // Release the lock on the connection to allow another use of the connection.
120
+ //---------------------------------------------------------------------------
121
+ _releaseLock() {
122
+ if (this._requestQueue.length > 0) {
123
+ const payload = this._requestQueue.shift();
124
+ payload.resolve();
125
+ } else {
126
+ this._inProgress = false;
127
+ }
128
+ }
129
+
130
+ //---------------------------------------------------------------------------
131
+ // breakExecution()
132
+ //
133
+ // Breaks execution of a running statement.
134
+ //---------------------------------------------------------------------------
135
+ breakExecution() {
136
+ errors.throwNotImplemented("getting Oracle Server version number");
137
+ }
138
+
139
+ //---------------------------------------------------------------------------
140
+ // changePassword()
141
+ //
142
+ // Changes the password of the specified user.
143
+ //---------------------------------------------------------------------------
144
+ changePassword() {
145
+ errors.throwNotImplemented("changing the password");
146
+ }
147
+
148
+ //---------------------------------------------------------------------------
149
+ // close()
150
+ //
151
+ // Close the connection.
152
+ //---------------------------------------------------------------------------
153
+ close() {
154
+ errors.throwNotImplemented("closing the connection");
155
+ }
156
+
157
+ //---------------------------------------------------------------------------
158
+ // commit()
159
+ //
160
+ // Commits the transaction.
161
+ //---------------------------------------------------------------------------
162
+ commit() {
163
+ errors.throwNotImplemented("committing the transaction");
164
+ }
165
+
166
+ //---------------------------------------------------------------------------
167
+ // createLob()
168
+ //
169
+ // Creates a temporary LOB and returns it.
170
+ //---------------------------------------------------------------------------
171
+ createLob() {
172
+ errors.throwNotImplemented("creating a temporary LOB");
173
+ }
174
+
175
+ //---------------------------------------------------------------------------
176
+ // execute()
177
+ //
178
+ // Executes a SQL statement and returns the results.
179
+ //---------------------------------------------------------------------------
180
+ execute() {
181
+ errors.throwNotImplemented("executing a SQL statement");
182
+ }
183
+
184
+ //---------------------------------------------------------------------------
185
+ // executeMany()
186
+ //
187
+ // Executes a SQL statement and returns the results.
188
+ //---------------------------------------------------------------------------
189
+ executeMany() {
190
+ errors.throwNotImplemented("executing a SQL statement multiple times");
191
+ }
192
+
193
+ //---------------------------------------------------------------------------
194
+ // getCallTimeout()
195
+ //
196
+ // Returns the call timeout value.
197
+ //---------------------------------------------------------------------------
198
+ getCallTimeout() {
199
+ errors.throwNotImplemented("getting call timeout");
200
+ }
201
+
202
+ //---------------------------------------------------------------------------
203
+ // getCurrentSchema()
204
+ //
205
+ // Returns the current schema.
206
+ //---------------------------------------------------------------------------
207
+ getCurrentSchema() {
208
+ errors.throwNotImplemented("getting current schema");
209
+ }
210
+
211
+ //---------------------------------------------------------------------------
212
+ // getDbObjectClass()
213
+ //
214
+ // Returns a database object class given its name.
215
+ //---------------------------------------------------------------------------
216
+ getDbObjectClass() {
217
+ errors.throwNotImplemented("getting a database object class");
218
+ }
219
+
220
+ //---------------------------------------------------------------------------
221
+ // getExternalName()
222
+ //
223
+ // Returns the external name for TPC logging.
224
+ //---------------------------------------------------------------------------
225
+ getExternalName() {
226
+ errors.throwNotImplemented("getting the external name");
227
+ }
228
+
229
+ //---------------------------------------------------------------------------
230
+ // getInternalName()
231
+ //
232
+ // Returns the internal name for TPC logging.
233
+ //---------------------------------------------------------------------------
234
+ getInternalName() {
235
+ errors.throwNotImplemented("getting the internal name");
236
+ }
237
+
238
+ //---------------------------------------------------------------------------
239
+ // getOracleServerVersion()
240
+ //
241
+ // Returns an integer identifying the Oracle Server version.
242
+ //---------------------------------------------------------------------------
243
+ getOracleServerVersion() {
244
+ errors.throwNotImplemented("getting Oracle Server version number");
245
+ }
246
+
247
+ //---------------------------------------------------------------------------
248
+ // getOracleServerVersionString()
249
+ //
250
+ // Returns a string identifying the Oracle Server version.
251
+ //---------------------------------------------------------------------------
252
+ getOracleServerVersionString() {
253
+ errors.throwNotImplemented("getting Oracle Server version as a string");
254
+ }
255
+
256
+ //---------------------------------------------------------------------------
257
+ // getQueue()
258
+ //
259
+ // Returns a queue with the given name.
260
+ //---------------------------------------------------------------------------
261
+ getQueue() {
262
+ errors.throwNotImplemented("getting a queue");
263
+ }
264
+
265
+ //---------------------------------------------------------------------------
266
+ // getSodaDatabase()
267
+ //
268
+ // Returns a SodaDatabase object associated with the connection.
269
+ //---------------------------------------------------------------------------
270
+ getSodaDatabase() {
271
+ errors.throwNotImplemented("getting a SODA database");
272
+ }
273
+
274
+ //---------------------------------------------------------------------------
275
+ // getStatementInfo()
276
+ //
277
+ // Returns information about a statement.
278
+ //---------------------------------------------------------------------------
279
+ getStatementInfo() {
280
+ errors.throwNotImplemented("getting information about a statement");
281
+ }
282
+
283
+ //---------------------------------------------------------------------------
284
+ // getStmtCacheSize()
285
+ //
286
+ // Returns the size of the statement cache.
287
+ //---------------------------------------------------------------------------
288
+ getStmtCacheSize() {
289
+ errors.throwNotImplemented("getting the statement cache size");
290
+ }
291
+
292
+ //---------------------------------------------------------------------------
293
+ // getTag()
294
+ //
295
+ // Returns the tag associated with the connection.
296
+ //---------------------------------------------------------------------------
297
+ getTag() {
298
+ errors.throwNotImplemented("getting the tag for the connection");
299
+ }
300
+
301
+ //---------------------------------------------------------------------------
302
+ // isHealthy()
303
+ //
304
+ // Returns whether the connection is healthy or not.
305
+ //---------------------------------------------------------------------------
306
+ isHealthy() {
307
+ errors.throwNotImplemented("getting the health of the connection");
308
+ }
309
+
310
+ //---------------------------------------------------------------------------
311
+ // ping()
312
+ //
313
+ // Sends a "ping" to the database to see if it is "alive".
314
+ //---------------------------------------------------------------------------
315
+ ping() {
316
+ errors.throwNotImplemented("sending a ping to the database");
317
+ }
318
+
319
+ //---------------------------------------------------------------------------
320
+ // rollback()
321
+ //
322
+ // Rolls back a transaction.
323
+ //---------------------------------------------------------------------------
324
+ rollback() {
325
+ errors.throwNotImplemented("rolling back a transaction");
326
+ }
327
+
328
+ //---------------------------------------------------------------------------
329
+ // setAction()
330
+ //
331
+ // Sets the end-to-end tracing attribute "action".
332
+ //---------------------------------------------------------------------------
333
+ setAction() {
334
+ errors.throwNotImplemented("setting end-to-end attribute 'action'");
335
+ }
336
+
337
+ //---------------------------------------------------------------------------
338
+ // setCallTimeout()
339
+ //
340
+ // Sets the call timeout value.
341
+ //---------------------------------------------------------------------------
342
+ setCallTimeout() {
343
+ errors.throwNotImplemented("setting call timeout");
344
+ }
345
+
346
+ //---------------------------------------------------------------------------
347
+ // setClientId()
348
+ //
349
+ // Sets the end-to-end tracing attribute "clientId".
350
+ //---------------------------------------------------------------------------
351
+ setClientId() {
352
+ errors.throwNotImplemented("setting end-to-end attribute 'clientId'");
353
+ }
354
+
355
+ //---------------------------------------------------------------------------
356
+ // setClientInfo()
357
+ //
358
+ // Sets the end-to-end tracing attribute "clientInfo".
359
+ //---------------------------------------------------------------------------
360
+ setClientInfo() {
361
+ errors.throwNotImplemented("setting end-to-end attribute 'clientInfo'");
362
+ }
363
+
364
+ //---------------------------------------------------------------------------
365
+ // setCurrentSchema()
366
+ //
367
+ // Sets the current schema.
368
+ //---------------------------------------------------------------------------
369
+ setCurrentSchema() {
370
+ errors.throwNotImplemented("setting the current schema");
371
+ }
372
+
373
+ //---------------------------------------------------------------------------
374
+ // setDbOp()
375
+ //
376
+ // Sets the end-to-end tracing attribute "dbOp".
377
+ //---------------------------------------------------------------------------
378
+ setDbOp() {
379
+ errors.throwNotImplemented("setting end-to-end attribute 'dbOp'");
380
+ }
381
+
382
+ //---------------------------------------------------------------------------
383
+ // setECID()
384
+ //
385
+ // Sets the end-to-end tracing attribute "ecid".
386
+ //---------------------------------------------------------------------------
387
+ setECID() {
388
+ errors.throwNotImplemented("setting end-to-end attribute 'ecid'");
389
+ }
390
+
391
+ //---------------------------------------------------------------------------
392
+ // setExternalName()
393
+ //
394
+ // Sets the external name for TPC logging.
395
+ //---------------------------------------------------------------------------
396
+ setExternalName() {
397
+ errors.throwNotImplemented("setting the external name");
398
+ }
399
+
400
+ //---------------------------------------------------------------------------
401
+ // setInternalName()
402
+ //
403
+ // Sets the internal name for TPC logging.
404
+ //---------------------------------------------------------------------------
405
+ setInternalName() {
406
+ errors.throwNotImplemented("setting the internal name");
407
+ }
408
+
409
+ //---------------------------------------------------------------------------
410
+ // setStmtCacheSize()
411
+ //
412
+ // Sets the size of the statement cache.
413
+ //---------------------------------------------------------------------------
414
+ setStmtCacheSize() {
415
+ errors.throwNotImplemented("setting the size of the statement cache");
416
+ }
417
+
418
+ //---------------------------------------------------------------------------
419
+ // setModule()
420
+ //
421
+ // Sets the end-to-end tracing attribute "module".
422
+ //---------------------------------------------------------------------------
423
+ setModule() {
424
+ errors.throwNotImplemented("setting end-to-end attribute 'module'");
425
+ }
426
+
427
+ //---------------------------------------------------------------------------
428
+ // setTag()
429
+ //
430
+ // Sets the tag associated with the connection.
431
+ //---------------------------------------------------------------------------
432
+ setTag() {
433
+ errors.throwNotImplemented("setting the tag for the connection");
434
+ }
435
+
436
+ //---------------------------------------------------------------------------
437
+ // shutdown()
438
+ //
439
+ // Shuts down the database instance.
440
+ //---------------------------------------------------------------------------
441
+ shutdown() {
442
+ errors.throwNotImplemented("shutting down the database instance");
443
+ }
444
+
445
+ //---------------------------------------------------------------------------
446
+ // startup()
447
+ //
448
+ // Starts up a database instance.
449
+ //---------------------------------------------------------------------------
450
+ startup() {
451
+ errors.throwNotImplemented("starting up the database instance");
452
+ }
453
+
454
+ //---------------------------------------------------------------------------
455
+ // subscribe()
456
+ //
457
+ // Subscribes to events in the database.
458
+ //---------------------------------------------------------------------------
459
+ subscribe() {
460
+ errors.throwNotImplemented("subscribing to events in the database");
461
+ }
462
+
463
+ //---------------------------------------------------------------------------
464
+ // tpcBegin()
465
+ //
466
+ // Starts a two-phase transaction.
467
+ //---------------------------------------------------------------------------
468
+ tpcBegin() {
469
+ errors.throwNotImplemented("starting a two-phase transaction");
470
+ }
471
+
472
+ //---------------------------------------------------------------------------
473
+ // tpcCommit()
474
+ //
475
+ // Commits a two-phase transaction.
476
+ //---------------------------------------------------------------------------
477
+ tpcCommit() {
478
+ errors.throwNotImplemented("committing a two-phase transaction");
479
+ }
480
+
481
+ //---------------------------------------------------------------------------
482
+ // tpcEnd()
483
+ //
484
+ // Ends a two-phase transaction.
485
+ //---------------------------------------------------------------------------
486
+ tpcEnd() {
487
+ errors.throwNotImplemented("ending a two-phase transaction");
488
+ }
489
+
490
+ //---------------------------------------------------------------------------
491
+ // tpcForget()
492
+ //
493
+ // Forgets a two-phase transaction.
494
+ //---------------------------------------------------------------------------
495
+ tpcForget() {
496
+ errors.throwNotImplemented("forgetting a two-phase transaction");
497
+ }
498
+
499
+ //---------------------------------------------------------------------------
500
+ // tpcPrepare()
501
+ //
502
+ // Prepares a two-phase transaction for commit.
503
+ //---------------------------------------------------------------------------
504
+ tpcPrepare() {
505
+ errors.throwNotImplemented("preparing a two-phase transaction");
506
+ }
507
+
508
+ //---------------------------------------------------------------------------
509
+ // tpcRollback()
510
+ //
511
+ // Rolls back a two-phase transaction.
512
+ //---------------------------------------------------------------------------
513
+ tpcRollback() {
514
+ errors.throwNotImplemented("rolling back a two-phase transaction");
515
+ }
516
+
517
+ //---------------------------------------------------------------------------
518
+ // unsubscribe()
519
+ //
520
+ // Unsubscribes from events in the database.
521
+ //---------------------------------------------------------------------------
522
+ unsubscribe() {
523
+ errors.throwNotImplemented("unsubscribing from events");
524
+ }
525
+
526
+ }
527
+
528
+ // export just the class
529
+ module.exports = ConnectionImpl;
@@ -0,0 +1,159 @@
1
+ // Copyright (c) 2022, 2023, Oracle and/or its affiliates.
2
+
3
+ //----------------------------------------------------------------------------
4
+ //
5
+ // This software is dual-licensed to you under the Universal Permissive License
6
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8
+ // either license.
9
+ //
10
+ // If you elect to accept the software under the Apache License, Version 2.0,
11
+ // the following applies:
12
+ //
13
+ // Licensed under the Apache License, Version 2.0 (the "License");
14
+ // you may not use this file except in compliance with the License.
15
+ // You may obtain a copy of the License at
16
+ //
17
+ // https://www.apache.org/licenses/LICENSE-2.0
18
+ //
19
+ // Unless required by applicable law or agreed to in writing, software
20
+ // distributed under the License is distributed on an "AS IS" BASIS,
21
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ // See the License for the specific language governing permissions and
23
+ // limitations under the License.
24
+ //
25
+ //-----------------------------------------------------------------------------
26
+
27
+ 'use strict';
28
+
29
+ const errors = require('../errors.js');
30
+
31
+ // define base database object class; instances of this class are never
32
+ // instantiated; instead, classes subclassed from this one will be
33
+ // instantiated; a cache of these classes are maintained on each connection
34
+ class DbObjectImpl {
35
+
36
+ constructor(objType) {
37
+ this._objType = objType;
38
+ }
39
+
40
+ //---------------------------------------------------------------------------
41
+ // append()
42
+ //
43
+ // Appends an element to the collection.
44
+ //---------------------------------------------------------------------------
45
+ append() {
46
+ errors.throwNotImplemented("appending element to collection");
47
+ }
48
+
49
+ //---------------------------------------------------------------------------
50
+ // copy()
51
+ //
52
+ // Creates and returns a copy of the object.
53
+ //---------------------------------------------------------------------------
54
+ copy() {
55
+ errors.throwNotImplemented("copying an object");
56
+ }
57
+
58
+ //---------------------------------------------------------------------------
59
+ // deleteElement()
60
+ //
61
+ // Deletes an element from a collection.
62
+ //---------------------------------------------------------------------------
63
+ deleteElement() {
64
+ errors.throwNotImplemented("deleting an element from a collection");
65
+ }
66
+
67
+ //---------------------------------------------------------------------------
68
+ // getElement()
69
+ //
70
+ // Returns an element from the collection.
71
+ //---------------------------------------------------------------------------
72
+ getElement() {
73
+ errors.throwNotImplemented("getting an element from a collection");
74
+ }
75
+
76
+ //---------------------------------------------------------------------------
77
+ // getFirstIndex()
78
+ //
79
+ // Returns the first index in a collection.
80
+ //---------------------------------------------------------------------------
81
+ getFirstIndex() {
82
+ errors.throwNotImplemented("getting the first index in a collection");
83
+ }
84
+
85
+ //---------------------------------------------------------------------------
86
+ // getKeys()
87
+ //
88
+ // Returns the keys of the collection in a JavaScript array.
89
+ //---------------------------------------------------------------------------
90
+ getKeys() {
91
+ errors.throwNotImplemented("returning the keys of a collection");
92
+ }
93
+
94
+ //---------------------------------------------------------------------------
95
+ // getLastIndex()
96
+ //
97
+ // Returns the last index in a collection.
98
+ //---------------------------------------------------------------------------
99
+ getLastIndex() {
100
+ errors.throwNotImplemented("getting the last index in a collection");
101
+ }
102
+
103
+ //---------------------------------------------------------------------------
104
+ // getNextIndex()
105
+ //
106
+ // Returns the next index in a collection.
107
+ //---------------------------------------------------------------------------
108
+ getNextIndex() {
109
+ errors.throwNotImplemented("getting the next index in a collection");
110
+ }
111
+
112
+ //---------------------------------------------------------------------------
113
+ // getPrevIndex()
114
+ //
115
+ // Returns the previous index in a collection.
116
+ //---------------------------------------------------------------------------
117
+ getPrevIndex() {
118
+ errors.throwNotImplemented("getting the previous index in a collection");
119
+ }
120
+
121
+ //---------------------------------------------------------------------------
122
+ // getValues()
123
+ //
124
+ // Returns the values of the collection in a JavaScript array.
125
+ //---------------------------------------------------------------------------
126
+ getValues() {
127
+ errors.throwNotImplemented("getting the values in a collection");
128
+ }
129
+
130
+ //---------------------------------------------------------------------------
131
+ // hasElement()
132
+ //
133
+ // Returns whether an element exists at the given index.
134
+ //---------------------------------------------------------------------------
135
+ hasElement() {
136
+ errors.throwNotImplemented("getting if value exists in a collection");
137
+ }
138
+
139
+ //---------------------------------------------------------------------------
140
+ // setElement()
141
+ //
142
+ // Sets the element at the given index in the collection.
143
+ //---------------------------------------------------------------------------
144
+ setElement() {
145
+ errors.throwNotImplemented("setting an element in a collection");
146
+ }
147
+
148
+ //---------------------------------------------------------------------------
149
+ // trim()
150
+ //
151
+ // Trim the specified number of elements from the end of the collection.
152
+ //---------------------------------------------------------------------------
153
+ trim() {
154
+ errors.throwNotImplemented("trimming elements from a collection");
155
+ }
156
+
157
+ }
158
+
159
+ module.exports = DbObjectImpl;