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


My assumption is the following:

  • timestamp_ms: Stores the timestamp including the milliseconds. Same precision as Date.now(). Equivalent to TIMESTAMP in MySQL.
  • 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
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-...
Was this page helpful?