Skip to content

Commit e2fc019

Browse files
committed
Updates for NAN
1 parent 6cf6524 commit e2fc019

14 files changed

+290
-70
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## node-oracledb v0.6.0 (26 May 2015)
4+
5+
- Node-oracledb now builds with Node.js 0.10, Node.js 0.12 and io.js.
6+
7+
- Fixed naming of `autoCommit` in examples.
8+
39
## node-oracledb v0.5.0 (5 May 2015)
410

511
- Changed the `isAutoCommit` attribute name to `autoCommit`.

INSTALL.md

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ The Oracle Database Node.js driver node-oracledb powers high performance Node.js
3232
The steps below create a Node.js installation for testing. Adjust the
3333
steps for your environment.
3434

35-
This node-oracledb release currently works only with Node.js 0.10. It
36-
has been tested with 0.10.35 on 64-bit Oracle Linux and Windows. The
37-
driver can also build in some Mac OS X, 32-bit Linux, 32-bit Windows,
38-
Solaris and AIX environments, but these architectures have not been fully
39-
tested.
35+
This node-oracledb release has been tested with Node 0.10 and 0.12 on
36+
64-bit Oracle Linux and Windows. The driver can also build in some
37+
Mac OS X, 32-bit Linux, 32-bit Windows, Solaris and AIX environments,
38+
but these architectures have not been fully tested.
4039

4140
### Prerequisites
4241

@@ -81,20 +80,18 @@ install Oracle Linux yourself, it is free from
8180
### 2.1 Install Node.js
8281

8382
Download the
84-
[Node.js 0.10 Linux 64-bit binaries](http://nodejs.org/download/) and
83+
[Node.js Linux 64-bit binaries](http://nodejs.org/download/) and
8584
extract the file, for example into `/opt`:
8685

8786
```
8887
cd /opt
89-
tar -zxf node-v0.10.38-linux-x64.tar.gz
88+
tar -zxf node-v0.12.4-linux-x64.tar.gz
9089
```
9190

92-
This node-oracledb release currently works only with Node.js 0.10.
93-
9491
Set PATH to include Node.js:
9592

9693
```
97-
export PATH=/opt/node-v0.10.38-linux-x64/bin:$PATH
94+
export PATH=/opt/node-v0.12.4-linux-x64/bin:$PATH
9895
```
9996

10097
### 2.2 Install the free Oracle Instant Client RPMs
@@ -120,13 +117,19 @@ Install node-oracledb from the
120117
npm install oracledb
121118
```
122119

123-
Node-oracledb will automatically configured to use the highest version
120+
Node-oracledb will automatically be configured to use the highest version
124121
Instant Client RPMs installed. To use a different version, follow the
125122
instructions to
126123
[install on Linux with Instant Client ZIP files](#instzip) instead,
127124
setting `OCI_LIB_DIR` and `OCI_INC_DIR` to the appropriate
128125
directories.
129126

127+
If you have other Oracle software installed on the same machine, and
128+
the runtime linker is configured to find this other software via
129+
`LD_LIBRARY_PATH` or `ldconfig`, then update the environment to use
130+
the Instant Client RPM libraries, for example
131+
`/usr/lib/oracle/12.1/client64/lib`.
132+
130133
### 2.4 Run an example program
131134

132135
Download the
@@ -154,20 +157,18 @@ node select1.js
154157
### 3.1 Install Node.js
155158

156159
Download the
157-
[Node.js 0.10 Linux 64-bit binaries](http://nodejs.org/download/) and
160+
[Node.js Linux 64-bit binaries](http://nodejs.org/download/) and
158161
extract the file, for example into `/opt`:
159162

160163
```
161164
cd /opt
162-
tar -zxf node-v0.10.38-linux-x64.tar.gz
165+
tar -zxf node-v0.12.4-linux-x64.tar.gz
163166
```
164167

165-
This node-oracledb release currently works only with Node.js 0.10.
166-
167168
Set PATH to include Node.js:
168169

169170
```
170-
export PATH=/opt/node-v0.10.38-linux-x64/bin:$PATH
171+
export PATH=/opt/node-v0.12.4-linux-x64/bin:$PATH
171172
```
172173

173174
### 3.2 Install the free Oracle Instant Client ZIPs
@@ -265,20 +266,18 @@ Oracle Database.
265266
### 4.1 Install Node.js
266267

267268
Download the
268-
[Node.js Linux 0.10 64-bit binaries](http://nodejs.org/download/) and
269+
[Node.js Linux 64-bit binaries](http://nodejs.org/download/) and
269270
extract the file, for example into `/opt`:
270271

271272
```
272273
cd /opt
273-
tar -zxf node-v0.10.38-linux-x64.tar.gz
274+
tar -zxf node-v0.12.4-linux-x64.tar.gz
274275
```
275276

276-
This node-oracledb release currently works only with Node.js 0.10.
277-
278277
Set your PATH variable to include Node.js:
279278

280279
```
281-
export PATH=/opt/node-v0.10.38-linux-x64/bin:$PATH
280+
export PATH=/opt/node-v0.12.4-linux-x64/bin:$PATH
282281
```
283282

284283
### 4.2 Install the driver
@@ -342,14 +341,12 @@ Building node-oracledb requires Xcode from the Mac App store.
342341

343342
### 5.2 Install Node.js
344343

345-
Node.js 0.10 can be installed from various sources, such as via *brew*.
344+
Node.js can be installed from various sources, such as via *brew*.
346345

347346
```
348-
brew install node010
347+
brew install node
349348
```
350349

351-
This node-oracledb release currently works only with Node.js 0.10.
352-
353350
Set your PATH to include the *node* and *npm* binaries:
354351

355352
```
@@ -449,12 +446,10 @@ use a 32-bit stack during build and run time.
449446

450447
### 6.2 Install Node.js
451448

452-
Install the 64-bit Node.js 0.10 MSI (e.g. node-v0.10.38-x64.msi) from
449+
Install the 64-bit Node.js MSI (e.g. node-v0.12.4-x64.msi) from
453450
[nodejs.org](http://nodejs.org/download/). Make sure the option to
454451
add the Node and npm directories to the path is selected.
455452

456-
This node-oracledb release currently works only with Node.js 0.10.
457-
458453
### 6.3 Install the free Oracle Instant Client ZIPs
459454

460455
Skip this step if you already have Oracle Database or the full Oracle client on your machine.
@@ -476,9 +471,8 @@ version first in the path.
476471
### 6.4 Install the driver
477472

478473
Start Visual Studio and open a Developer Command Prompt within it.
479-
480-
If you instead decide to use command shell outside Visual Studio, then
481-
run `vcvars64.bat` or `vcvars.bat` (for 32-bit builds).
474+
(If you instead decide to use a command shell outside Visual Studio, then
475+
run `vcvars64.bat` for 64-bit builds or `vcvars.bat` for 32-bit builds).
482476

483477
Use `set PATH` in the shell to confirm the Python, Node.js and Oracle
484478
directories are correctly set. If they are not, then set PATH

LICENSE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# node-oracledb
2+
13
You may not use the identified files except in compliance with the
24
Apache License, Version 2.0 (the "License.")
35

@@ -217,3 +219,30 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
217219
See the License for the specific language governing permissions and
218220
limitations under the License.
219221
```
222+
223+
# NAN
224+
225+
```
226+
Copyright (c) 2015 NAN contributors
227+
228+
NAN contributors listed at https://github.com/rvagg/nan#contributors
229+
230+
Permission is hereby granted, free of charge, to any person obtaining
231+
a copy of this software and associated documentation files (the
232+
"Software"), to deal in the Software without restriction, including
233+
without limitation the rights to use, copy, modify, merge, publish,
234+
distribute, sublicense, and/or sell copies of the Software, and to
235+
permit persons to whom the Software is furnished to do so, subject to
236+
the following conditions:
237+
238+
The above copyright notice and this permission notice shall be
239+
included in all copies or substantial portions of the Software.
240+
241+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
242+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
243+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
244+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
245+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
246+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
247+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
248+
```

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# node-oracledb version 0.5
1+
# node-oracledb version 0.6
22

33
## <a name="about"></a> 1. About node-oracledb
44

55
The Oracle Database Node.js driver powers high performance
66
Node.js applications.
77

8-
Node-oracledb 0.5 supports basic and advanced Oracle features, including:
8+
Node-oracledb 0.6 supports basic and advanced Oracle features, including:
99

1010
- SQL and PL/SQL Execution
1111
- Query results as JavaScript objects or array
@@ -23,7 +23,7 @@ Node-oracledb 0.5 supports basic and advanced Oracle features, including:
2323
- [Runtime Load Balancing](http://docs.oracle.com/database/121/ADFNS/adfns_perf_scale.htm#ADFNS515) (RLB)
2424
- [Transparent Application Failover](http://docs.oracle.com/database/121/ADFNS/adfns_avail.htm#ADFNS534) (TAF)
2525

26-
Node-oracledb 0.5 is a preview release. We are actively working on
26+
Node-oracledb 0.6 is a preview release. We are actively working on
2727
adding features including LOB support and batch fetching / streaming
2828
of large query result sets.
2929

doc/api.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,35 +1421,42 @@ This paper also gives more detail on configuring DRCP.
14211421
14221422
### <a name="extauth"></a> 6.3 External Authentication
14231423
1424-
Instead of specifying a user and password at connection, Oracle
1425-
Database allows applications to use an external password store (such
1426-
as
1424+
External Authentication allows applications to use an external
1425+
password store (such as
14271426
[Oracle Wallet](http://docs.oracle.com/database/121/DBIMI/to_dbimi10236_d209.htm#DBIMI10236)),
1428-
the [Secure Socket Layer](http://docs.oracle.com/database/121/DBSEG/asossl.htm#DBSEG070)
1427+
the
1428+
[Secure Socket Layer](http://docs.oracle.com/database/121/DBSEG/asossl.htm#DBSEG070)
14291429
(SSL), or the
14301430
[operating system](http://docs.oracle.com/database/121/DBSEG/authentication.htm#DBSEG30035)
1431-
to validate user access. This mode of authentication is called
1432-
*external authentication*. One of the benefits is that database
1431+
to validate user access. One of the benefits is that database
14331432
credentials do not need to be hard coded in the application.
14341433
14351434
To use external authentication, set the *Oracledb*
1436-
[`externalAuth`](propdbextauth) property to *true*. Once this is
1437-
set, any subsequent connections obtained using the *Oracledb*
1438-
[`getConnection()`](#getconnectiondb) or *Pool*
1435+
[`externalAuth`](propdbextauth) property to *true*. This property can
1436+
also be set in the `connAttrs` or `poolAttrs` parameters of the
1437+
*Oracledb* [`getConnection()`](#getconnectiondb) or
1438+
[`createPool()`](#createpool) calls, respectively. The `user` and
1439+
`password` properties should not be set, or should be empty strings:
1440+
1441+
```javascript
1442+
oracledb.getConnection(
1443+
{
1444+
externalAuth: true,
1445+
connectString: "localhost/orcl"
1446+
},
1447+
. . .
1448+
```
1449+
1450+
When `externalAuth` is set, any subsequent connections obtained using
1451+
the *Oracledb* [`getConnection()`](#getconnectiondb) or *Pool*
14391452
[`getConnection()`](#getconnectionpool) calls will use external
14401453
authentication. Setting this property does not affect the operation
14411454
of existing connections or pools.
14421455
1443-
When `externalAuth` is *true*, the `user` and `password` properties
1444-
should not be set, or should be empty strings.
1445-
1446-
The `externalAuth` property can be overridden in the `connAttrs` or
1447-
`poolAttrs` parameters of the *Oracledb*
1448-
[`getConnection()`](#getconnectiondb) or [`createPool()`](#createpool)
1449-
calls, respectively. Overriding `externalAuth` is not possible for
1450-
a *Pool* `getConnection()` call. The connections from a *Pool* object
1451-
are always obtained in the manner in which the pool was initially
1452-
created.
1456+
Using `externalAuth` in the `connAttrs` parameter of a *Pool*
1457+
`getConnection()` call is not possible. The connections from a *Pool*
1458+
object are always obtained in the manner in which the pool was
1459+
initially created.
14531460
14541461
For pools created with external authentication, the number of
14551462
connections initially created is zero even if a non-zero value is

examples/webapp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ oracledb.createPool (
135135
function handleError(response, text, err)
136136
{
137137
if (err) {
138-
text += err.message;
138+
text += err.message
139139
}
140140
console.error(text);
141141
response.write("<p>Error: " + text + "</p>");

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "oracledb",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "Oracle Database driver by Oracle Corp.",
5-
"license": "Apache 2.0",
5+
"license": "Apache-2.0",
66
"homepage": "http://www.oracle.com/technetwork/database/database-technologies/node_js/index.html",
77
"keywords": [
88
"oracledb",
@@ -37,7 +37,6 @@
3737
"engines": {
3838
"node": ">=0.10.28"
3939
},
40-
"engineStrict": true,
4140
"maintainers": [
4241
{
4342
"name": "Oracle Corp."

src/njs/src/njsConnection.cpp

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,31 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*
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+
*
1843
* NAME
1944
* njsConnection.cpp
2045
*
@@ -1312,14 +1337,14 @@ v8::Handle<v8::Value> Connection::GetOutBinds (eBaton* executeBaton)
13121337
return NanEscapeScope(GetOutBindArray( executeBaton->binds,
13131338
executeBaton->numOutBinds,
13141339
executeBaton->stmtIsReturning,
1315-
executeBaton->rowsAffected ));
1340+
(unsigned long)executeBaton->rowsAffected ));
13161341
}
13171342
else
13181343
{
13191344
// Binds as JS object
13201345
return NanEscapeScope(GetOutBindObject( executeBaton->binds,
13211346
executeBaton->stmtIsReturning,
1322-
executeBaton->rowsAffected ));
1347+
(unsigned long)executeBaton->rowsAffected ));
13231348
}
13241349
}
13251350
return NanUndefined();
@@ -1900,11 +1925,11 @@ void Connection::cbDynBufferAllocate ( void *ctx, bool dmlReturning,
19001925
bind->value = (char *)malloc ( ( bind->maxSize + 1) * nRows ) ;
19011926
if ( dmlReturning )
19021927
{
1903-
*(bind->len2) = bind->maxSize ;
1928+
*(bind->len2) = (unsigned int)bind->maxSize ;
19041929
}
19051930
else
19061931
{
1907-
*(bind->len) = bind->maxSize;
1932+
*(bind->len) = (unsigned int)bind->maxSize;
19081933
}
19091934
break;
19101935

@@ -1987,7 +2012,7 @@ int Connection::cbDynBufferGet ( void *ctx, DPI_SZ_TYPE nRows,
19872012
// First time callback, allocate the buffer(s).
19882013
if ( index == 0 )
19892014
{
1990-
Connection::cbDynBufferAllocate (ctx, true, nRows );
2015+
Connection::cbDynBufferAllocate (ctx, true, (unsigned long)nRows );
19912016
}
19922017

19932018
bind->ind[index] = -1;
@@ -1996,7 +2021,7 @@ int Connection::cbDynBufferGet ( void *ctx, DPI_SZ_TYPE nRows,
19962021
switch ( bind->type )
19972022
{
19982023
case dpi::DpiVarChar:
1999-
bind->len2[index] = bind->maxSize;
2024+
bind->len2[index] = (unsigned int)bind->maxSize;
20002025
/* 1 extra char for EOS, 1 extra to determine insufficient buf later */
20012026
*bufpp = (void *)&(((char *)bind->value)[ (bind->maxSize) * index]);
20022027
/* Buffer provided by the application could be small, in this case to

0 commit comments

Comments
 (0)