Skip to content

Conversation

@sla100
Copy link

@sla100 sla100 commented Jun 9, 2023

Hello. There is a simple change which allow to pass build-in bigint type to parameters in thin node.
This allows you to pass large integers without conversion to string in js and CAST on the Oracle side.
Ex.:

const {rows} = await conn.execute( 'SELECT null FROM DUAL WHERE :A = (CAST :B AS NUMBER)', {
  A: 1_000_000_000_000_001n,
  B: 1_000_000_000_000_001n.toString(),
});
equal(rows.length, 1);
Signed-off-by: Sławomir Osoba <[email protected]>

@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jun 9, 2023
@cjbj cjbj added oca-verified and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Jun 13, 2023
@sharadraju
Copy link
Member

We would also need to think about how to retrieve data from Oracle Database as bigint datatype as well.

@sla100
Copy link
Author

sla100 commented Jun 13, 2023

We would also need to think about how to retrieve data from Oracle Database as bigint datatype as well.

This translation is already possible for columns.

const fetchTypeHandler = ({dbType, precision, scale}) => {
  if (dbType === oracledb.DB_TYPE_NUMBER && scale === 0 && precision > 15) {
    return {
      type: oracledb.STRING,
      converter: (v) => v === null ? null : BigInt(v),
    };
  }
};

@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive This was marked by stalebot as inactive label Aug 12, 2023
@sharadraju sharadraju removed the inactive This was marked by stalebot as inactive label Aug 18, 2023
@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive This was marked by stalebot as inactive label Sep 17, 2023
@sharadraju sharadraju removed the inactive This was marked by stalebot as inactive label Nov 6, 2023
@sharadraju
Copy link
Member

@sla100 This has been fixed in the 6.5 release. Thank you for your contribution!

@sharadraju sharadraju closed this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants