Skip to content

test(drizzle): restore typed mysql2 dispatch - #9560

Merged
proggeramlug merged 1 commit into
mainfrom
fix/9516-drizzle-typed-dispatch
Sep 2, 2026
Merged

test(drizzle): restore typed mysql2 dispatch#9560
proggeramlug merged 1 commit into
mainfrom
fix/9516-drizzle-typed-dispatch

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the any escape hatches from the existing Drizzle/MySQL2 transaction fixture
  • exercise both db.execute and the transaction callback through Drizzle's inferred MySql2Database<TSchema> & { $client: ... } type
  • retain regression coverage for the typed dispatch failure now fixed on main by the dispatch/rooting changes

Closes #9516.

Testing

  • bash tests/release/packages/drizzle-mysql2-tx/fixture.sh with the configured MySQL test credentials (PASS drizzle-mysql2-tx, 400 transactions, 1 MB nursery)
  • cargo fmt --all --check
  • ./scripts/test_affected_crates.sh --base origin/main --dry-run

./scripts/pre-tag-check.sh --quick passes its other checks but currently reports the existing local-binding allowlist mismatch in untouched code (dispatch_receiver_class.rs versus dynamic_dispatch.rs).

No version bump.

Summary by CodeRabbit

  • Tests
    • Improved test fixture type safety by preserving inferred database and transaction types.
    • Added documentation for garbage-collection configuration and database type inference.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: d6903efd-c26a-45e1-bc48-acac29218808

📥 Commits

Reviewing files that changed from the base of the PR and between 7bb834e and 64664f4.

📒 Files selected for processing (1)
  • tests/release/packages/drizzle-mysql2-tx/entry.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Drizzle MySQL2 release fixture documents GC-scavenge and typed dispatch coverage. It removes explicit any annotations from the database instance and transaction callback so Drizzle supplies the inferred types.

Changes

Drizzle MySQL2 typed fixture

Layer / File(s) Summary
Preserve inferred database and transaction types
tests/release/packages/drizzle-mysql2-tx/entry.ts
The fixture documents typed MySql2Database dispatch coverage and uses inferred types for the database and transaction callback.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 64664

This change restores typed MySQL2 dispatch coverage in an existing test fixture without changing production behavior, interfaces, or deployment configuration. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: restoring typed MySQL2 dispatch coverage in the Drizzle test fixture.
Description check ✅ Passed The description provides the change summary, issue reference, test commands, known pre-tag-check limitation, and version-bump status. It omits some template headings, but the required information is s…
Linked Issues check ✅ Passed The changes satisfy issue #9516 by removing any annotations and adding regression coverage for typed db.execute and db.transaction calls using Drizzle's inferred intersection type.
Out of Scope Changes check ✅ Passed The changes are limited to the Drizzle MySQL2 transaction fixture and directly support the linked issue's typed-dispatch regression coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Description check

Explanation

The description provides the change summary, issue reference, test commands, known pre-tag-check limitation, and version-bump status. It omits some template headings, but the required information is substantially present.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/9516-drizzle-typed-dispatch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit 530f08b into main Sep 2, 2026
17 of 20 checks passed
@proggeramlug
proggeramlug deleted the fix/9516-drizzle-typed-dispatch branch September 2, 2026 19:15
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.

drizzle: statically typed db.execute / db.transaction throws "Cannot convert undefined or null to object" on main (0.5.1519 ok; db: any ok)

1 participant