From bd8da281c8deeed448d5e967c222ef6d5bb7ce36 Mon Sep 17 00:00:00 2001 From: Sharad Chandran R Date: Mon, 30 Oct 2023 20:43:49 +0530 Subject: [PATCH] Update documentation for the latest features and minor updates in the connection properties for edge cases --- doc/src/api_manual/connection.rst | 60 ++++++++++++++++++++++++++++++ doc/src/release_notes.rst | 23 +++++------- lib/thin/protocol/messages/auth.js | 2 +- test/connProps.js | 2 +- 4 files changed, 72 insertions(+), 15 deletions(-) diff --git a/doc/src/api_manual/connection.rst b/doc/src/api_manual/connection.rst index b5a658f3..372ea24b 100644 --- a/doc/src/api_manual/connection.rst +++ b/doc/src/api_manual/connection.rst @@ -104,6 +104,29 @@ The properties of a *Connection* object are listed below. `ALTER SESSION SET CURRENT_SCHEMA `__. +.. attribute:: connection.dbDomain + + .. versionadded:: 6.3 + + This read-only property is a string that specifies the Oracle Database + domain name associated with the connection. This property returns the + same value as the SQL expression:: + + SELECT UPPER(VALUE) FROM V$PARAMETER WHERE NAME = 'db_domain'; + + The above SQL expression returns NULL if the domain name is not specified. + The ``dbDomain`` property returns an empty string in this case. + +.. attribute:: connection.dbName + + .. versionadded:: 6.3 + + This read-only property is a string that specifies the name of the Oracle + Database associated with the connection. This property returns the same + value as the SQL expression:: + + SELECT UPPER(NAME) FROM V$DATABASE; + .. attribute:: connection.dbOp .. versionadded:: 4.1 @@ -140,6 +163,23 @@ The properties of a *Connection* object are listed below. associated with the connection. It returns the same value as the SQL expression ``sys_context('userenv', 'instance_name')``. +.. attribute:: connection.maxOpenCursors + + .. versionadded:: 6.3 + + This read-only property is a number that indicates the maximum number of + SQL statements that can be concurrently opened in one connection. This + value can be specified in the `server parameter file + `__ using the + `open_cursors `__ parameter. This property + returns the same value as the SQL expression:: + + SELECT VALUE FROM V$PARAMETER WHERE NAME = 'open_cursors'; + + This property requires Oracle Database 12.1 or later. + .. attribute:: connection.module This write-only property is a string and it is the `module @@ -177,6 +217,16 @@ The properties of a *Connection* object are listed below. or later, client libraries. Otherwise it will show the base release such as “18.0.0.0.0” instead of “18.3.0.0.0”. +.. attribute:: connection.serviceName + + .. versionadded:: 6.3 + + This read-only property is a string that identifies the Oracle Database + service name associated with the connection. This property returns the + same value as the SQL expression:: + + SELECT UPPER(SYS_CONTEXT('USERENV', 'SERVICE_NAME')) FROM DUAL; + .. attribute:: connection.stmtCacheSize This read-only property is a number that identifies the number of @@ -282,6 +332,16 @@ The properties of a *Connection* object are listed below. This property can only be used in the node-oracledb Thick mode. See :ref:`enablingthick`. +.. attribute:: connection.transactionInProgress + + .. versionadded:: 6.3 + + This read-only property is a boolean that indicates whether a transaction + is currently in progress in the connection. If the value is *True*, then it + indicates that the specified connection has an active transaction. If the + value is *False*, then the specified connection does not have an active + transaction. + .. _connectionmethods: Connection Methods diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index 59669180..57b2c51e 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -13,19 +13,6 @@ node-oracledb `v6.3.0 __ - - ``domainName`` __ - - ``domainSchema`` __ - - ``isJson`` Indicates if the column is known to contain JSON data. - -Thin Mode Changes -++++++++++++++++++ - -#) Improved overall pool connection creation time by caching information - during the first connection establishment. - #) Added new connection properties :attr:`connection.dbDomain`, :attr:`connection.dbName`, :attr:`connection.maxOpenCursors`, :attr:`connection.serviceName` and :attr:`connection.transactionInProgress` @@ -33,6 +20,16 @@ Thin Mode Changes number of cursors that can be opened per connection, database service name and status of any ongoing transactions on the connection respectively. +#) Added new extended :ref:`metadata ` information such as + ``annotations``, ``domainName``, ``domainSchema`` and ``isJson`` for a + fetched column. + +Thin Mode Changes +++++++++++++++++++ + +#) Improved overall pool connection creation time by caching information + during the first connection establishment. + node-oracledb `v6.2.0 `__ (11 Oct 2023) -------------------------------------------------------------------------------------------------------- diff --git a/lib/thin/protocol/messages/auth.js b/lib/thin/protocol/messages/auth.js index daa5019b..bf5bdb75 100644 --- a/lib/thin/protocol/messages/auth.js +++ b/lib/thin/protocol/messages/auth.js @@ -321,7 +321,7 @@ class AuthMessage extends Message { let portReleaseNum; let portUpdateNum; - this.conn.dbDomain = this.sessionData['AUTH_SC_DB_DOMAIN'] || undefined; + this.conn.dbDomain = this.sessionData['AUTH_SC_DB_DOMAIN']; this.conn.dbName = this.sessionData['AUTH_SC_DBUNIQUE_NAME']; this.conn.maxOpenCursors = Number(this.sessionData['AUTH_MAX_OPEN_CURSORS']); this.conn.serviceName = this.sessionData['AUTH_SC_SERVICE_NAME']; diff --git a/test/connProps.js b/test/connProps.js index 94a86467..7a48cc75 100644 --- a/test/connProps.js +++ b/test/connProps.js @@ -190,7 +190,7 @@ describe('193. connProps.js', function() { if (result.rows[0][0]) { assert.deepStrictEqual(result.rows[0][0], conn.dbDomain.toUpperCase()); } else { - assert.deepStrictEqual(conn.dbDomain, undefined); + assert.deepStrictEqual(conn.dbDomain, ''); } await conn.close(); }); // 193.7