fdb-record-layer
fdb-record-layer copied to clipboard
Adopt dataType for Literals and preparedValues
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.
StructMetadataandArrayMetadatawrapDataTypeas the source of truth for their type info. However, they still map tosql.Typesexternally. Moreover, they now exposegetRelationalDataType()that returnsDataTypeto the external users for more transparency.- Aligning to the above changes,
grpcprotobufs now have aTypeenum, moving away fromsql.Typestoo. This was needed to supportstructandarrayoperations 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.