How to set timestamp for `created_at` in Drizzle on SQLite?

Stack Overflow
How to have an automatic timestamp in SQLite?
I have an SQLite database, version 3 and I am using C# to create an application that uses this database. I want to use a timestamp field in a table for concurrency, but I notice that when I insert ...
1 Reply
Startup Spells 🪄 Newsletter Guy
Alright, thought of using Sourcegraph with drizzle-orm/sqlite-core AND createdAt query -> https://sourcegraph.com/search?q=drizzle-orm%2Fsqlite-core+AND+createdAt&patternType=standard&sm=0 Found the solution:
createdAt: integer("created_at", { mode: "timestamp" }).default(
sql`(strftime('%s', 'now'))`
),
createdAt: integer("created_at", { mode: "timestamp" }).default(
sql`(strftime('%s', 'now'))`
),
drizzle-orm/sqlite-core … - Sourcegraph
Sourcegraph is a web-based code search and navigation tool for dev teams. Search, navigate, and review code. Find answers.
Want results from more Discord servers?
Add your server