Skip to content

Commit 8a5855b

Browse files
committed
Add tests and documentation for the final release
1 parent 2c18432 commit 8a5855b

27 files changed

+530
-139
lines changed

doc/src/api_manual/connection.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,12 @@ Connection Methods
13501350
If all values in all records for a particular bind variable are null, the type of that bind is ``oracledb.STRING`` with a maximum size of 1.
13511351

13521352
The maximum sizes of strings and buffers are determined by scanning all records unless a :ref:`bindDefs <executemanyoptbinddefs>` property is used. This property explicitly specifies the characteristics of each bind variable.
1353-
* - options
1353+
* - ``numIterations``
1354+
- Number
1355+
- .. _executemanynumiterations:
1356+
1357+
If there are no bind values, or values have previously been bound, then you can set the ``numIterations`` parameter to an integer value that specifies the number of iterations. See :ref:`plsqlexecutemany` for an example of using this parameter.
1358+
* - ``options``
13541359
- Object
13551360
- .. _executemanyoptions:
13561361

doc/src/api_manual/oracledb.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,10 +3292,10 @@ Oracledb Methods
32923292
32933293
promise = getNetworkServiceNames(String configDir);
32943294
3295-
Returns a list of network service names that is defined in the
3296-
:ref:`tnsnames.ora <tnsadmin>` file which is inside the directory that
3297-
is specified in the ``configDir`` property or the ``TNS_ADMIN``
3298-
environment variable if ``configDir`` is not specified. If a
3295+
Returns a list of TNS Aliases, also known as Network Service Names,
3296+
defined in the :ref:`tnsnames.ora <tnsadmin>` file which is inside the
3297+
directory that is specified in the ``configDir`` property or the
3298+
``TNS_ADMIN`` environment variable if ``configDir`` is not specified. If a
32993299
``tnsnames.ora`` file does not exist, then an exception is raised.
33003300

33013301
The parameters of the ``oracledb.getNetworkServiceNames()`` method are:

doc/src/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
# from the other)
4747
#
4848
# The short X.Y version.
49-
version = '6.6'
50-
release = '6.6.0'
49+
version = '6.7'
50+
release = '6.7.0'
5151

5252
# There are two options for replacing |today|: either, you set today to some
5353
# non-false value, then it is used:

doc/src/release_notes.rst

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,46 @@
55
node-oracledb Release Notes
66
===========================
77

8-
For deprecated and desupported features, see :ref:`Deprecations and desupported features <deprecations>`.
8+
For deprecated and desupported features, see
9+
:ref:`Deprecations and desupported features <deprecations>`.
910

1011
node-oracledb `v6.7.0 <https://github.com/oracle/node-oracledb/compare/v6.6.0...v6.7.0>`__ (TBD)
1112
---------------------------------------------------------------------------------------------------------
1213

1314
Common Changes
1415
++++++++++++++
1516

16-
#) Added tracing functionality for OpenTelemetry support.
17+
#) Added :ref:`tracing functionality <tracehandlerinterface>` for
18+
OpenTelemetry support.
1719

1820
#) Changed default values of ``transportConnectTimeout`` and
1921
``retryDelay`` properties to *20* seconds and *1* second respectively in
2022
:meth:`oracledb.getConnection()` and :meth:`oracledb.createPool()` for
2123
consistency with other Oracle Database drivers.
2224

2325
#) Added method :meth:`oracledb.getNetworkServiceNames()` to support fetching
24-
the list of network service names from the ``tnsnames.ora`` file.
26+
the list of TNS Aliases from the ``tnsnames.ora`` file.
2527

26-
#) Improvements to Centralized Configuration Providers support:
28+
#) Improvements to Centralized Configuration Providers support:
2729

28-
- Added support to connect to Oracle Database via the centralized
29-
configuration providers using wallets stored in Azure Key Vault and
30-
OCI Vault.
30+
- Added support to connect to Oracle Database via the centralized
31+
configuration providers using wallets stored in Azure Key Vault and
32+
OCI Vault.
3133

32-
- Added ability to cache the configuration information retrieved from
33-
:ref:`Azure App Configuration <conninfocacheazure>` and
34-
:ref:`OCI Object Storage <conninfocacheoci>` centralized configuration
35-
providers.
34+
- Added ability to cache the configuration information retrieved from
35+
:ref:`Azure App Configuration <conninfocacheazure>` and
36+
:ref:`OCI Object Storage <conninfocacheoci>` centralized configuration
37+
providers.
3638

37-
- Ensure that the password stored in OCI vault and retrieved in
38-
base64-encoded format is decoded correctly.
39+
- Ensure that the password stored in OCI vault and retrieved in
40+
base64-encoded format is decoded correctly.
3941

40-
- Added internal code changes to validate the updated OCI centralized
41-
configuration provider URL syntax.
42+
- Added internal code changes to validate the updated OCI centralized
43+
configuration provider URL syntax.
4244

43-
- Changed the password type parameter values from `vault-oci` and
44-
`vault-azure` to `ocivault` and `azurevault` respectively for consistency
45-
with other Oracle Database drivers.
45+
- Changed the password type parameter values from `vault-oci` and
46+
`vault-azure` to `ocivault` and `azurevault` respectively for consistency
47+
with other Oracle Database drivers.
4648

4749
#) Remove the 'Critical Dependency' warning from webpack builds.
4850
See `Issue #1678 <https://github.com/oracle/node-oracledb/issues/1678>`__.

doc/src/user_guide/batch_statement.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ Output is::
189189
[ [ 'AAAmI9AAMAAAAnVAAB' ] ],
190190
[ [ 'AAAmI9AAMAAAAnVAAC' ] ] ]
191191

192+
.. _plsqlexecutemany:
193+
192194
Calling PL/SQL with ``executeMany()``
193195
=====================================
194196

doc/src/user_guide/migrate.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@
44
Upgrading to the Latest node-oracledb Releases
55
**********************************************
66

7+
.. _upgradev66v67:
8+
9+
Upgrading from node-oracledb 6.6 to 6.7
10+
=======================================
11+
12+
- Review the :ref:`releasenotes` and take advantage of new features.
13+
14+
- Using the new :meth:`oracledb.getNetworkServiceNames()` method, you can
15+
fetch the list of TNS Aliases from the ``tnsnames.ora`` file.
16+
17+
- With :ref:`Centralized Configuration Providers <configurationprovider>`, you
18+
can now:
19+
20+
- Connect to Oracle Database using wallets stored in Azure Key Vault and OCI
21+
vault.
22+
23+
- Cache the configuration information retrieved from
24+
:ref:`Azure App Configuration <conninfocacheazure>` and
25+
:ref:`OCI Object Storage <conninfocacheoci>` centralized configuration
26+
providers.
27+
28+
- In node-oracledb Thin mode, you can use the attributes
29+
:attr:`oracledb.driverName`, :attr:`oracledb.machine`,
30+
:attr:`oracledb.osUser`, :attr:`oracledb.program`, and
31+
:attr:`oracledb.terminal` to set information about the driver name, machine
32+
name, operating system user, program name, and terminal name respectively.
33+
34+
- In node-oracledb Thick mode, the new ``regId`` property of the
35+
:ref:`message object parameter <messageparam>` in the CQN subscription
36+
:ref:`callback <consubscribeoptcallback>` function returns a unique
37+
identifier during registration.
38+
739
.. _upgradev65v66:
840

941
Upgrading from node-oracledb 6.5 to 6.6

doc/src/user_guide/tracing.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,23 @@ node-oracledb.
159159

160160
Node-oracledb applications that call PL/SQL can step through that PL/SQL code
161161
using JDWP in a debugger. This allows Node.js and PL/SQL code to be debugged
162-
in the same debugger environment. You can enable PL/SQL debugging in the
163-
node-oracledb modes as follows:
162+
in the same debugger environment. You can enable PL/SQL debugging in
163+
node-oracledb as follows:
164164

165-
- If you are using node-oracledb Thick mode, set the ``ORA_DEBUG_JDWP``
165+
- In node-oracledb Thin or Thick modes, set the ``ORA_DEBUG_JDWP``
166166
environment variable to `host=hostname;port=portnum` indicating where the
167167
PL/SQL debugger is running. Then run the application.
168168

169-
- In node-oracledb Thin mode, you can additionally set the connection
169+
- In node-oracledb Thin mode, you can alternatively set the connection
170170
parameter ``debugJdwp`` during connection. This variable defaults to the
171171
value of the ``ORA_DEBUG_JDWP`` environment variable.
172172

173-
See `DBMS_DEBUG_JDWP <https://docs.oracle.com/en/database/oracle/oracle-
174-
database/19/arpls/DBMS_DEBUG_JDWP.html>`_ and `Debugging PL/SQL from ASP.NET
175-
and Visual Studio <http://cshay.blogspot.com/2006/10/debugging-plsql-from-
176-
aspnet-and-visual.html>`_.
173+
See the documentation on `DBMS_DEBUG_JDWP <https://www.oracle.com/pls/topic/
174+
lookup?ctx=dblatest&id=GUID-AFF566A0-9E90-4218-B5C6-A74C3BF1CE14>`_, the video
175+
`PL/SQL debugging with Visual Studio and Visual Studio Code <https://www.
176+
youtube.com/watch?v=wk-3hLe30kk>`_, and the blog post `Debugging PL/SQL with
177+
Visual Studio Code (and more) <https://medium.com/oracledevs/debugging-pl-sql-
178+
with-visual-studio-code-and-more-45631f3952cf>`_.
177179

178180
.. _tracingsql:
179181

test/aq9.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,12 @@ describe('301. aq9.js', function() {
4545
const ORDER_TYP = `${AQ_USER}.ORDER_TYP`;
4646

4747
before(async function() {
48-
const userConfig = {
49-
user: dbConfig.user,
50-
password: dbConfig.password,
51-
connectString: dbConfig.connectString
52-
};
53-
const initConn = await oracledb.getConnection(userConfig);
48+
const initConn = await oracledb.getConnection(dbConfig);
5449
const dbVersion = initConn.oracleServerVersion;
5550
await initConn.close();
5651

57-
if (!dbConfig.test.DBA_PRIVILEGE || oracledb.thin || dbVersion < 1900000000) {
52+
if (!dbConfig.test.DBA_PRIVILEGE || oracledb.thin || dbVersion < 1900000000
53+
|| testsUtil.getClientVersion() < 2306000000) {
5854
isRunnable = false;
5955
}
6056

test/columnMetadata.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2015, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -241,7 +241,7 @@ describe('9. columnMetadata.js', function() {
241241
await connection.execute(sqlDrop);
242242
});
243243

244-
it('9.10 works with a large number of columns', async function() {
244+
it('9.3.1 works with a large number of columns', async function() {
245245
const column_size = 300;
246246
columns_string = genColumns(column_size, " NUMBER");
247247

@@ -269,7 +269,7 @@ describe('9. columnMetadata.js', function() {
269269
await connection.execute(sqlDrop);
270270
});
271271

272-
it('9.11 works with re-executes with multiple packet response', async function() {
272+
it('9.3.2 works with re-executes with multiple packet response', async function() {
273273
const column_size = 50;
274274
const numRows = 5;
275275
oracledb.fetchAsString = [oracledb.CLOB];

test/connection.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2015, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -762,7 +762,14 @@ describe('1. connection.js', function() {
762762
}
763763

764764
res = await conn2.execute(sqlDriverName);
765-
assert.deepStrictEqual(res.rows[0][0], 'mydriver1');
765+
/*
766+
In Oracle 12.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
767+
can be set only upto 8 characters.
768+
*/
769+
let serverVersion = conn2.oracleServerVersion;
770+
if (serverVersion < 1202000000)
771+
assert.deepStrictEqual(res.rows[0][0], 'mydriver');
772+
else assert.deepStrictEqual(res.rows[0][0], 'mydriver1');
766773

767774
// Generate random values for the third connection
768775
const randomPgm3 = random.getRandomLengthString(16);
@@ -794,7 +801,14 @@ describe('1. connection.js', function() {
794801
}
795802

796803
res = await conn3.execute(sqlDriverName);
797-
assert.deepStrictEqual(res.rows[0][0], 'mydriver3');
804+
/*
805+
In Oracle 12.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
806+
can be set only upto 8 characters.
807+
*/
808+
serverVersion = conn2.oracleServerVersion;
809+
if (serverVersion < 1202000000)
810+
assert.deepStrictEqual(res.rows[0][0], 'mydriver');
811+
else assert.deepStrictEqual(res.rows[0][0], 'mydriver3');
798812

799813
// Cleanup
800814
await conn1.close();
@@ -817,7 +831,9 @@ describe('1. connection.js', function() {
817831
assert.strictEqual(res.rows[0][0], os.hostname());
818832
assert.strictEqual(res.rows[0][1], os.userInfo().username);
819833
assert.strictEqual(res.rows[0][2], 'unknown');
820-
assert.strictEqual(res.rows[0][3], process.argv0);
834+
// Whitespaces, ( and ) are replaced by ? for the program name
835+
// in V$SESSION
836+
assert.strictEqual(res.rows[0][3], process.argv0.replace(/[\s()]/g, '?'));
821837

822838
if (dbConfig.test.drcp) {
823839
const bindParams = {
@@ -828,11 +844,20 @@ describe('1. connection.js', function() {
828844
res = await conn.execute(sqlDRCPSessionDetails, bindParams);
829845
assert.deepStrictEqual(res.rows[0][0], os.hostname());
830846
assert.deepStrictEqual(res.rows[0][1], 'unknown');
831-
assert.deepStrictEqual(res.rows[0][2], process.argv0);
847+
// Whitespaces, ( and ) are replaced by ? for the program name
848+
// in V$SESSION
849+
assert.deepStrictEqual(res.rows[0][2], process.argv0.replace(/[\s()]/g, '?'));
832850
}
833851

834852
res = await conn.execute(sqlDriverName);
835-
assert.strictEqual(res.rows[0][0], "node-oracledb : " + oracledb.versionString + " thn");
853+
/*
854+
In Oracle 12.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
855+
can be set only upto 8 characters.
856+
*/
857+
const serverVersion = conn.oracleServerVersion;
858+
if (serverVersion < 1202000000)
859+
assert.strictEqual(res.rows[0][0], "node-ora");
860+
else assert.strictEqual(res.rows[0][0], "node-oracledb : " + oracledb.versionString + " thn");
836861

837862
await conn.close();
838863
}); // 1.18.3

test/dataTypeDate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ describe('32. dataTypeDate.js', function() {
186186

187187
// Add an assert statement to check the result
188188
assert.deepStrictEqual(result.rows,
189-
[['01/01/1900 00:00:00']]);
189+
[[new Date('01-01-1900').toLocaleString('fr')]]);
190190
});
191191

192192
it('32.4.3 Negative - Invalid Year -4713', async function() {

test/dataTypeUrowid.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2017, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2017, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -143,7 +143,7 @@ describe('113. dataTypeUrowid.js', function() {
143143
const resultVal = rows[i].CONTENT;
144144
assert(resultVal);
145145
}
146-
return fetchRowsFromRS(rs);
146+
return await fetchRowsFromRS(rs);
147147
} else {
148148
await rs.close();
149149
}
@@ -185,7 +185,7 @@ describe('113. dataTypeUrowid.js', function() {
185185
assert(typeof resultVal, "string");
186186
await verifyFetchValues(connection, rsrows[i].NUM, rsrows[i].CONTENT, tableName);
187187
}
188-
return fetchRowsFromRS_fetchas(rs);
188+
return await fetchRowsFromRS_fetchas(rs);
189189
} else {
190190
await rs.close();
191191
}

test/dataTypeVector1.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,8 @@ describe('294. dataTypeVector1.js', function() {
12891289
}); // 294.51
12901290

12911291
it('294.52 executeMany with positional args in vector binary flex column', async function() {
1292-
if (!isVectorBinaryRunnable) this.skip();
1292+
const serverVersion = connection.oracleServerVersion;
1293+
if (serverVersion <= 2306000000 || !isVectorBinaryRunnable) this.skip();
12931294

12941295
const rows = [
12951296
[1, [1, 2]],

test/dataTypeVector4.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('298. dataTypeVector4.js', function() {
184184
`);
185185

186186
assert.strictEqual(result.rows.length, 1);
187-
assert.deepStrictEqual(result.rows, [[0.10298221668758012]]);
187+
assert.deepStrictEqual(result.rows[0][0].toFixed(6), '0.102982');
188188
}); // 298.4
189189

190190
it('298.5 insert and select Max vector distance function', async function() {
@@ -214,7 +214,7 @@ describe('298. dataTypeVector4.js', function() {
214214
`);
215215

216216
assert.strictEqual(result.rows.length, 1);
217-
assert.deepStrictEqual(result.rows, [[0.28645724726349675]]);
217+
assert.deepStrictEqual(result.rows[0][0].toFixed(6), '0.286457');
218218
}); // 298.5
219219

220220
it('298.6 sum vector distance function vector columns with parallel execution', async function() {
@@ -299,10 +299,12 @@ describe('298. dataTypeVector4.js', function() {
299299

300300
const clientVersion = testsUtil.getClientVersion();
301301
const serverVersion = connection.oracleServerVersion;
302+
const majorServerVersion = Math.floor(serverVersion / 1000000);
303+
const majorClientVersion = Math.floor(clientVersion / 1000000);
302304

303-
// Aggregate functions on vector columns is available from 23.6 onwards
304-
if (serverVersion >= 2306000000 &&
305-
(oracledb.thin || clientVersion >= 2306000000)) {
305+
// Aggregate functions on vector columns are not implemented in Oracle Database 23.6 or earlier versions
306+
if (majorServerVersion > 2306 &&
307+
(oracledb.thin || majorClientVersion > 2306)) {
306308
const result = await connection.execute(`
307309
SELECT /*+ parallel(4) */ sum(VectorCol)
308310
FROM ${tableName}

0 commit comments

Comments
 (0)