Skip to content

Commit 20a2d8c

Browse files
committed
Update Tests and Documentation for the latest features in 6.7
1 parent bc58135 commit 20a2d8c

File tree

12 files changed

+834
-473
lines changed

12 files changed

+834
-473
lines changed

doc/src/api_manual/connection.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ The properties of a *Connection* object are listed below.
8585
This property can only be used in the node-oracledb Thick mode. See
8686
:ref:`enablingthick`.
8787

88+
.. attribute:: connection.connectString
89+
90+
.. versionadded:: 6.7
91+
92+
This read-only property is a string that identifies the connect string
93+
used to connect to Oracle Database.
94+
95+
.. attribute:: connection.connectTraceConfig
96+
97+
.. versionadded:: 6.7
98+
99+
This read-only property is an object that returns connection related
100+
information. The connection information returned by node-oracledb Thin
101+
mode includes connectString, user, serviceName, instanceName, pdbName,
102+
hostName, port, and protocol. The Thick mode returns connectString, user,
103+
serviceName, instanceName, and pdbName.
104+
88105
.. attribute:: connection.currentSchema
89106

90107
.. versionadded:: 4.0
@@ -155,6 +172,17 @@ The properties of a *Connection* object are listed below.
155172
This property can only be used in the node-oracledb Thick mode. See
156173
:ref:`enablingthick`.
157174

175+
.. attribute:: connection.hostName
176+
177+
.. versionadded:: 6.7
178+
179+
This read-only property is a string that identifies the host name of
180+
Oracle Database.
181+
182+
.. note::
183+
184+
This property can only be used in node-oracledb Thin mode.
185+
158186
.. attribute:: connection.instanceName
159187

160188
.. versionadded:: 6.1
@@ -217,6 +245,28 @@ The properties of a *Connection* object are listed below.
217245
or later, client libraries. Otherwise it will show the base release such
218246
as “18.0.0.0.0” instead of “18.3.0.0.0”.
219247

248+
.. attribute:: connection.port
249+
250+
.. versionadded:: 6.7
251+
252+
This read-only property is a number that identifies the port to which the
253+
client is connected.
254+
255+
.. note::
256+
257+
This property can only be used in node-oracledb Thin mode.
258+
259+
.. attribute:: connection.protocol
260+
261+
.. versionadded:: 6.7
262+
263+
This read-only property is a string which identifies the protocol used to
264+
connect to Oracle Database.
265+
266+
.. note::
267+
268+
This property can only be used in node-oracledb Thin mode.
269+
220270
.. attribute:: connection.serviceName
221271

222272
.. versionadded:: 6.3
@@ -332,6 +382,13 @@ The properties of a *Connection* object are listed below.
332382
value is *False*, then the specified connection does not have an active
333383
transaction.
334384

385+
.. attribute:: connection.user
386+
387+
.. versionadded:: 6.7
388+
389+
This read-only property is a string that identifies the user provided to
390+
connect to Oracle Database.
391+
335392
.. attribute:: connection.warning
336393

337394
.. versionadded:: 6.3

doc/src/api_manual/oracledb.rst

Lines changed: 211 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,8 +2035,7 @@ Oracledb Methods
20352035
- Both
20362036
- .. _createpoolpoolattrsconnectstring:
20372037

2038-
The Oracle database instance used by connections in the pool. The string can be an Easy Connect string, or a Net Service Name from a ``tnsnames.ora`` file, or the name of a local Oracle Database instance. See :ref:`Connection Strings
2039-
<connectionstrings>` for examples.
2038+
The Oracle database instance used by connections in the pool. The string can be an Easy Connect string, or a Net Service Name from a ``tnsnames.ora`` file, or the name of a local Oracle Database instance. See :ref:`Oracle Net Services Connection String <connectionstrings>` for examples.
20402039

20412040
.. versionadded:: 2.1
20422041

@@ -2811,7 +2810,7 @@ Oracledb Methods
28112810
- Both
28122811
- .. _getconnectiondbattrsconnectstring:
28132812

2814-
The Oracle database instance to connect to. The string can be an Easy Connect string, or a Net Service Name from a ``tnsnames.ora`` file, or the name of a local Oracle database instance. See :ref:`Connection Strings <connectionstrings>` for examples.
2813+
The Oracle database instance to connect to. The string can be an Easy Connect string, or a Net Service Name from a ``tnsnames.ora`` file, or the name of a local Oracle database instance. See :ref:`Oracle Net Services Connection String <connectionstrings>` for examples.
28152814

28162815
The two properties are aliases for each other. Use only one of the properties.
28172816

@@ -3686,3 +3685,212 @@ Global_Objects/Uint8Array>`__ and can be instantiated in the same way as an
36863685
Uint8Array datatype object.
36873686

36883687
.. versionadded:: 6.5
3688+
3689+
.. _tracehandlerinterface:
3690+
3691+
Oracledb TraceHandler Interface
3692+
===============================
3693+
3694+
The :ref:`TraceHandlerBase class <tracehandlerbaseclass>` acts as an
3695+
interface which provides abstract methods that can be implemented by derived
3696+
classes. The implemented methods can use the ``traceContext`` in/out parameter
3697+
with OpenTelemetry.
3698+
3699+
.. versionadded:: 6.7
3700+
3701+
.. _tracehandlerbaseclass:
3702+
3703+
TraceHandlerBase Class
3704+
----------------------
3705+
3706+
TraceHandlerBase Methods
3707+
++++++++++++++++++++++++
3708+
3709+
.. method:: traceHandlerBase.disable()
3710+
3711+
.. code-block:: javascript
3712+
3713+
disable();
3714+
3715+
Disables invoking the Abstract methods with traceContext data. Note that
3716+
this is a synchronous method.
3717+
3718+
.. method:: traceHandlerBase.enable()
3719+
3720+
.. code-block:: javascript
3721+
3722+
enable();
3723+
3724+
Enables invoking the Abstract methods with traceContext data. Note that
3725+
this is a synchronous method.
3726+
3727+
.. method:: traceHandlerBase.isEnabled()
3728+
3729+
.. code-block:: javascript
3730+
3731+
isEnabled();
3732+
3733+
Determines if the abstract methods will be invoked.
3734+
3735+
.. method:: onEnterFn()
3736+
3737+
.. code-block:: javascript
3738+
3739+
onEnterFn([Object traceContext]);
3740+
3741+
This method is invoked before a public method passes the traceContext.
3742+
Note that this is a synchronous method.
3743+
3744+
.. _onenterfn:
3745+
3746+
.. list-table-with-summary:: onEnterFn() Parameters
3747+
:header-rows: 1
3748+
:class: wy-table-responsive
3749+
:align: center
3750+
:widths: 10 10 30
3751+
:summary: The first column displays the parameter. The second column
3752+
displays the data type of the parameter. The third column displays
3753+
the description of the parameter.
3754+
3755+
* - Parameter
3756+
- Data Type
3757+
- Description
3758+
* - ``traceContext``
3759+
- Object
3760+
- The trace context details. This includes connection configuration details, call level details, and additional attribute details.
3761+
3762+
.. method:: onExitFn()
3763+
3764+
.. code-block:: javascript
3765+
3766+
onExitFn(Object traceContext);
3767+
3768+
This method is invoked after a public method completes passing the
3769+
traceContext. Note that this is a synchronous method.
3770+
3771+
.. _onexitfn:
3772+
3773+
.. list-table-with-summary:: onExitFn() Parameters
3774+
:header-rows: 1
3775+
:class: wy-table-responsive
3776+
:align: center
3777+
:widths: 10 10 30
3778+
:summary: The first column displays the parameter. The second column
3779+
displays the data type of the parameter. The third column displays
3780+
the description of the parameter.
3781+
3782+
* - Parameter
3783+
- Data Type
3784+
- Description
3785+
* - ``traceContext``
3786+
- Object
3787+
- The trace context details. This includes connection configuration details, call level details, and additional attribute details.
3788+
3789+
.. method:: onBeginRoundTrip()
3790+
3791+
.. code-block:: javascript
3792+
3793+
onBeginRoundTrip([Object traceContext]);
3794+
3795+
Called when a round trip begins. OpenTelemetry will start a new span as a
3796+
child of the public API span.
3797+
3798+
.. _onbeginroundtrip:
3799+
3800+
.. list-table-with-summary:: onBeginRoundTrip() Parameters
3801+
:header-rows: 1
3802+
:class: wy-table-responsive
3803+
:align: center
3804+
:widths: 10 10 30
3805+
:summary: The first column displays the parameter. The second column
3806+
displays the data type of the parameter. The third column displays
3807+
the description of the parameter.
3808+
3809+
* - Parameter
3810+
- Data Type
3811+
- Description
3812+
* - ``traceContext``
3813+
- Object
3814+
- The trace context details. This includes connection configuration details, call level details, and additional attribute details.
3815+
3816+
.. method:: onEndRoundTrip()
3817+
3818+
.. code-block:: javascript
3819+
3820+
onEndRoundTrip([Object traceContext]);
3821+
3822+
Called when a round trip ends. OpenTelemetry will end the span. The
3823+
traceContext object passed in :meth:`onBeginRoundTrip()` is also passed
3824+
in this method.
3825+
3826+
.. _onendroundtrip:
3827+
3828+
.. list-table-with-summary:: onEndRoundTrip() Parameters
3829+
:header-rows: 1
3830+
:class: wy-table-responsive
3831+
:align: center
3832+
:widths: 10 10 30
3833+
:summary: The first column displays the parameter. The second column
3834+
displays the data type of the parameter. The third column displays
3835+
the description of the parameter.
3836+
3837+
* - Parameter
3838+
- Data Type
3839+
- Description
3840+
* - ``traceContext``
3841+
- Object
3842+
- The trace context details. This includes connection configuration details, call level details, and additional attribute details.
3843+
3844+
.. _tracehandler:
3845+
3846+
TraceHandler Methods
3847+
--------------------
3848+
3849+
.. method:: oracledb.traceHandler.getTraceInstance()
3850+
3851+
.. code-block:: javascript
3852+
3853+
getTraceInstance();
3854+
3855+
Returns the user-defined instance implementing the TraceHandlerBase class.
3856+
Note that this is a synchronous method.
3857+
3858+
.. method:: oracledb.traceHandler.isEnabled()
3859+
3860+
.. code-block:: javascript
3861+
3862+
isEnabled();
3863+
3864+
Checks if an instance implementing the
3865+
:ref:`TraceHandlerBase class <tracehandlerbaseclass>` is registered and if
3866+
the abstract methods will be invoked. Note that this is a synchronous
3867+
method.
3868+
3869+
.. method:: oracledb.traceHandler.setTraceInstance()
3870+
3871+
.. code-block:: javascript
3872+
3873+
setTraceInstance([Object obj]);
3874+
3875+
Sets the user-defined implementation of the TraceHandlerBase class. Note
3876+
that this is a synchronous method.
3877+
3878+
The parameters of the ``oracledb.traceHandler.setTraceInstance()`` method are:
3879+
3880+
.. _settraceinstance:
3881+
3882+
.. list-table-with-summary:: oracledb.traceHandler.setTraceInstance() Parameters
3883+
:header-rows: 1
3884+
:class: wy-table-responsive
3885+
:align: center
3886+
:widths: 10 10 30
3887+
:summary: The first column displays the parameter. The second column
3888+
displays the data type of the parameter. The third column displays
3889+
the description of the parameter.
3890+
3891+
* - Parameter
3892+
- Data Type
3893+
- Description
3894+
* - ``obj``
3895+
- Object
3896+
- The singleton object pointing to the traceHandler instance.

doc/src/api_manual/pool.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ values.
5353
See :ref:`connectString <createpoolpoolattrsconnectstring>` parameter of
5454
:meth:`oracledb.createPool()`.
5555

56+
.. attribute:: pool.connectTraceConfig
57+
58+
.. versionadded:: 6.7
59+
60+
This read-only property is an object that returns connection related
61+
information. The connection information returned includes connectString,
62+
user, poolMin, poolMax, and poolIncrement.
63+
5664
.. attribute:: pool.edition
5765

5866
This read-only property is a string which identifies the edition name

doc/src/index.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
Welcome to node-oracledb's documentation!
2-
=========================================
1+
Welcome to node-oracledb's documentation
2+
========================================
33

44
The `node-oracledb <https://www.npmjs.com/package/oracledb>`__ add-on
55
for Node.js powers high performance Oracle Database applications.
66

7-
**node-oracledb** is distributed under an open-source :ref:`license
8-
<license>`. Changes in the node-oracledb releases can be found in the
9-
:ref:`release notes <releasenotes>`.
10-
11-
This module is currently tested with Node.js 16, 18, and 20 against Oracle
12-
Database 23ai, 21c, 19c, 12c, and 11gR2.
13-
147
You can use assistive technology products, such as screen readers, while you
158
work with the node-oracledb documentation. You can also use the keyboard
169
instead of the mouse.

doc/src/user_guide/appendix_a.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,14 @@ See :ref:`tnsadmin` and :ref:`oraaccess` for more information.
413413
Connection Strings
414414
++++++++++++++++++
415415

416-
The node-oracledb Thin mode accepts connection strings in the same formats as
417-
the Oracle Client libraries used by Thick mode does, but not all Oracle Net
418-
keywords will be supported.
416+
Node-oracledb Thin mode accepts :ref:` Oracle Net Services connection strings
417+
<connectionstrings>` in the same formats as the Oracle Client libraries used by
418+
Thick mode does, but not all Oracle Net keywords will be supported.
419419

420420
The following table lists the parameters that are recognized in Thin mode
421-
either in Easy Connect Strings or in Full Connect Descriptor Strings that are
422-
either explicitly passed or referred to by a ``tnsnames.ora`` alias. All
423-
unrecognized parameters are ignored.
421+
either in :ref:`Easy Connect <easyconnect>` strings, or in
422+
:ref:`Connect Descriptors <embedtns>` that are either explicitly passed, or
423+
are in a ``tnsnames.ora`` file. All unrecognized parameters are ignored.
424424

425425
.. list-table-with-summary:: Oracle Net Keywords Supported in the node-oracledb Thin Mode
426426
:header-rows: 1

0 commit comments

Comments
 (0)