Skip to content

Commit a848410

Browse files
committed
Add updates to documentation and more tests
1 parent 6837c4b commit a848410

File tree

5 files changed

+34
-28
lines changed

5 files changed

+34
-28
lines changed

doc/src/user_guide/globalization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To find the database's national character set, execute the query:
5151
Setting the Client Character Set
5252
--------------------------------
5353

54-
In node-oracledb, the encoding used for all character data is "UTF-8".
54+
In node-oracledb, the encoding used for all character data is AL32UTF8.
5555

5656
Setting the Client Locale
5757
=========================

doc/src/user_guide/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ database options or packs.
2424
Node-oracledb is typically installed from the `npm registry <https://www.npmjs
2525
.com/package/oracledb>`__. See :ref:`installation` for more information.
2626

27-
This node-oracledb release has been tested with Node.js 14, 16 and 18 on
27+
This node-oracledb release has been tested with Node.js 14, 16, 18 and 20 on
2828
Oracle Linux x86_64 (releases 7 and 8), Oracle Linux ARM (aarch64, release 8),
2929
Windows, and macOS. Node-oracledb may run on other platforms, and with other
3030
Node.js versions, if they are `Node-API <https://nodejs.org/api/n-api.html>`__

doc/src/user_guide/objects.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ This gives::
5353
name: 'SDO_GEOMETRY',
5454
fqn: 'MDSYS.SDO_GEOMETRY',
5555
attributes:
56-
{ SDO_GTYPE: { type: 2010, typeName: 'NUMBER' },
56+
{ SDO_GTYPE: { type: 2010, typeName: 'NUMBER' },
5757
SDO_SRID: { type: 2010, typeName: 'NUMBER' },
5858
SDO_POINT:
59-
{ type: 2023,
59+
{ type: 2023,
6060
typeName: 'MDSYS.SDO_POINT_TYPE',
6161
typeClass: [Object] },
6262
SDO_ELEM_INFO:
63-
{ type: 2023,
63+
{ type: 2023,
6464
typeName: 'MDSYS.SDO_ELEM_INFO_ARRAY',
6565
typeClass: [Object] },
6666
SDO_ORDINATES:
67-
{ type: 2023,
67+
{ type: 2023,
6868
typeName: 'MDSYS.SDO_ORDINATE_ARRAY',
6969
typeClass: [Object] } },
7070
isCollection: false }
@@ -85,7 +85,7 @@ set that are not present in the database object will be ignored.
8585
.. code-block:: javascript
8686
8787
const geom = new GeomType(
88-
{
88+
{
8989
SDO_GTYPE: 2003,
9090
SDO_SRID: null,
9191
SDO_POINT: null,
@@ -310,7 +310,7 @@ insertion into ``mytab`` use:
310310
`BEGIN mypkg.myinproc(:id, :vals); END;`,
311311
{
312312
id: 1234,
313-
vals: { type: oracledb.NUMBER,
313+
vals: { type: oracledb.NUMBER,
314314
dir: oracledb.BIND_IN,
315315
val: [1, 2, 23, 4, 10]
316316
}
@@ -324,7 +324,7 @@ Alternatively, “bind by position” syntax can be used:
324324
`BEGIN mypkg.myinproc(:id, :vals); END;`,
325325
[
326326
1234,
327-
{ type: oracledb.NUMBER,
327+
{ type: oracledb.NUMBER,
328328
dir: oracledb.BIND_IN,
329329
val: [1, 2, 23, 4, 10]
330330
}
@@ -336,7 +336,7 @@ After executing either of these ``mytab`` will contain:
336336

337337
ID NUMCOL
338338
---------- ----------
339-
1234 1
339+
1234 1
340340
1234 2
341341
1234 23
342342
1234 4
@@ -400,7 +400,7 @@ With these values, the following node-oracledb code will print
400400
`BEGIN mypkg.myoutproc(:id, :vals); END;`,
401401
{
402402
id: 99,
403-
vals: { type: oracledb.NUMBER,
403+
vals: { type: oracledb.NUMBER,
404404
dir: oracledb.BIND_OUT,
405405
maxArraySize: 10 // allocate memory to hold 10 numbers
406406
}

doc/src/user_guide/plsql_execution.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Since the code does not explicitly set ``oracledb.edition`` (or
309309
equivalent), then the first implementation of ``DISCOUNT`` in the
310310
default edition is used. The output might be like::
311311

312-
[ { NAME: 'lamp', PRICE: 40, DISCOUNTPRICE: 36 },
312+
[ { NAME: 'lamp', PRICE: 40, DISCOUNTPRICE: 36 },
313313
{ NAME: 'wire', PRICE: 10, DISCOUNTPRICE: 6 },
314314
{ NAME: 'switch', PRICE: 4, DISCOUNTPRICE: 1 } ]
315315

@@ -330,7 +330,7 @@ If the connection uses edition ``e2``, then the second implementation of
330330
331331
The output might be like::
332332

333-
[ { NAME: 'lamp', PRICE: 40, DISCOUNTPRICE: 30 },
333+
[ { NAME: 'lamp', PRICE: 40, DISCOUNTPRICE: 30 },
334334
{ NAME: 'wire', PRICE: 10, DISCOUNTPRICE: 7.5 },
335335
{ NAME: 'switch', PRICE: 4, DISCOUNTPRICE: 3 } ]
336336

doc/src/user_guide/sql_execution.rst

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -836,24 +836,30 @@ precision.
836836
Fetching Dates and Timestamps
837837
+++++++++++++++++++++++++++++
838838

839-
The Oracle Database DATE and TIMESTAMP columns are fetched as JavaScript date
840-
types in the timezone of the application. The Oracle Database TIMESTAMP WITH
841-
LOCAL TIME ZONE and TIMESTAMP WITH TIME ZONE columns are fetched as TIMESTAMP
842-
WITH LOCAL TIME ZONE. Oracle INTERVAL types are not supported. The connection
843-
session time zone does not affect these data types.
839+
Oracle Database DATE and TIMESTAMP columns are fetched as dates in the timezone
840+
of the application. The TIMESTAMP WITH TIME ZONE and TIMESTAMP WITH LOCAL TIME
841+
ZONE columns are fetched as absolute dates. Note that JavaScript Date has
842+
millisecond precision therefore timestamps will lose any sub-millisecond
843+
fractional part when fetched.
844844

845-
.. versionchanged:: 6.0
846-
847-
Prior to this release, the DATE and TIMESTAMP columns were fetched as
848-
TIMESTAMP WITH LOCAL TIME ZONE.
845+
Oracle INTERVAL types are not supported.
849846

850-
Note that JavaScript Date has millisecond precision. Therefore, timestamps
851-
will lose any sub-millisecond fractional part when fetched.
847+
.. versionchanged:: 6.0
852848

853-
To make applications more portable, it is recommended to always set the
854-
session time zone to a pre-determined value, such as UTC. The session
855-
time zone should generally match the client system time zone, for
856-
example the ``TZ`` environment variable or the Windows time zone region.
849+
Oracle Database DATE and TIMESTAMP types are now returned as JavaScript
850+
date types in the application's timezone, and no longer fetched or bound as
851+
TIMESTAMP WITH LOCAL TIME ZONE. The connection session time zone no longer
852+
impacts these types. This behavior aligns with other Oracle Database tools
853+
and drivers. Handling of TIMESTAMP WITH TIMEZONE and TIMESTAMP WITH LOCAL
854+
TIMEZONE has not changed. For DATE and TIMESTAMP compatibility with
855+
node-oracledb 5.5, use a :ref:`fetch type handler <fetchtypehandler>` and
856+
set the return ``type`` attribute to ``oracledb.DB_TYPE_TIMESTAMP_LTZ``.
857+
Also use a similar type when binding if compatibility is needed.
858+
859+
To make applications more portable, it is recommended to set the client system
860+
time zone (for example the ``TZ`` environment variable or the Windows time zone
861+
region) to match the Oracle session time zone, and to use a pre-determined
862+
value, such as UTC.
857863

858864
You can find the current session time zone with:
859865

0 commit comments

Comments
 (0)