-
Notifications
You must be signed in to change notification settings - Fork 111
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
Unify ColumnType and CqlType #691
Labels
API-breaking
This might introduce incompatible API changes
API-stability
Part of the effort to stabilize the API
area/metadata
Milestone
Comments
wprzytula
added
API-breaking
This might introduce incompatible API changes
API-stability
Part of the effort to stabilize the API
labels
Jul 30, 2023
If we decided that it shouldn't be part of 0.12.0, please comment and describe the decision and dependency and change the Milestone. |
8 tasks
Lorak-mmk
added a commit
to Lorak-mmk/scylla-rust-driver
that referenced
this issue
Jan 8, 2025
Removed types: CqlType, CollectionType, NativeType. Fixes: scylladb#691
8 tasks
Lorak-mmk
added a commit
to Lorak-mmk/scylla-rust-driver
that referenced
this issue
Jan 9, 2025
Removed types: CqlType, CollectionType, NativeType. Their usages are replaced with the relevant types from scylla_cql. Fixes: scylladb#691
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
API-breaking
This might introduce incompatible API changes
API-stability
Part of the effort to stabilize the API
area/metadata
Currently, the driver has two complex but similar types:
ColumnType
andCqlType
. They are both supposed to represent a CQL type, but have slight differences:ColumnType
is used in metadata of prepared statements and responses to queries. It does not include information about whether collections and UDTs are frozen. The type definitions are self contained - if it represents a complex type that contains a UDT somewhere inside it, it has the whole definition of the UDT inline.CqlType
is used in ClusterMetadata - it is computed based on the information in the system tables. It does include information about whether collections and UDTs are frozen. Until recently (changed in topology: UDTs hold complete definition of themselves #649) information about UDTs was not inlined, but now it is; however, if metadata fetch returns inconsistent metadata and it does not have a definition of a UDT that was needed inside someCqlType
, then a placeholderMissingUserDefinedType
will be put instead.Those types have very similar names and function, so it might make sense to unify them. This will help write user logic that is supposed to operate on both representations. We will have to account for the differences:
()
vs.bool
, or two new enums isomorphic to those types that express the intent better.MissingUserDefinedType
case:Result<_, MissingUserDefinedType>
in the unified type. However, this would force the users that need to operate on the existingColumnType
representation to handle theResult
, even though it would never be an error, so that would introduce unnecessary complication and would be ugly.MissingUserDefinedType
into a generic parameter, like in the case of the "frozen flag" - in case ofColumnType
it would be an uninhabited type. Slightly better, but theResult
is still there.MissingUserDefinedType
altogether! I insisted on handling theMissingUserDefinedType
error like this to make the driver more robust; if we didn't have it then we would have to fail the whole metadata fetch and probably fail the creation ofSession
. However, if we move the cluster metadata module out of the driver like described in Move non-critical metadata out of Session #595, then it should be fine to fail the whole metadata fetch as it won't reduce availability. Therefore Move non-critical metadata out of Session #595 is a requirement for this solution.The text was updated successfully, but these errors were encountered: