-
Notifications
You must be signed in to change notification settings - Fork 495
WIP: Create mz-catalog-types crate #34924
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
antiguru
wants to merge
9
commits into
MaterializeInc:main
Choose a base branch
from
antiguru:mz_catalog_types_2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a new crate to hold shared catalog types. This crate will be used to reduce dependencies in mz-catalog-protos by moving types from crates like mz-cluster-client, mz-storage-types, and mz-compute-types here. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the ReplicaId type from mz-cluster-client to mz-catalog-types. The original crate now re-exports the type for backwards compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the StorageInstanceId type from mz-storage-types to mz-catalog-types. The original crate now re-exports the type for backwards compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the ComputeReplicaLogging type from mz-compute-types to mz-catalog-types. The original crate now re-exports the type for backwards compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add mz-catalog-types as a dependency of mz-catalog-protos so that the catalog protos crate can directly use the shared types (ReplicaId, StorageInstanceId, ComputeReplicaLogging) without going through the heavier intermediate crates. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…rom mz-catalog-protos Update mz-catalog-protos to import ReplicaId, StorageInstanceId, and ComputeReplicaLogging directly from mz-catalog-types, allowing us to remove the heavier mz-compute-types, mz-controller-types, and mz-storage-types dependencies. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add additional types to mz-catalog-types in preparation for further dependency reduction in mz-catalog-protos: - DatabaseId - SchemaId - ResolvedDatabaseSpecifier - SchemaSpecifier Note: These types use anyhow::Error for FromStr, while mz-sql uses PlanError. A future mz-sql-types crate may be needed to unify these. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduce IdParseError as a dedicated error type for ID parsing in mz-catalog-types, with a From impl to PlanError in mz-sql. This allows mz-sql to re-export DatabaseId and SchemaId from mz-catalog-types while maintaining compatibility with existing code that expects PlanError. Changes: - Add IdParseError type to mz-catalog-types - Update FromStr implementations in mz-catalog-types to use IdParseError - Add proptest/proptest-derive dependencies for Arbitrary derive - Add Display and From impls for ResolvedDatabaseSpecifier and SchemaSpecifier - Add From<IdParseError> for PlanError in mz-sql - Re-export DatabaseId and SchemaId from mz-catalog-types in mz-sql - Update mz-catalog-protos to import DatabaseId/SchemaId from mz-catalog-types Note: ResolvedDatabaseSpecifier and SchemaSpecifier remain in mz-sql due to orphan rule constraints with AstDisplay trait implementations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…-catalog-protos Move RoleId, NetworkPolicyId, CatalogItemId, GlobalId, RelationVersion, AclMode, and MzAclItem from mz-repr to mz-catalog-types. The original modules in mz-repr re-export these types for backwards compatibility and retain supplementary impls (RustType proto, Columnation, FixedSizeCodec). This eliminates the mz-repr dependency from mz-catalog-protos, which now imports all catalog types from the lightweight mz-catalog-types crate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Create a new
mz-catalog-typescrate to hold shared catalog types, reducing dependencies inmz-catalog-protos.Completed:
mz-catalog-typescrate with minimal dependencies (serde, anyhow, tracing)ReplicaIdfrommz-cluster-clientStorageInstanceIdfrommz-storage-typesComputeReplicaLoggingfrommz-compute-typesDatabaseId,SchemaId,ResolvedDatabaseSpecifier,SchemaSpecifiermz-compute-types,mz-controller-types,mz-storage-typesdependencies frommz-catalog-protosRemaining work to remove
mz-reprandmz-sqldependencies:mz-sqlusePlanErrorforFromStr::Err, whilemz-catalog-typesusesanyhow::Errormz-sql-typescrate forPlanErrorto unify the error typesmz-reprandmz-sqlneed to be movedTest plan
cargo check -p mz-catalog-typescargo check -p mz-catalog-protoscargo check -p mz-cluster-clientcargo check -p mz-storage-typescargo check -p mz-compute-types🤖 Generated with Claude Code