Skip to content

Conversation

@antiguru
Copy link
Member

@antiguru antiguru commented Feb 6, 2026

Summary

Create a new mz-catalog-types crate to hold shared catalog types, reducing dependencies in mz-catalog-protos.

Completed:

  • Created mz-catalog-types crate with minimal dependencies (serde, anyhow, tracing)
  • Moved ReplicaId from mz-cluster-client
  • Moved StorageInstanceId from mz-storage-types
  • Moved ComputeReplicaLogging from mz-compute-types
  • Added DatabaseId, SchemaId, ResolvedDatabaseSpecifier, SchemaSpecifier
  • Removed mz-compute-types, mz-controller-types, mz-storage-types dependencies from mz-catalog-protos

Remaining work to remove mz-repr and mz-sql dependencies:

  • The types in mz-sql use PlanError for FromStr::Err, while mz-catalog-types uses anyhow::Error
  • May need to create mz-sql-types crate for PlanError to unify the error types
  • Additional types from mz-repr and mz-sql need to be moved

Test plan

  • cargo check -p mz-catalog-types
  • cargo check -p mz-catalog-protos
  • cargo check -p mz-cluster-client
  • cargo check -p mz-storage-types
  • cargo check -p mz-compute-types

🤖 Generated with Claude Code

antiguru and others added 9 commits February 6, 2026 07:16
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant