Skip to content

Commit a315a52

Browse files
Support added to thin mode for reading/writing OSON (JSON data type in
Oracle Database 21c+) and related documentation changes.
1 parent 9da22cd commit a315a52

28 files changed

+1531
-624
lines changed

doc/src/api_manual/cursor.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,14 @@ Cursor Methods
348348
.. method:: Cursor.setinputsizes(\*args, \*\*keywordArgs)
349349

350350
This can be used before a call to :meth:`~Cursor.execute()`,
351-
:meth:`~Cursor.callfunc()` or :meth:`~Cursor.callproc()` to predefine
352-
memory areas for the operation's parameters. Each parameter should be a
353-
type object corresponding to the input that will be used or it should be an
354-
integer specifying the maximum length of a string parameter. Use keyword
355-
parameters when binding by name and positional parameters when binding by
356-
position. The singleton None can be used as a parameter when using
357-
positional parameters to indicate that no space should be reserved for that
358-
position.
351+
:meth:`~Cursor.executemany()`, :meth:`~Cursor.callfunc()` or
352+
:meth:`~Cursor.callproc()` to predefine memory areas for the operation's
353+
parameters. Each parameter should be a type object corresponding to the
354+
input that will be used or it should be an integer specifying the maximum
355+
length of a string parameter. Use keyword parameters when binding by name
356+
and positional parameters when binding by position. The singleton None can
357+
be used as a parameter when using positional parameters to indicate that no
358+
space should be reserved for that position.
359359

360360
.. note::
361361

doc/src/api_manual/defaults.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@ Defaults Attributes
3939

4040
.. attribute:: defaults.fetch_decimals
4141

42-
Identifies whether numbers should be fetched as ``decimal.Decimal`` values.
42+
Identifies whether numbers should be fetched as `decimal.Decimal
43+
<https://docs.python.org/3/library/decimal.html#decimal-objects>`__ values.
4344
This can help avoid issues with converting numbers from Oracle Database's
4445
decimal format to Python's binary format.
4546

4647
An output type handler such as previously required in cx_Oracle (see
4748
`return_numbers_as_decimals.py <https://github.com/oracle/python-cx_Oracle/
4849
blob/main/samples/return_numbers_as_decimals.py>`__) can alternatively be
4950
used to adjust the returned type. If a type handler exists and returns a
50-
variable (that is, `cursor.var(...)`), then that return variable is used.
51+
variable (that is, ``cursor.var(...)``), then that return variable is used.
5152
If the type handler returns None, then the value of
5253
``oracledb.defaults.fetch_decimals`` is used to determine whether to return
5354
``decimal.Decimal`` values.
@@ -68,6 +69,9 @@ Defaults Attributes
6869
that return variable is used. If the type handler returns None, then the value of
6970
``oracledb.defaults.fetch_lobs`` is used.
7071

72+
The value of ``oracledb.defaults.fetch_lobs`` does not affect LOBs returned
73+
as OUT binds.
74+
7175
This attribute has an initial value of True.
7276

7377
.. attribute:: defaults.prefetchrows

doc/src/api_manual/module.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,16 +2179,6 @@ when binding data.
21792179
Describes columns in a database that are of type JSON (with Oracle Database
21802180
21 or later).
21812181

2182-
.. note::
2183-
2184-
DB_TYPE_JSON database type is only supported in the python-oracledb
2185-
Thick mode. See :ref:`enablingthick`.
2186-
2187-
In python-oracledb Thin mode, the JSON database type can be fetched
2188-
with an output type handler as described in :ref:`Fetching JSON
2189-
<fetchJSON>`.
2190-
2191-
21922182
.. data:: DB_TYPE_LONG
21932183

21942184
Describes columns, attributes or array elements in a database that are of

doc/src/user_guide/appendix_a.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ see :ref:`driverdiff` and :ref:`compatibility`.
347347
- Yes
348348
- Yes
349349
* - Oracle 21c JSON data type (see :data:`~oracledb.DB_TYPE_JSON`)
350-
- No - can fetch with an output type handler, see :ref:`Fetching JSON Differences <fetchJSON>`
350+
- Yes
351351
- Yes
352352
- Yes
353353
* - ROWID, UROWID data types
@@ -494,7 +494,7 @@ values.
494494
- cannot be set
495495
* - JSON
496496
- DB_TYPE_JSON
497-
- Yes. In python-oracledb Thin mode use an output type handler to fetch this Oracle Database 21c data type. See :ref:`jsondatatype`.
497+
- Yes
498498
- ANY (converted)
499499
* - REF CURSOR (PL/SQL OR nested cursor)
500500
- DB_TYPE_CURSOR

doc/src/user_guide/appendix_b.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,6 @@ not supported in the Oracle Client libraries that are used in python-oracledb
317317
Thick mode. Note changing the type of bind variables for the same SQL text is
318318
inappropriate and gives indeterminate results in both modes.
319319

320-
.. _fetchJSON:
321-
322-
Fetching JSON in Thin and Thick Modes
323-
=====================================
324-
325-
The python-oracledb Thin mode does not natively handle the Oracle Database 21c
326-
JSON data type but a type handler can be used when fetching the type, see
327-
:ref:`jsondatatype`.
328-
329320
Error Handling in Thin and Thick Modes
330321
======================================
331322

doc/src/user_guide/appendix_c.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ following steps:
516516
the code.
517517

518518
9. Modernize code as needed or desired. See :ref:`deprecations` for the list
519-
of deprecations in python-oracledb 1.0.
519+
of deprecations in python-oracledb.
520520

521521
Additional Upgrade Steps to use python-oracledb Thin Mode
522522
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

0 commit comments

Comments
 (0)