Repository navigation
fix(db): export Drizzle's SQL, SQLWrapper, AnyColumn, and BatchItem types from void/db - #791
Merged
cpojer merged 1 commit intoNov 11, 2026
Conversation
…ypes from void/db Closes voidzero-dev#790 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
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.
Closes #790
Summary
The database API reference says
void/dbre-exports Drizzle's operators "so you never need to depend ondrizzle-ormdirectly". That stops being true once part of a query moves into a helper, because the only Drizzle typevoid/dbexported wasDrizzleD1Database.packages/void/src/runtime/db.ts: re-exporttype AnyColumn,type SQL,type SQLWrapperfromdrizzle-ormandtype BatchItemfromdrizzle-orm/batch. They are type-only, so the virtualvoid/dbmodules don't change.packages/void/src/codegen/db-types.ts: the generated.void/db.d.tsreplacesvoid/db's types through a tsconfigpathsredirect, so it also re-exports these types fromvoid/_dbfor every dialect. Without this, apps that have runvoid preparewould still not see them.docs/reference/api/database.md: a note under Query Operators with an example.BatchItem[]as written in the issue doesn't type-check against D1'sdb.batch(): the bareBatchItemcovers every Drizzle dialect, andbatch()takes a non-empty tuple. The docs example usesBatchItem<'sqlite'>in a non-empty tuple instead.Verification
test/unit/db-types.typecheck.tscovers the helper and batch patterns from the issue. I confirmedtscchecks the file.plugin-drizzle.test.ts: asserts that the generateddb.d.tsexports the types for sqlite, postgresql, and mysql.packages/voidand confirmeddist/runtime/db.d.mtsexports all four types.vp run check: 33/33 passedvp test run: 792 files passed, 1 skipped🤖 Generated with Claude Code