SQLite: timestamp vs timestamp_ms modes
#1007
|
What's the difference between The SQLite column types docs mention there's multiple modes for integers with the following example: 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' }) // DateMy assumption is the following:
|
Replies: 3 comments 1 reply
|
Since there is no built-in date format in SQLite, we need to choose the format in which the date is stored in the DB. |
|
How would we modify our |

Since there is no built-in date format in SQLite, we need to choose the format in which the date is stored in the DB.
timestamp_msstores and operates with the date as a number of milliseconds.timestampuses seconds instead. So if you want to have milliseconds precision, or if you already have the date stored as milliseconds in the DB, you should choosetimestamp_ms.