SQLite Timestamp does not allow a default NULL value

As the title says,
updatedAt: integer("updated_at", { mode: "timestamp" })
.default(null)
.$onUpdateFn(() => new Date(new Date().toLocaleString("en-US", { timeZone: "Asia/Taipei" }))),
updatedAt: integer("updated_at", { mode: "timestamp" })
.default(null)
.$onUpdateFn(() => new Date(new Date().toLocaleString("en-US", { timeZone: "Asia/Taipei" }))),
Are there no workarounds for this? Here's the error I get: Argument of type 'null' is not assignable to parameter of type 'SQL<unknown> | Date'.
3 Replies
rphlmr ⚡
rphlmr ⚡3mo ago
The solution: sqlnull
boyo
boyo2mo ago
ohh nice! thanks!
Want results from more Discord servers?
Add your server