© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
6 replies
nickmazuk

SQLite: timestamp vs timestamp_ms modes

The SQLite column types docs mention there's multiple modes for integers.

What's the difference between timestamp_ms and timestamp modes?

import { integer, sqliteTable } from "drizzle-orm/sqlite-core";
 
// you can customize integer mode to be timestamp, timestamp_ms
integer('id', { mode: 'timestamp_ms' })
integer('id', { mode: 'timestamp' }) // Date
import { integer, sqliteTable } from "drizzle-orm/sqlite-core";
 
// you can customize integer mode to be timestamp, timestamp_ms
integer('id', { mode: 'timestamp_ms' })
integer('id', { mode: 'timestamp' }) // Date


My assumption is the following:

-
timestamp_ms
timestamp_ms
: Stores the timestamp including the milliseconds. Same precision as Date.now(). Equivalent to TIMESTAMP in MySQL.
-
timestamp
timestamp
: Stores the date only. Same precision as 2023-08-09. Equivalent to DATE in MySQL.

https://github.com/drizzle-team/drizzle-orm/discussions/1007
GitHub
SQLite: `timestamp` vs `timestamp_ms` modes · drizzle-team drizzle-...
The SQLite column types docs mention there's multiple modes for integers. What's the difference between timestamp_ms and timestamp modes? import { integer, sqliteTable } from "drizzle-...
SQLite: `timestamp` vs `timestamp_ms` modes · drizzle-team drizzle-...
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to set a default timestamp_ms for sqlite
Drizzle TeamDTDrizzle Team / help
3y ago
SQLite auto-update timestamp
Drizzle TeamDTDrizzle Team / help
10mo ago
Can `integer('done_at', { mode: 'timestamp_ms' })` not be null? (SQLite, Bun)
Drizzle TeamDTDrizzle Team / help
2y ago
Issue with CURRENT_TIMESTAMP bun:sqlite
Drizzle TeamDTDrizzle Team / help
2y ago