drizzle-team / drizzle-team/drizzle-orm

[BUG]: Types do not show up properly if you put $type before array

Open
#1,748 4 comments 0 reactions 0 assignees View on GitHub
bug bug/fixed-in-beta db/postgres priority
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

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

0.29.2

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

0.20.9

### Describe the Bug

```ts
someField: jsonb('someField')
.$type<{ test: string; }>()
.array()
```
Fetched postgres response shows that someField is an unknown type. If you put `.array()` before `.$type`, then it works as expected.

### Expected behavior

It should either return the correct type regardless of order, or show a type error if the order is incorrect.

### Environment & setup

_No response_

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.