drizzle-team / drizzle-team/drizzle-orm
[BUG]: .default() method accepts Date object but should only accept SQL
- 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.1
### What version of `drizzle-kit` are you using?
0.20.6
### Describe the Bug
This relates to https://github.com/drizzle-team/drizzle-orm/issues/1105#issuecomment-1879238290.
When using an integer column in timestamp mode, the `.default` method accepts a type of `SQL | Date`. It should only accept `SQL`.
A consequence of this is that developers who try to generate migrations using a `Date` object will end up with a script that does not execute.
See screenshot of function argument type annotation:
### Expected behavior
The function argument type should only be `SQL`
### Environment & setup
Tested on NodeJS 20
Contributor guide
Assessment
This issue has not been assessed yet.