oracledb 3.0.0 → 3.1.2

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 (112) hide show
  1. package/CHANGELOG.md +135 -8
  2. package/README.md +6 -4
  3. package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
  4. package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +1 -0
  5. package/build/Release/oracledb-abi48-linux-x64.node +0 -0
  6. package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-abi48-win32-x64.node +0 -0
  8. package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
  10. package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-abi57-linux-x64.node +0 -0
  12. package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +1 -0
  13. package/build/Release/oracledb-abi57-win32-x64.node +0 -0
  14. package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +1 -0
  15. package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
  16. package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +1 -0
  17. package/build/Release/oracledb-abi64-linux-x64.node +0 -0
  18. package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +1 -0
  19. package/build/Release/oracledb-abi64-win32-x64.node +0 -0
  20. package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +1 -0
  21. package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
  22. package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +1 -0
  23. package/build/Release/oracledb-abi67-linux-x64.node +0 -0
  24. package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +1 -0
  25. package/build/Release/oracledb-abi67-win32-x64.node +0 -0
  26. package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +1 -0
  27. package/lib/connection.js +18 -4
  28. package/lib/oracledb.js +44 -92
  29. package/lib/pool.js +36 -2
  30. package/lib/sodaCollection.js +1 -1
  31. package/lib/sodaDatabase.js +1 -1
  32. package/lib/util.js +82 -5
  33. package/package/README.md +32 -101
  34. package/package/install.js +139 -0
  35. package/package/prunebinaries.js +51 -0
  36. package/package.json +4 -11
  37. package/binding.gyp +0 -162
  38. package/lib/rel.txt +0 -1
  39. package/odpi/.npmignore +0 -4
  40. package/odpi/LICENSE.md +0 -218
  41. package/odpi/README.md +0 -61
  42. package/odpi/embed/README.md +0 -4
  43. package/odpi/embed/dpi.c +0 -50
  44. package/odpi/include/dpi.h +0 -1748
  45. package/odpi/src/dpiConn.c +0 -2089
  46. package/odpi/src/dpiContext.c +0 -296
  47. package/odpi/src/dpiData.c +0 -797
  48. package/odpi/src/dpiDebug.c +0 -184
  49. package/odpi/src/dpiDeqOptions.c +0 -370
  50. package/odpi/src/dpiEnqOptions.c +0 -174
  51. package/odpi/src/dpiEnv.c +0 -189
  52. package/odpi/src/dpiError.c +0 -204
  53. package/odpi/src/dpiErrorMessages.h +0 -86
  54. package/odpi/src/dpiGen.c +0 -303
  55. package/odpi/src/dpiGlobal.c +0 -292
  56. package/odpi/src/dpiHandleList.c +0 -117
  57. package/odpi/src/dpiHandlePool.c +0 -118
  58. package/odpi/src/dpiImpl.h +0 -1707
  59. package/odpi/src/dpiLob.c +0 -506
  60. package/odpi/src/dpiMsgProps.c +0 -386
  61. package/odpi/src/dpiObject.c +0 -897
  62. package/odpi/src/dpiObjectAttr.c +0 -115
  63. package/odpi/src/dpiObjectType.c +0 -326
  64. package/odpi/src/dpiOci.c +0 -3527
  65. package/odpi/src/dpiOracleType.c +0 -492
  66. package/odpi/src/dpiPool.c +0 -549
  67. package/odpi/src/dpiRowid.c +0 -136
  68. package/odpi/src/dpiSodaColl.c +0 -685
  69. package/odpi/src/dpiSodaCollCursor.c +0 -143
  70. package/odpi/src/dpiSodaDb.c +0 -432
  71. package/odpi/src/dpiSodaDoc.c +0 -230
  72. package/odpi/src/dpiSodaDocCursor.c +0 -143
  73. package/odpi/src/dpiStmt.c +0 -1797
  74. package/odpi/src/dpiSubscr.c +0 -674
  75. package/odpi/src/dpiUtils.c +0 -410
  76. package/odpi/src/dpiVar.c +0 -1794
  77. package/package/MAKEPKG.BAT +0 -156
  78. package/package/Makefile +0 -85
  79. package/package/createpackage.js +0 -186
  80. package/package/extractpackage.js +0 -76
  81. package/package/getversion.js +0 -37
  82. package/package/oracledbinstall.js +0 -497
  83. package/package/package.json +0 -54
  84. package/package/util.js +0 -286
  85. package/src/njsCommon.cpp +0 -1055
  86. package/src/njsCommon.h +0 -484
  87. package/src/njsConnection.cpp +0 -2926
  88. package/src/njsConnection.h +0 -227
  89. package/src/njsIntLob.cpp +0 -618
  90. package/src/njsIntLob.h +0 -179
  91. package/src/njsMessages.cpp +0 -122
  92. package/src/njsMessages.h +0 -118
  93. package/src/njsOracle.cpp +0 -1274
  94. package/src/njsOracle.h +0 -237
  95. package/src/njsPool.cpp +0 -482
  96. package/src/njsPool.h +0 -132
  97. package/src/njsResultSet.cpp +0 -478
  98. package/src/njsResultSet.h +0 -120
  99. package/src/njsSodaCollection.cpp +0 -507
  100. package/src/njsSodaCollection.h +0 -128
  101. package/src/njsSodaDatabase.cpp +0 -335
  102. package/src/njsSodaDatabase.h +0 -108
  103. package/src/njsSodaDocCursor.cpp +0 -203
  104. package/src/njsSodaDocCursor.h +0 -94
  105. package/src/njsSodaDocument.cpp +0 -412
  106. package/src/njsSodaDocument.h +0 -105
  107. package/src/njsSodaOperation.cpp +0 -557
  108. package/src/njsSodaOperation.h +0 -123
  109. package/src/njsSubscription.cpp +0 -388
  110. package/src/njsSubscription.h +0 -111
  111. package/src/njsUtils.cpp +0 -158
  112. package/src/njsUtils.h +0 -68
package/src/njsCommon.h DELETED
@@ -1,484 +0,0 @@
1
- /* Copyright (c) 2015, 2018, Oracle and/or its affiliates.
2
- All rights reserved. */
3
-
4
- /******************************************************************************
5
- *
6
- * You may not use the identified files except in compliance with the Apache
7
- * License, Version 2.0 (the "License.")
8
- *
9
- * You may obtain a copy of the License at
10
- * http://www.apache.org/licenses/LICENSE-2.0.
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- *
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- *
19
- * This file uses NAN:
20
- *
21
- * Copyright (c) 2015 NAN contributors
22
- *
23
- * NAN contributors listed at https://github.com/rvagg/nan#contributors
24
- *
25
- * Permission is hereby granted, free of charge, to any person obtaining
26
- * a copy of this software and associated documentation files (the
27
- * "Software"), to deal in the Software without restriction, including
28
- * without limitation the rights to use, copy, modify, merge, publish,
29
- * distribute, sublicense, and/or sell copies of the Software, and to
30
- * permit persons to whom the Software is furnished to do so, subject to
31
- * the following conditions:
32
- *
33
- * The above copyright notice and this permission notice shall be
34
- * included in all copies or substantial portions of the Software.
35
- *
36
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
40
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
41
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
42
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43
- *
44
- * NAME
45
- * njsCommon.h
46
- *
47
- * DESCRIPTION
48
- * Common classes used throughout driver.
49
- *
50
- *****************************************************************************/
51
-
52
- #ifndef __NJSCOMMON_H__
53
- #define __NJSCOMMON_H__
54
-
55
- #include <v8.h>
56
- #include <node.h>
57
- #include "nan.h"
58
- #include <string>
59
- #include <cstring>
60
- #include <vector>
61
- #include <stdlib.h>
62
- #include <stdio.h>
63
-
64
- extern "C" {
65
- #include "dpi.h"
66
- }
67
-
68
- #include "njsMessages.h"
69
-
70
- using namespace v8;
71
- using namespace node;
72
-
73
- class njsBaton;
74
- class njsOracledb;
75
- class njsProtoILob;
76
- class njsSubscription;
77
-
78
- //-----------------------------------------------------------------------------
79
- // njsBindDir
80
- // User defined bind directions.
81
- //-----------------------------------------------------------------------------
82
- typedef enum {
83
- NJS_BIND_IN = 3001,
84
- NJS_BIND_INOUT = 3002,
85
- NJS_BIND_OUT = 3003
86
- } njsBindDir;
87
-
88
-
89
- //-----------------------------------------------------------------------------
90
- // njsRowsType
91
- // Values used for "outFormat".
92
- //-----------------------------------------------------------------------------
93
- typedef enum {
94
- NJS_ROWS_ARRAY = 4001,
95
- NJS_ROWS_OBJECT = 4002
96
- } njsRowsType;
97
-
98
-
99
- //-----------------------------------------------------------------------------
100
- // njsDataType
101
- // User defined data types for binds and defines.
102
- //-----------------------------------------------------------------------------
103
- typedef enum {
104
- NJS_DATATYPE_UNKNOWN = -1,
105
- NJS_DATATYPE_DEFAULT = 0, // Used in FetchInfo Context only (use DB type)
106
- NJS_DATATYPE_STR = 2001,
107
- NJS_DATATYPE_NUM = 2002,
108
- NJS_DATATYPE_DATE = 2003,
109
- NJS_DATATYPE_CURSOR = 2004,
110
- NJS_DATATYPE_BUFFER = 2005,
111
- NJS_DATATYPE_CLOB = 2006,
112
- NJS_DATATYPE_BLOB = 2007,
113
- NJS_DATATYPE_INT = 2008
114
- } njsDataType;
115
-
116
-
117
- //-----------------------------------------------------------------------------
118
- // njsDBType
119
- // Database types used for extended meta data
120
- //-----------------------------------------------------------------------------
121
- typedef enum {
122
- NJS_DB_TYPE_UNKNOWN = -1,
123
- NJS_DB_TYPE_DEFAULT = 0,
124
- NJS_DB_TYPE_VARCHAR = 1,
125
- NJS_DB_TYPE_NUMBER = 2,
126
- NJS_DB_TYPE_LONG = 8,
127
- NJS_DB_TYPE_DATE = 12,
128
- NJS_DB_TYPE_RAW = 23,
129
- NJS_DB_TYPE_LONG_RAW = 24,
130
- NJS_DB_TYPE_CHAR = 96,
131
- NJS_DB_TYPE_BINARY_FLOAT = 100,
132
- NJS_DB_TYPE_BINARY_DOUBLE = 101,
133
- NJS_DB_TYPE_ROWID = 104,
134
- NJS_DB_TYPE_CLOB = 112,
135
- NJS_DB_TYPE_BLOB = 113,
136
- NJS_DB_TYPE_TIMESTAMP = 187,
137
- NJS_DB_TYPE_TIMESTAMP_TZ = 188,
138
- NJS_DB_TYPE_TIMESTAMP_LTZ = 232,
139
-
140
- /* Pseudo types */
141
- NJS_DB_TYPE_NCHAR = 1096,
142
- NJS_DB_TYPE_NVARCHAR = 1001,
143
- NJS_DB_TYPE_NCLOB = 1112,
144
- } njsDBType;
145
-
146
-
147
- //-----------------------------------------------------------------------------
148
- // njsSodaMapMode
149
- // Soda-Collection creation Map mode
150
- //-----------------------------------------------------------------------------
151
- typedef enum {
152
- NJS_SODA_COLL_CREATE_MODE_DEFAULT = 0,
153
- NJS_SODA_COLL_CREATE_MODE_MAP = 5001
154
- } njsSodaMapMode;
155
-
156
-
157
- //-----------------------------------------------------------------------------
158
- // njsVariableBuffer
159
- // Class used for keeping track of ODPI-C buffers and proto ILob objects.
160
- //-----------------------------------------------------------------------------
161
- class njsVariableBuffer {
162
- public:
163
- uint32_t numElements;
164
- dpiData *dpiVarData;
165
- njsProtoILob *lobs;
166
-
167
- njsVariableBuffer() : numElements(0), dpiVarData(NULL), lobs(NULL) {}
168
- ~njsVariableBuffer();
169
- };
170
-
171
-
172
- //-----------------------------------------------------------------------------
173
- // njsVariable
174
- // Class used for keeping track of variables used for binding/fetching data.
175
- //-----------------------------------------------------------------------------
176
- class njsVariable {
177
- public:
178
- std::string name;
179
- uint32_t pos;
180
- dpiOracleTypeNum dbTypeNum;
181
- dpiOracleTypeNum varTypeNum;
182
- dpiNativeTypeNum nativeTypeNum;
183
- dpiVar *dpiVarHandle;
184
- njsBindDir bindDir;
185
- njsDataType bindDataType;
186
- uint32_t maxArraySize;
187
- uint32_t maxSize;
188
- uint32_t dbSizeInBytes;
189
- int16_t precision;
190
- int8_t scale;
191
- bool isArray;
192
- bool isNullable;
193
- njsVariableBuffer buffer;
194
- njsVariableBuffer* dmlReturningBuffers;
195
- uint32_t numQueryVars;
196
- njsVariable *queryVars;
197
-
198
- njsVariable() : pos(0), dbTypeNum(DPI_ORACLE_TYPE_VARCHAR),
199
- varTypeNum(DPI_ORACLE_TYPE_VARCHAR),
200
- nativeTypeNum(DPI_NATIVE_TYPE_BYTES), dpiVarHandle(NULL),
201
- bindDir(NJS_BIND_IN), bindDataType(NJS_DATATYPE_DEFAULT),
202
- maxArraySize(0), maxSize(0), dbSizeInBytes(0), precision(0),
203
- scale(0), isArray(false), isNullable(false),
204
- dmlReturningBuffers(NULL), numQueryVars(0), queryVars(NULL) {}
205
- ~njsVariable();
206
- njsDataType DataType();
207
- njsDBType DBType();
208
- };
209
-
210
-
211
- //-----------------------------------------------------------------------------
212
- // njsFetchInfo
213
- // Class used for keeping track of which data types have been specifically
214
- // requested from JS.
215
- //-----------------------------------------------------------------------------
216
- class njsFetchInfo {
217
- public:
218
- std::string name;
219
- njsDataType type;
220
-
221
- njsFetchInfo() : type(NJS_DATATYPE_DEFAULT) {}
222
- };
223
-
224
-
225
- //-----------------------------------------------------------------------------
226
- // njsCommon
227
- // Class used for all objects that are exposed to JS.
228
- //-----------------------------------------------------------------------------
229
- class njsCommon : public Nan::ObjectWrap {
230
- friend class njsBaton;
231
- protected:
232
-
233
- virtual njsErrorType GetInvalidErrorType() const = 0;
234
- virtual bool IsValid() const = 0;
235
-
236
- static bool Validate(njsCommon *obj, bool checkValid);
237
- static njsCommon *ValidateGetter(Nan::NAN_GETTER_ARGS_TYPE args);
238
- static njsCommon *ValidateSetter(Nan::NAN_SETTER_ARGS_TYPE args);
239
- static njsCommon *ValidateArgs(Nan::NAN_METHOD_ARGS_TYPE args,
240
- int minArgs, int maxArgs);
241
- static void PropertyIsReadOnly(const char *name);
242
-
243
- njsBaton *CreateBaton(Nan::NAN_METHOD_ARGS_TYPE args);
244
- bool GetObjectArg(Nan::NAN_METHOD_ARGS_TYPE args, int index,
245
- Local<Object> &value);
246
- bool GetStringArg(Nan::NAN_METHOD_ARGS_TYPE args, int index,
247
- std::string &value);
248
- bool GetUnsignedIntArg(Nan::NAN_METHOD_ARGS_TYPE args, int index,
249
- uint32_t *value);
250
- bool SetPropBool(Local<Value> value, bool *valuePtr, const char *name);
251
- bool SetPropInt(Local<Value> value, int32_t *valuePtr, const char *name);
252
- bool SetPropPositiveInt(Local<Value> value, uint32_t *valuePtr,
253
- const char *name);
254
- bool SetPropString(Local<Value> value, std::string *valuePtr,
255
- const char *name);
256
- bool SetPropUnsignedInt(Local<Value> value, uint32_t *valuePtr,
257
- const char *name);
258
-
259
- // used to prevent multiple asynchronous methods from acting upon this
260
- // object at the same time
261
- njsBaton *activeBaton;
262
- };
263
-
264
-
265
- //-----------------------------------------------------------------------------
266
- // njsBaton
267
- // Baton used for asynchronous methods. Node.js does not allow objects to be
268
- // created on one thread and used on another so any data needs to be passed
269
- // between threads using this class. This class also simplifies the code
270
- // required to make asynchronous calls.
271
- //-----------------------------------------------------------------------------
272
- class njsBaton {
273
- public:
274
- std::string error;
275
- std::string sql;
276
- std::string user;
277
- std::string password;
278
- std::string newPassword;
279
- std::string connectString;
280
- std::string connClass;
281
- std::string edition;
282
- std::string ipAddress;
283
- std::string name;
284
- uint32_t poolMin;
285
- uint32_t poolMax;
286
- uint32_t poolIncrement;
287
- uint32_t poolTimeout;
288
- int32_t poolPingInterval;
289
- dpiPool *dpiPoolHandle;
290
- dpiConn *dpiConnHandle;
291
- dpiStmt *dpiStmtHandle;
292
- dpiLob *dpiLobHandle;
293
- dpiSubscr *dpiSubscrHandle;
294
- dpiStmtInfo stmtInfo;
295
- uint32_t stmtCacheSize;
296
- uint32_t lobPrefetchSize;
297
- uint32_t maxRows;
298
- uint32_t bindArraySize;
299
- uint32_t fetchArraySize;
300
- uint32_t privilege;
301
- uint32_t rowsFetched;
302
- uint32_t bufferRowIndex;
303
- uint64_t rowsAffected;
304
- unsigned int outFormat;
305
- uint32_t numQueryVars;
306
- njsVariable *queryVars;
307
- uint32_t numBindVars;
308
- njsVariable *bindVars;
309
- uint32_t numFetchInfo;
310
- njsFetchInfo *fetchInfo;
311
- uint32_t numFetchAsStringTypes;
312
- njsDataType *fetchAsStringTypes;
313
- uint32_t numFetchAsBufferTypes;
314
- njsDataType *fetchAsBufferTypes;
315
- njsProtoILob *protoILob;
316
- bool externalAuth;
317
- bool homogeneous; // True: one user, false: multiple user
318
- bool getRS;
319
- bool autoCommit;
320
- bool extendedMetaData;
321
- bool isReturning;
322
- bool isPLSQL;
323
- bool events;
324
- bool batchErrors;
325
- bool dmlRowCounts;
326
- uint64_t bufferSize;
327
- char *bufferPtr;
328
- uint64_t lobOffset;
329
- uint64_t lobAmount;
330
- uint32_t numRowCounts;
331
- uint64_t *rowCounts;
332
- uint32_t timeout;
333
- uint32_t qos;
334
- uint32_t operations;
335
- uint32_t numBatchErrorInfos;
336
- dpiErrorInfo *batchErrorInfos;
337
- dpiErrorInfo errorInfo;
338
- bool dpiError;
339
- uint32_t portNumber;
340
- uint32_t subscrGroupingClass;
341
- uint32_t subscrGroupingValue;
342
- uint32_t subscrGroupingType;
343
- njsSubscription *subscription;
344
- njsCommon *callingObj;
345
-
346
- std::string sodaCollName;
347
- std::string sodaMetaData;
348
- dpiSodaDb *dpiSodaDbHandle;
349
- dpiSodaColl *dpiSodaCollHandle;
350
-
351
- // getCollectionNames
352
- int32_t limit;
353
- std::string startsWith;
354
- dpiSodaCollNames *sodaCollNames;
355
- uint32_t createCollectionMode;
356
- int32_t isDropped;
357
-
358
- dpiSodaDoc *dpiSodaDocHandle;
359
-
360
- // index
361
- std::string indexSpec;
362
- std::string indexName;
363
- int32_t replaced;
364
-
365
- // createDocument
366
- std::string content;
367
- std::string key;
368
- std::string mediaType;
369
-
370
- // findOne
371
- uint64_t docCount;
372
- std::string filter;
373
- std::string version;
374
- uint64_t docsDeleted;
375
- dpiSodaDocCursor *dpiSodaDocCursorHandle;
376
- std::vector<dpiSodaDoc*> dpiSodaDocsVec;
377
- std::vector<std::string> keysVec;
378
-
379
- dpiSodaOperOptions *sodaOperOptions;
380
-
381
- uint32_t callTimeout;
382
- int setCallTimeout;
383
-
384
- Nan::Persistent<Object> jsCallingObj;
385
- Nan::Persistent<Object> jsOracledb;
386
- Nan::Persistent<Object> jsBuffer;
387
- Nan::Persistent<Object> jsSubscription;
388
- Nan::Persistent<Function> jsCallback;
389
- bool force;
390
-
391
- njsBaton(Local<Function> callback, Local<Object> callingObj) :
392
- poolMin(0), poolMax(0), poolIncrement(0), poolTimeout(0),
393
- poolPingInterval(0), dpiPoolHandle(NULL), dpiConnHandle(NULL),
394
- dpiStmtHandle(NULL), dpiLobHandle(NULL), dpiSubscrHandle(NULL),
395
- stmtCacheSize(0), lobPrefetchSize(0), maxRows(0), bindArraySize(1),
396
- fetchArraySize(0), privilege(0), rowsFetched(0), bufferRowIndex(0),
397
- rowsAffected(0), outFormat(0), numQueryVars(0), queryVars(NULL),
398
- numBindVars(0), bindVars(NULL), numFetchInfo(0), fetchInfo(NULL),
399
- numFetchAsStringTypes(0), fetchAsStringTypes(NULL),
400
- numFetchAsBufferTypes(0), fetchAsBufferTypes(NULL),
401
- protoILob(NULL), externalAuth(false), homogeneous(true),
402
- getRS(false), autoCommit(false), extendedMetaData(false),
403
- isReturning(false), isPLSQL(false), events(false),
404
- batchErrors(false), dmlRowCounts(false), bufferSize(0),
405
- bufferPtr(NULL), lobOffset(0), lobAmount(0), numRowCounts(0),
406
- rowCounts(NULL), timeout(0), qos(0), operations(0),
407
- numBatchErrorInfos(0), batchErrorInfos(NULL),
408
- dpiError(false), portNumber(0), subscrGroupingClass(0),
409
- subscrGroupingValue(0), subscrGroupingType(0),
410
- subscription(NULL), dpiSodaDbHandle(NULL), dpiSodaCollHandle(NULL),
411
- limit(0), sodaCollNames(NULL),
412
- createCollectionMode(NJS_SODA_COLL_CREATE_MODE_DEFAULT),
413
- isDropped(0), dpiSodaDocHandle(NULL), docCount(0),
414
- docsDeleted(0), dpiSodaDocCursorHandle(NULL),
415
- sodaOperOptions(NULL), callTimeout(0), setCallTimeout(0),
416
- force(false) {
417
- this->jsCallback.Reset(callback);
418
- this->jsCallingObj.Reset(callingObj);
419
- this->callingObj = Nan::ObjectWrap::Unwrap<njsCommon>(callingObj);
420
- req.data = this;
421
- }
422
- ~njsBaton();
423
-
424
- // methods for getting information from JS objects stored on baton
425
- njsOracledb *GetOracledb();
426
-
427
- // methods for getting DPI errors
428
- void GetDPIError(void);
429
-
430
- // method for checking for a JavaScript exception
431
- void CheckJSException(Nan::TryCatch *tryCatch);
432
-
433
- // clear all data used in asynchronous operations
434
- void ClearAsyncData(void);
435
-
436
- // methods for setting DPI handles
437
- void SetDPIConnHandle(dpiConn *handle);
438
- void SetDPIPoolHandle(dpiPool *handle);
439
- void SetDPIStmtHandle(dpiStmt *handle);
440
- void SetDPILobHandle(dpiLob *handle);
441
- void SetDPISubscrHandle(dpiSubscr *handle);
442
- void SetDPISodaDbHandle(dpiSodaDb *handle);
443
- void SetDPISodaCollHandle(dpiSodaColl *handle);
444
- void SetDPISodaDocHandle(dpiSodaDoc *handle);
445
- void SetDPISodaDocCursorHandle(dpiSodaDocCursor *handle);
446
-
447
- // methods for getting values from JSON
448
- bool GetBoolFromJSON(Local<Object> obj, const char *key, int index,
449
- bool *value);
450
- bool GetFunctionFromJSON(Local<Object> obj, const char *key, int index,
451
- Local<Function> *value);
452
- bool GetStringFromJSON(Local<Object> obj, const char *key, int index,
453
- string &value);
454
- bool GetPositiveIntFromJSON(Local<Object> obj, const char *key, int index,
455
- uint32_t *value);
456
- bool GetIntFromJSON(Local<Object> obj, const char *key, int index,
457
- int32_t *value);
458
- bool GetUnsignedIntFromJSON(Local<Object> obj, const char *key, int index,
459
- uint32_t *value);
460
-
461
- // method for handling SODA document or buffer
462
- bool GetSodaDocument(Local<Object> obj, dpiSodaDb *db);
463
-
464
- // convenience methods
465
- uint32_t GetNumOutBinds();
466
-
467
- // methods for queuing work on the thread queue
468
- void QueueWork(const char *methodName, void (*workCallback)(njsBaton*),
469
- void (*afterWorkCallback)(njsBaton*, Local<Value>[]),
470
- unsigned int numCallbackArgs);
471
-
472
- private:
473
- uv_work_t req;
474
- const char *methodName;
475
- void (*workCallback)(njsBaton*);
476
- void (*afterWorkCallback)(njsBaton*, Local<Value> callbackArgs[]);
477
- unsigned int numCallbackArgs;
478
-
479
- static void AsyncWorkCallback(uv_work_t *req);
480
- static void AsyncAfterWorkCallback(uv_work_t *req, int status);
481
- };
482
-
483
- #endif
484
-