Skip to content

fix(effect-drizzle): declare query type variance - #41004

Open
zcxGGmu wants to merge 1 commit into
anomalyco:devfrom
zcxGGmu:effect-variance
Open

fix(effect-drizzle): declare query type variance#41004
zcxGGmu wants to merge 1 commit into
anomalyco:devfrom
zcxGGmu:effect-variance

Conversation

@zcxGGmu

@zcxGGmu zcxGGmu commented Aug 7, 2026

Copy link
Copy Markdown

Issue for this PR

Refs #40890

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds explicit TypeScript variance annotations to the safe generic parameters on the Effect Drizzle session/select-builder types that showed up in the compiler variance trace.

SQLiteEffectSession now declares covariance for TRunResult and TRelations while preserving invariance for TEffectHKT. SQLiteEffectSelectBuilder now declares covariance for TRunResult and invariance for TEffectHKT / TBuilderMode.

I intentionally left TSelection inferred because explicit annotations for it break the existing select overload relationships during typecheck.

How did you verify your code works?

  • cd packages/effect-drizzle-sqlite && bun run typecheck
  • cd packages/effect-drizzle-sqlite && bun test --timeout 30000
  • bunx oxlint packages/effect-drizzle-sqlite/src/sqlite-core/effect/select.ts packages/effect-drizzle-sqlite/src/sqlite-core/effect/session.ts
  • git diff --check

Screenshots / recordings

N/A; this is a type-level performance cleanup.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants