Skip to content

Conversation

staticlibs
Copy link
Collaborator

This change improves support for integer types in ResultSet. It allows to fetch more narrow types (like SMALLINT) using getObject() calls with more wide type parameter (like BIGINT).

It also adds support for fethching HUGEINT values as instances of a BigInteger class and adds new methods to Connection to be able to insert 128-bit HUGEINT values passing them as a pair of long's or as a BigInteger.

Additonally it corrects JDBC types mapping for integer types and changes the fallback JDBC type from JAVA_OBJECT to OTHER.

Testing: new tests are added to cover integer values fetching from ResultSet; existing ResultSet tests moved to separate files.

Fixes: #204

This change improves support for integer types in `ResultSet`. It
allows to fetch more narrow types (like `SMALLINT`) using `getObject()`
calls with more wide type parameter (like `BIGINT`).

It also adds support for fethching `HUGEINT` values as instances of a
`BigInteger` class and adds new methods to `Connection` to be able to
insert 128-bit `HUGEINT` values passing them as a pair of `long`'s or
as a `BigInteger`.

Additonally it corrects JDBC types mapping for integer types and
changes the fallback JDBC type from `JAVA_OBJECT` to `OTHER`.

Testing: new tests are added to cover integer values fetching from
`ResultSet`; existing `ResultSet` tests moved to separate files.

Fixes: duckdb#204
@staticlibs staticlibs force-pushed the resultset_int_types branch from be215e7 to b517d73 Compare May 5, 2025 11:59
@staticlibs staticlibs merged commit 13b39f8 into duckdb:main May 5, 2025
7 checks passed
@staticlibs staticlibs deleted the resultset_int_types branch May 5, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResultSetMetaData.isSigned() incorrectly returns false for HUGEINT columns
1 participant