Hello
I am using oracledb 6.2.0.
Your library is a very helpful and powerful tool. But there is a limitation. Associative arrays in javascript are more similar to objects. They can be represented as arrays when they are indexed by pls_integer but when the library converts an associative array into a javascript array, the keys are disregarded.
For example
CREATE OR REPLACE PACKAGE PKG AUTHID DEFINER AS
TYPE IAT IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
FUNCTION F RETURN IAT;
END;
CREATE OR REPLACE PACKAGE BODY PKG AS
FUNCTION F RETURN IAT IS
R IAT;
BEGIN
R(2):=22;
R(5):=55;
RETURN R;
END ;
END PKG ;
const r = await connection.execute(
`BEGIN
:ret := pkg.f;
END;`,
{
ret: {
dir: oracledb.BIND_OUT,
type: "PKG.IAT"
}
});
for (const o of r.outBinds.ret) {
console.log(o);
}
The result is:
22
55
But it should be
undefined
22
undefined
undefined
55
Or even better it could by an object
{2: 22, 5: 55}
This limitation makes library not useful for work with associative arrays.
The keys are present in the source data

So it could be a great improvement with a minor change in the code.
Thank you
Best regards,
Marian