Skip to content

Commit e190a3d

Browse files
committed
Initial Documentation and test updates
1 parent 9b28288 commit e190a3d

File tree

4 files changed

+61
-20
lines changed

4 files changed

+61
-20
lines changed

doc/src/api_manual/dbobject.rst

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ Calling :meth:`connection.getDbObjectClass()` returns a prototype object
88
representing a named Oracle Database object or collection. Use
99
``dbObject.prototype`` on the class to see the available attributes.
1010

11-
Objects of a named DbObject type are: - created from a DbObject
12-
prototype by calling ``new()`` - returned by queries - returned when
13-
using BIND_OUT for an Oracle Database object.
11+
Objects of a named DbObject type are:
12+
13+
- created from a DbObject prototype by calling ``new()``
14+
- returned by queries
15+
- returned when using BIND_OUT for an Oracle Database object
1416

1517
See :ref:`Oracle Database Objects and Collections <objects>` for more
1618
information.
@@ -26,10 +28,10 @@ The properties of a DbObject object are listed below.
2628

2729
.. attribute:: dbObject.attributes
2830

29-
This property is an object. When ``dbObject.isCollection`` is *false*,
30-
this will be an object containing attributes corresponding to the Oracle
31-
Database object attributes. The name of each attribute follows normal
32-
Oracle casing semantics.
31+
This read-only property is an object. When :attr:`dbObject.isCollection`
32+
is *false*, this will be an object containing attributes corresponding to
33+
the Oracle Database object attributes. The name of each attribute follows
34+
normal Oracle casing semantics.
3335

3436
Each attribute will have an object that contains:
3537

@@ -57,19 +59,19 @@ The properties of a DbObject object are listed below.
5759
5860
.. attribute:: dbObject.elementType
5961

60-
This read-only property is a number. When ``dbObject.isCollection`` is
62+
This read-only property is a number. When :attr:`dbObject.isCollection` is
6163
*true*, this will have a value corresponding to one of the
6264
:ref:`Oracle Database Type Constants <oracledbconstantsdbtype>`.
6365

6466
.. attribute:: dbObject.elementTypeClass
6567

66-
This read-only property is an object. When ``dbObject.isCollection`` is
67-
*true* and the elements in the collection refer to database objects, this
68-
property provides the type class information of the elements.
68+
This read-only property is an object. When :attr:`dbObject.isCollection`
69+
is *true* and the elements in the collection refer to database objects,
70+
this property provides the type class information of the elements.
6971

7072
.. attribute:: dbObject.elementTypeName
7173

72-
This read-only property is a string. When ``dbObject.isCollection`` is
74+
This read-only property is a string. When :attr:`dbObject.isCollection` is
7375
*true*, this will have the name of the element type, such as “VARCHAR2”
7476
or “NUMBER”.
7577

@@ -85,7 +87,7 @@ The properties of a DbObject object are listed below.
8587

8688
.. attribute:: dbObject.length
8789

88-
This read-only property is a number. When ``dbObject.isCollection`` is
90+
This read-only property is a number. When :attr:`dbObject.isCollection` is
8991
*true*, this will have the number of elements in the collection. It is
9092
undefined for non-collections.
9193

doc/src/release_notes.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ Common Changes
2828

2929
#) Added support for fetching BLOB columns which have the
3030
``IS JSON FORMAT OSON`` constraint enabled in the same way as columns of
31-
type JSON. In node-oracledb :ref:`Thick mode <enablingthick>` this requires
32-
Oracle Client 21c or later. Applications can get this new fetch behaviour
33-
by setting the oracledb property :attr:`oracledb.future.oldJsonColumnAsObj`
34-
to `true`. The default value for this property is `false` which retains
35-
the existing fetch behaviour.
31+
type JSON. In node-oracledb :ref:`Thick mode <enablingthick>`, this
32+
requires Oracle Client 21c or later. Applications can get this new fetch
33+
behaviour by setting the oracledb property
34+
:attr:`oracledb.future.oldJsonColumnAsObj` to `true`. The default value
35+
for this property is `false` which retains the existing fetch behaviour.
3636
In a future version, the new fetch behaviour will become default and
3737
setting this property will no longer be needed.
3838

3939
#) Added methods :meth:`connection.decodeOSON()` and
4040
:meth:`connection.encodeOSON()` to support fetching and inserting into
41-
columns which have the check constraint ``IS JSON FORMAT OSON``
42-
enabled. See :ref:`osontype` for more information.
41+
columns that have the ``IS JSON FORMAT OSON`` check constraint enabled.
42+
See :ref:`osontype` for more information.
4343

4444
#) Connections to standby database opened `MOUNTED` return
4545
`NAN <https://github.com/nodejs/nan>`__ for

test/dataTypeVector1.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,4 +1839,33 @@ describe('294. dataTypeVector1.js', function() {
18391839
const result = await connection.execute(`select Vector64Col from ${tableName}`);
18401840
assert.deepStrictEqual(result.rows[0][0], [1, 0, 3, 4, 5, 6, 7, 8, 9, 0]);
18411841
}); // 294.71
1842+
1843+
it('294.72 inserting empty vector in Fixed and Flex vector columns', async function() {
1844+
const emptyVector = [];
1845+
const columns = ['VectorFixedCol', 'VectorFlexCol', 'VectorFlex32Col',
1846+
'VectorFlex64Col',
1847+
'VectorFlex8Col'
1848+
];
1849+
1850+
const binds = [
1851+
{ type: oracledb.DB_TYPE_VECTOR, dir: oracledb.BIND_IN, val: emptyVector }
1852+
];
1853+
1854+
for (let i = 0; i < columns.length; i++) {
1855+
const sql = `INSERT INTO ${tableName} (IntCol, ${columns[i]})
1856+
VALUES (2, :embed_array)`;
1857+
1858+
await assert.rejects(
1859+
async () => await connection.execute(
1860+
sql,
1861+
binds
1862+
),
1863+
/ORA-51803:/
1864+
/*
1865+
ORA-51803: Vector dimension count must match the dimension count
1866+
specified in the column definition (actual: , required: ).
1867+
*/
1868+
);
1869+
}
1870+
}); // 294.72
18421871
});

test/list.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4190,6 +4190,9 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
41904190
163.12 numIterations - No parameters
41914191
163.13 numIterations - DML RETURNING
41924192
163.14 Negative - set numIterations to be negative value
4193+
163.15 getting dmlrowcounts after executemany with dmlrowcounts=False
4194+
163.16 executemany() with an invalid row
4195+
163.17 calls PL/SQL, with round trip count check
41934196

41944197
164. soda1.js
41954198
164.1 getSodaDatabase() creates a sodaDatabase Object
@@ -5721,6 +5724,13 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
57215724
294.63 test binding a vector with inf values (negative)
57225725
294.64 fetch JSON value with an embedded vector
57235726
294.65 bind JSON value with an embedded vector
5727+
294.66 with type Int16Array invalid typed arrays
5728+
294.67 typed arrays with strings
5729+
294.68 typed arrays with objects
5730+
294.69 typed arrays with boolean values
5731+
294.70 typed arrays with undefined value
5732+
294.71 typed arrays with null values
5733+
294.72 inserting empty vector in Fixed and Flex vector columns
57245734

57255735
295. dataTypeVector2.js
57265736
295.1 verify fetch information for older clients

0 commit comments

Comments
 (0)