value.getTime is not a function

this code in this basic repo

https://github.com/quantuminformation/drizzle-sqlite-recurring-events


when running pnpm run db:seed gives error
//https://github.com/quantuminformation/drizzle-sqlite-recurring-events/blob/main/db/seed.ts
const events = await db
    .insert(schema.event)
    .values([
        {
            name: 'Event 1',
            startTime: new Date(2025, 1, 1, 19, 0, 0).getTime(),
            endTime: new Date(2025, 1, 1, 20, 0, 0).getTime(),
        },
    ])
    .returning()

TypeError: value.getTime is not a function
    at SQLiteTimestamp.mapToDriverValue (/Users/nikos/WebstormProjects/drizzle-sqlite-recurring-events/node_modules/.pnpm/drizzle-orm@0.29.1_better-sqlite3@9.2.2/node_modules/src/sqlite-core/columns/integer.ts:150:22)

you can see that getTime works when debugging in vscode so I don't know where this error originates
GitHub
Contribute to quantuminformation/drizzle-sqlite-recurring-events development by creating an account on GitHub.
Was this page helpful?