Drizzle TeamDT
Drizzle Team3w ago
1 reply
mael

Timestamptz serialization/deserialization

I think I have a timestamp serialization issue... I want to do pagination using a cursor, and sort by some timestamp, and for exact timestamp match, sort by id

then the cursor becomes cursor={last_item_timestmap, last_item_id}

but when I get out the timestamp in Drizzle, it becomes a Javascript Date and I think the precision is lower, so then when I send it back to the database to get the next page, it rounds it incorrectly, and I don't get the expected results

is there a way to serialize/deserialize a Postgres timestamptz exactly as a js object?
Was this page helpful?