Skip to content

fix clippy on main#37042

Merged
sjwiesman merged 2 commits into
MaterializeInc:mainfrom
sjwiesman:fix-clippy-mz-deploy
Jun 15, 2026
Merged

fix clippy on main#37042
sjwiesman merged 2 commits into
MaterializeInc:mainfrom
sjwiesman:fix-clippy-mz-deploy

Conversation

@sjwiesman

Copy link
Copy Markdown
Contributor

Motivation

cargo clippy -p mz-deploy surfaced 7 clippy::disallowed_methods warnings. The crate was calling tokio_postgres query/execute methods directly, which clippy.toml disallows repo-wide in favor of the mz_postgres_util Sql wrappers — these force SQL through the validated Sql type rather than raw strings.

Changes

  • src/mz-deploy/Cargo.toml — add mz-postgres-util as a path dependency (single-line Cargo.lock change, no version bumps).
  • src/client/connection.rs — the five pass-through wrapper methods (execute, query_one, query, simple_query, batch_execute) now delegate to mz_postgres_util::*. Every call site passes string SQL (no prepared Statement), so the generic ToStatement bound is replaced with &str, wrapped via Sql::raw_unchecked — the sanctioned constructor for internally-assembled, already-trusted SQL.
  • src/client/deployment_ops.rs — the two raw Transaction calls (the SUBSCRIBE cursor execute and the FETCH ALL query) go through mz_postgres_util::execute/query; the static "FETCH ALL c" uses Sql::new.
  • src/client/errors.rs — add From<mz_postgres_util::PostgresError> for ConnectionError, mapping the Postgres variant back to ConnectionError::Query so the existing rich as_db_error() formatting is preserved.

Testing

No behavioral change; this is a lint-compliance refactor that preserves the existing public API and error formatting of the Client wrapper. cargo clippy -p mz-deploy --all-targets -- -D warnings now passes clean.

🤖 Generated with Claude Code

sjwiesman and others added 2 commits June 15, 2026 09:37
Route mz-deploy's database access through the mz_postgres_util Sql
wrappers instead of calling tokio_postgres methods directly, resolving
the clippy::disallowed_methods warnings that clippy.toml enforces
repo-wide.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sjwiesman sjwiesman enabled auto-merge (squash) June 15, 2026 14:52

@def- def- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Seth!

@sjwiesman sjwiesman merged commit 592cecb into MaterializeInc:main Jun 15, 2026
117 checks passed
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.

2 participants