Skip to content

Adopt dataType for Literals and preparedValues #3395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 4.2.4-release
Choose a base branch
from

Conversation

g31pranjal
Copy link
Member

@g31pranjal g31pranjal commented Jun 12, 2025

This PR moves away from using java.sql.Types in the internals of fdb-relational-core, while still maintaining JDBC-compliance for external getType()-like operations. It is replaced with DataType, which provides richer and more diverse type information available for downstream operations. Notably, we can now have types like Uuid, Enum, Version expressed natively. There are several consequences of this:

  • It eliminates SQLType <-> RecordType conversions and instead relies on DataType <-> RecordType conversions, which were already being used for DDL work. This is more consistent as it is used throughout the codebase.
  • StructMetadata and ArrayMetadata wrap DataType as the source of truth for their type info. However, they still map to sql.Types externally. Moreover, they now expose getRelationalDataType() that returns DataType to the external users for more transparency.
  • Aligning to the above changes, grpc protobufs now have a Type enum, moving away from sql.Types too. This was needed to support struct and array operations homogenously across embedded and JDBC drivers. It keeps the old types too for backward compatibility, which I think should be removed in future to simplify conversions.

@g31pranjal g31pranjal force-pushed the adpot_dataType branch 2 times, most recently from 0e56d68 to bdc3827 Compare June 14, 2025 13:05
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.

1 participant