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 ⚡4mo ago
The solution: sqlnull
boyo
boyoOP4mo ago
ohh nice! thanks!
Want results from more Discord servers?
Add your server