drizzle-team / drizzle-team/drizzle-orm
[BUG]: value.getTime is not a function
- 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.30.10
### What version of `drizzle-kit` are you using?
0.21.2
### Describe the Bug
### Bug Report: Error when using time-related queries
#### Description
When attempting to use time-related queries with `drizzle-kit`, I encounter an error. Specifically, the error occurs when trying to fetch records from the `visits` table where the `createdAt` timestamp is greater than or equal to the current time.
#### Code Snippets
Here is the code that produces the error:
```ts
const visits = await db.query.visits.findMany({
where: gte(tables.visits.createdAt, Date.now()),
})
```
Schema definition for the `visits` table:
```javascript
export const visits = sqliteTable('visits', {
id: integer('id').primaryKey({ autoIncrement: true }),
// ....
createdAt: integer('created_at', { mode: 'timestamp' }).notNull().default(new Date().getTime()),
})
```
#### Error Message
```
Error: value.getTime is not a function
```
### Expected behavior
_No response_
### Environment & setup
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.