drizzle-team / drizzle-team/drizzle-orm

[BUG]: createSelectSchema infers wrong branded type for tables

Open
#4,598 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [x] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

0.44.1

### What version of `drizzle-kit` are you using?

0.31.1

### Other packages

drizzle-zod@0.8.2

### Describe the Bug

You can see the type-check fail in this update PR https://github.com/gnosisguild/zodiac-pilot/pull/1679

I'm trying to infer types from tables, and also refine the types for certain columns. However, it seems like `drizzle-zod` tries to match against a `View` type instead of the `Table` type, and then the type-check fails. I've had another look at the docs but can't spot a place where I'm using the tooling wrong. That's why I'm opening up a bug report.

Feel free to get back to me if you need more information.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.