Effect CommunityEC
Effect Community11mo ago
2 replies
Kristian Notari

Handling Date and Timestamp Data Types with Effect in TypeScript

Haven't tried sql packages from effect yet but, and I'd like to, but there's something bugging me in my current codebases and I'd like to be reassured there's something to help with that, that is: the difference between a date and a timestamp(tz) datatypes, coming and going from database to js code.

90% bugs in my data flows are due to datetime issues, where I move around dates or timestamp(tz)s as Date objects, not knowing from which kind of datatypes they originated to, and writing them as Date objects to the db works flawlessly due to truncation at the db level. So you get bugs in js and bugged data into your db.

Is there a way to make the distinction clearer and solve those bugs using effect packages?
Was this page helpful?