Skip to content

Commit c231bdf

Browse files
committed
Added settable session attributes via Thin mode
1 parent 2cfaff3 commit c231bdf

File tree

9 files changed

+765
-14
lines changed

9 files changed

+765
-14
lines changed

doc/src/api_manual/oracledb.rst

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,29 @@ Each of the configuration properties is described below.
821821
const oracledb = require('oracledb');
822822
oracledb.dbObjectAsPojo = false;
823823
824+
.. attribute:: oracledb.driverName
825+
826+
.. versionadded:: 6.7
827+
828+
This property is a string that specifies the name of the driver used by
829+
the client to connect to Oracle Database. This is equivalent to the value
830+
in the ``CLIENT_DRIVER`` column of the ``V$SESSION_CONNECT_INFO`` view.
831+
832+
This property may be overridden when creating a
833+
:meth:`standalone connection <oracledb.getConnection()>` or a
834+
:meth:`connection pool <oracledb.createPool()>`.
835+
836+
.. note::
837+
838+
This property can only be used in the node-oracledb Thin mode.
839+
840+
**Example**
841+
842+
.. code-block:: javascript
843+
844+
const oracledb = require('oracledb');
845+
oracledb.driverName = 'mydriver';
846+
824847
.. attribute:: oracledb.edition
825848

826849
.. versionadded:: 2.2
@@ -1177,6 +1200,29 @@ Each of the configuration properties is described below.
11771200
const oracledb = require('oracledb');
11781201
oracledb.lobPrefetchSize = 16384;
11791202
1203+
.. attribute:: oracledb.machine
1204+
1205+
.. versionadded:: 6.7
1206+
1207+
This property is a string that specifies the name of the host machine
1208+
where the connection originates. This is equivalent to the value in the
1209+
``MACHINE`` column of the ``V$SESSION`` view.
1210+
1211+
This property may be overridden when creating a
1212+
:meth:`standalone connection <oracledb.getConnection()>` or a
1213+
:meth:`connection pool <oracledb.createPool()>`.
1214+
1215+
.. note::
1216+
1217+
This property can only be used in the node-oracledb Thin mode.
1218+
1219+
**Example**
1220+
1221+
.. code-block:: javascript
1222+
1223+
const oracledb = require('oracledb');
1224+
oracledb.machine = 'mymachine';
1225+
11801226
.. attribute:: oracledb.maxRows
11811227

11821228
This property is the maximum number of rows that are fetched by a query
@@ -1266,6 +1312,29 @@ Each of the configuration properties is described below.
12661312
const oracledb = require('oracledb');
12671313
console.log("Oracle client library version is " + oracledb.oracleClientVersionString);
12681314
1315+
.. attribute:: oracledb.osUser
1316+
1317+
.. versionadded:: 6.7
1318+
1319+
This property is a string that specifies the name of the operating system
1320+
user that initiates the database connection. This is equivalent to the
1321+
value in the ``OSUSER`` column of the ``V$SESSION`` view.
1322+
1323+
This property may be overridden when creating a
1324+
:meth:`standalone connection <oracledb.getConnection()>` or a
1325+
:meth:`connection pool <oracledb.createPool()>`.
1326+
1327+
.. note::
1328+
1329+
This method is only supported in node-oracledb Thin mode.
1330+
1331+
**Example**
1332+
1333+
.. code-block:: javascript
1334+
1335+
const oracledb = require('oracledb');
1336+
oracledb.osUser = 'myuser';
1337+
12691338
.. attribute:: oracledb.outFormat
12701339

12711340
This property is a number that identifies the format of query rows
@@ -1592,6 +1661,29 @@ Each of the configuration properties is described below.
15921661
const oracledb = require('oracledb');
15931662
oracledb.prefetchRows = 2;
15941663
1664+
.. attribute:: oracledb.program
1665+
1666+
.. versionadded:: 6.7
1667+
1668+
This property is a string that specifies the name of the program
1669+
connecting to the database. This is equivalent to the value in the
1670+
``PROGRAM`` column of the ``V$SESSION`` view.
1671+
1672+
This property may be overridden when creating a
1673+
:meth:`standalone connection <oracledb.getConnection()>` or a
1674+
:meth:`connection pool <oracledb.createPool()>`.
1675+
1676+
.. note::
1677+
1678+
This method is only supported in node-oracledb Thin mode.
1679+
1680+
**Example**
1681+
1682+
.. code-block:: javascript
1683+
1684+
const oracledb = require('oracledb');
1685+
oracledb.program = 'myprogram';
1686+
15951687
.. attribute:: oracledb.Promise
15961688

15971689
**The ``oracledb.Promise`` property is no longer used in node-oracledb 5
@@ -1699,6 +1791,29 @@ Each of the configuration properties is described below.
16991791
const oracledb = require('oracledb');
17001792
oracledb.stmtCacheSize = 30;
17011793
1794+
.. attribute:: oracledb.terminal
1795+
1796+
.. versionadded:: 6.7
1797+
1798+
This property is a string that specifies the name of the terminal from
1799+
where the connection originates. This is equivalent to the value in the
1800+
``TERMINAL`` column of the ``V$SESSION`` view.
1801+
1802+
This property may be overridden when creating a
1803+
:meth:`standalone connection <oracledb.getConnection()>` or a
1804+
:meth:`connection pool <oracledb.createPool()>`.
1805+
1806+
.. note::
1807+
1808+
This method is only supported in node-oracledb Thin mode.
1809+
1810+
**Example**
1811+
1812+
.. code-block:: javascript
1813+
1814+
const oracledb = require('oracledb');
1815+
oracledb.terminal = 'myterminal';
1816+
17021817
.. attribute:: oracledb.thin
17031818

17041819
.. versionadded:: 6.0
@@ -1926,6 +2041,16 @@ Oracledb Methods
19262041
.. versionadded:: 2.1
19272042

19282043
The alias ``connectionString``.
2044+
* - ``driverName``
2045+
- String
2046+
- Thin
2047+
- .. _createpoolpoolattrsdrivername:
2048+
2049+
The name of the driver that is used by the client to connect to Oracle Database. This is equivalent to the value in the ``CLIENT_DRIVER`` column of the ``V$SESSION_CONNECT_INFO`` view.
2050+
2051+
This optional property overrides the :attr:`oracledb.driverName` property.
2052+
2053+
.. versionadded:: 6.7
19292054
* - ``walletPassword``
19302055
- String
19312056
- Thin
@@ -2022,6 +2147,26 @@ Oracledb Methods
20222147
See :ref:`Heterogeneous Connection Pools and Pool Proxy Authentication <connpoolproxy>` for details and examples.
20232148

20242149
.. versionadded:: 2.3
2150+
* - ``machine``
2151+
- String
2152+
- Thin
2153+
- .. _createpoolpoolattrsmachine:
2154+
2155+
The name of the host machine from where the connection originates. This is equivalent to the value in the ``MACHINE`` column of the ``V$SESSION`` view.
2156+
2157+
This optional property overrides the :attr:`oracledb.machine` property.
2158+
2159+
.. versionadded:: 6.7
2160+
* - ``osUser``
2161+
- String
2162+
- Thin
2163+
- .. _createpoolpoolattrsosuser:
2164+
2165+
The name of the operating system user that initiates the database connection. This is equivalent to the value in the ``OSUSER`` column of the ``V$SESSION`` view.
2166+
2167+
This optional property overrides the :attr:`oracledb.osUser` property.
2168+
2169+
.. versionadded:: 6.7
20252170
* - ``password``
20262171
- String
20272172
- Both
@@ -2053,6 +2198,16 @@ Oracledb Methods
20532198
See :ref:`Privileged Connections <privconn>` for more information.
20542199

20552200
.. versionadded:: 6.5.1
2201+
* - ``program``
2202+
- String
2203+
- Thin
2204+
- .. _createpoolpoolattrsprogram:
2205+
2206+
The name of the program connecting to the database. This is equivalent to the value in the ``PROGRAM`` column of the ``V$SESSION`` view.
2207+
2208+
This optional property overrides the :attr:`oracledb.program` property.
2209+
2210+
.. versionadded:: 6.7
20562211
* - ``configDir``
20572212
- String
20582213
- Thin
@@ -2179,6 +2334,16 @@ Oracledb Methods
21792334
For node-oracledb Thick mode, use an :ref:`Easy Connect string <easyconnect>` or a :ref:`Connect Descriptor string <embedtns>` instead.
21802335

21812336
.. versionadded:: 6.0
2337+
* - ``terminal``
2338+
- String
2339+
- Thin
2340+
- .. _createpoolpoolattrsterminal:
2341+
2342+
The name of the terminal from where the connection originates. This is equivalent to the value in the ``TERMINAL`` column of the ``V$SESSION`` view.
2343+
2344+
This optional property overrides the :attr:`oracledb.terminal` property.
2345+
2346+
.. versionadded:: 6.7
21822347
* - ``transportConnectTimeout``
21832348
- Number
21842349
- Thin
@@ -2653,6 +2818,16 @@ Oracledb Methods
26532818
.. versionadded:: 2.1
26542819

26552820
The alias ``connectionString``.
2821+
* - ``driverName``
2822+
- String
2823+
- Thin
2824+
- .. _getconnectiondbattrsdrivername:
2825+
2826+
The name of the driver that is used by the client to connect to Oracle Database. This is equivalent to the value in the ``CLIENT_DRIVER`` column of the ``V$SESSION_CONNECT_INFO`` view.
2827+
2828+
This optional property overrides the :attr:`oracledb.driverName` property.
2829+
2830+
.. versionadded:: 6.7
26562831
* - ``walletPassword``
26572832
- String
26582833
- Thin
@@ -2717,6 +2892,16 @@ Oracledb Methods
27172892
The ``user`` (or ``username``) and ``password`` properties should not be set when ``externalAuth`` is *true*.
27182893

27192894
Note prior to node-oracledb 0.5 this property was called ``isExternalAuth``.
2895+
* - ``machine``
2896+
- String
2897+
- Thin
2898+
- .. _getconnectiondbattrsmachine:
2899+
2900+
The name of the host machine from where the connection originates. This is equivalent to the value in the ``MACHINE`` column of the ``V$SESSION`` view.
2901+
2902+
This optional property overrides the :attr:`oracledb.machine` property.
2903+
2904+
.. versionadded:: 6.7
27202905
* - ``matchAny``
27212906
- Boolean
27222907
- Thick
@@ -2741,12 +2926,32 @@ Oracledb Methods
27412926
See :ref:`Changing Passwords and Connecting with an Expired Password <changingpassword>`.
27422927

27432928
.. versionadded:: 2.2
2929+
* - ``osUser``
2930+
- String
2931+
- Thin
2932+
- .. _getconnectiondbattrsosuser:
2933+
2934+
The name of the operating system user that initiates the database connection. This is equivalent to the value in the ``OSUSER`` column of the ``V$SESSION`` view.
2935+
2936+
This optional property overrides the :attr:`oracledb.osUser` property.
2937+
2938+
.. versionadded:: 6.7
27442939
* - ``poolAlias``
27452940
- String
27462941
- Both
27472942
- .. _getconnectiondbattrspoolalias:
27482943

27492944
Specifies which previously created pool in the :ref:`connection pool cache <connpoolcache>` to obtain the connection from. See :ref:`Pool Alias <getconnectionpoolalias>`.
2945+
* - ``program``
2946+
- String
2947+
- Thin
2948+
- .. _getconnectiondbattrsprogram:
2949+
2950+
The name of the program connecting to the database. This is equivalent to the value in the ``PROGRAM`` column of the ``V$SESSION`` view.
2951+
2952+
This optional property overrides the :attr:`oracledb.program` property.
2953+
2954+
.. versionadded:: 6.7
27502955
* - ``configDir``
27512956
- String
27522957
- Thin
@@ -2885,6 +3090,16 @@ Oracledb Methods
28853090
For node-oracledb Thick mode, use an :ref:`Easy Connect string <easyconnect>` or a :ref:`Connect Descriptor string <embedtns>` instead.
28863091

28873092
.. versionadded:: 6.0
3093+
* - ``terminal``
3094+
- String
3095+
- Thin
3096+
- .. _getconnectiondbattrsterminal:
3097+
3098+
The name of the terminal from where the connection originates. This is equivalent to the value in the ``TERMINAL`` column of the ``V$SESSION`` view.
3099+
3100+
This optional property overrides the :attr:`oracledb.terminal` property.
3101+
3102+
.. versionadded:: 6.7
28883103
* - ``transportConnectTimeout``
28893104
- Number
28903105
- Thin

doc/src/release_notes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ Thin Mode Changes
4747
See `Issue #1684 <https://github.com/oracle/node-oracledb/issues/
4848
1684>`__.
4949

50+
#) Added new properties in `oracledb` that can enable users to customize and set session information,
51+
making it easier to manage and monitor database interactions.
52+
5053
Thick Mode changes
5154
++++++++++++++++++
5255

0 commit comments

Comments
 (0)