oracledb 2.1.0 → 2.3.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.
- package/CHANGELOG.md +174 -54
- package/LICENSE.md +52 -18
- package/README.md +35 -68
- package/binding.gyp +5 -4
- package/lib/connection.js +164 -14
- package/lib/oracledb.js +160 -11
- package/lib/pool.js +33 -22
- package/lib/querystream.js +3 -2
- package/lib/rel.txt +1 -1
- package/odpi/LICENSE.md +1 -1
- package/odpi/README.md +25 -84
- package/odpi/embed/README.md +1 -1
- package/odpi/include/dpi.h +51 -7
- package/odpi/src/dpiConn.c +78 -9
- package/odpi/src/dpiContext.c +24 -10
- package/odpi/src/dpiEnv.c +5 -1
- package/odpi/src/dpiError.c +4 -0
- package/odpi/src/dpiErrorMessages.h +6 -4
- package/odpi/src/dpiImpl.h +125 -68
- package/odpi/src/dpiMsgProps.c +33 -0
- package/odpi/src/dpiObject.c +17 -10
- package/odpi/src/dpiObjectType.c +1 -1
- package/odpi/src/dpiOci.c +55 -40
- package/odpi/src/dpiOracleType.c +2 -2
- package/odpi/src/dpiPool.c +88 -18
- package/odpi/src/dpiStmt.c +57 -36
- package/odpi/src/dpiSubscr.c +117 -9
- package/odpi/src/dpiUtils.c +20 -9
- package/odpi/src/dpiVar.c +504 -430
- package/package/MAKEPKG.BAT +64 -1
- package/package/README.md +9 -5
- package/package/createpackage.js +2 -2
- package/package/extractpackage.js +2 -1
- package/package/oracledbinstall.js +19 -19
- package/package/package.json +4 -4
- package/package.json +4 -4
- package/src/njsCommon.cpp +94 -10
- package/src/njsCommon.h +73 -21
- package/src/njsConnection.cpp +1425 -458
- package/src/njsConnection.h +68 -19
- package/src/njsIntLob.cpp +5 -1
- package/src/njsIntLob.h +1 -1
- package/src/njsMessages.cpp +9 -2
- package/src/njsMessages.h +9 -2
- package/src/njsOracle.cpp +213 -23
- package/src/njsOracle.h +18 -2
- package/src/njsPool.cpp +32 -14
- package/src/njsPool.h +4 -4
- package/src/njsResultSet.cpp +4 -3
- package/src/njsResultSet.h +1 -1
- package/src/njsSubscription.cpp +388 -0
- package/src/njsSubscription.h +111 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
/******************************************************************************
|
|
4
|
+
*
|
|
5
|
+
* You may not use the identified files except in compliance with the Apache
|
|
6
|
+
* License, Version 2.0 (the "License.")
|
|
7
|
+
*
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
*
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* This file uses NAN:
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) 2015 NAN contributors
|
|
21
|
+
*
|
|
22
|
+
* NAN contributors listed at https://github.com/rvagg/nan#contributors
|
|
23
|
+
*
|
|
24
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
25
|
+
* a copy of this software and associated documentation files (the
|
|
26
|
+
* "Software"), to deal in the Software without restriction, including
|
|
27
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
28
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
29
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
30
|
+
* the following conditions:
|
|
31
|
+
*
|
|
32
|
+
* The above copyright notice and this permission notice shall be
|
|
33
|
+
* included in all copies or substantial portions of the Software.
|
|
34
|
+
*
|
|
35
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
36
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
37
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
38
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
39
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
40
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
41
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
42
|
+
*
|
|
43
|
+
* NAME
|
|
44
|
+
* njsSubscription.h
|
|
45
|
+
*
|
|
46
|
+
* DESCRIPTION
|
|
47
|
+
* Subscription class
|
|
48
|
+
*
|
|
49
|
+
*****************************************************************************/
|
|
50
|
+
|
|
51
|
+
#ifndef __NJSSUBSCRIPTION_H__
|
|
52
|
+
#define __NJSSUBSCRIPTION_H__
|
|
53
|
+
|
|
54
|
+
#include "njsCommon.h"
|
|
55
|
+
|
|
56
|
+
using namespace v8;
|
|
57
|
+
using namespace node;
|
|
58
|
+
|
|
59
|
+
//-----------------------------------------------------------------------------
|
|
60
|
+
// njsSubscription
|
|
61
|
+
// Class exposed to JS for handling subscriptions.
|
|
62
|
+
//-----------------------------------------------------------------------------
|
|
63
|
+
class njsSubscription: public njsCommon {
|
|
64
|
+
public:
|
|
65
|
+
|
|
66
|
+
static void Init(Local<Object> target);
|
|
67
|
+
bool IsValid() const { return true; };
|
|
68
|
+
njsErrorType GetInvalidErrorType() const { return errInvalidSubscription; }
|
|
69
|
+
static Local<Object> Create();
|
|
70
|
+
dpiSubscrNamespace GetNamespace() const { return subscrNamespace; }
|
|
71
|
+
void SetNamespace(dpiSubscrNamespace ns) { subscrNamespace = ns; }
|
|
72
|
+
void SetCallback(Local<Function> callback) { jsCallback.Reset(callback); }
|
|
73
|
+
void SetDPISubscrHandle(njsBaton *baton)
|
|
74
|
+
{ baton->SetDPISubscrHandle(dpiSubscrHandle); }
|
|
75
|
+
void StartNotifications(njsBaton *baton);
|
|
76
|
+
void StopNotifications();
|
|
77
|
+
|
|
78
|
+
// event handler
|
|
79
|
+
static void EventHandler(njsSubscription *subscription,
|
|
80
|
+
dpiSubscrMessage *message);
|
|
81
|
+
|
|
82
|
+
private:
|
|
83
|
+
|
|
84
|
+
njsSubscription() : dpiSubscrHandle(NULL), message(NULL) {}
|
|
85
|
+
~njsSubscription();
|
|
86
|
+
|
|
87
|
+
Local<Object> CreateMessage(dpiSubscrMessage *message);
|
|
88
|
+
Local<Object> CreateMessageQuery(dpiSubscrMessageQuery *query);
|
|
89
|
+
Local<Object> CreateMessageRow(dpiSubscrMessageRow *row);
|
|
90
|
+
Local<Object> CreateMessageTable(dpiSubscrMessageTable *table);
|
|
91
|
+
|
|
92
|
+
static void ProcessNotification(uv_async_t *handle);
|
|
93
|
+
static void OnStopNotifications(uv_handle_t *handle);
|
|
94
|
+
void WaitOnBarrier();
|
|
95
|
+
|
|
96
|
+
static NAN_METHOD(New);
|
|
97
|
+
|
|
98
|
+
dpiSubscr *dpiSubscrHandle;
|
|
99
|
+
uv_async_t async;
|
|
100
|
+
uv_mutex_t mutex;
|
|
101
|
+
uv_barrier_t barrier;
|
|
102
|
+
dpiSubscrMessage *message;
|
|
103
|
+
Nan::Persistent<Function> jsCallback;
|
|
104
|
+
dpiSubscrNamespace subscrNamespace;
|
|
105
|
+
std::string name;
|
|
106
|
+
|
|
107
|
+
static Nan::Persistent<FunctionTemplate> subscriptionTemplate_s;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
#endif
|
|
111
|
+
|