DaR
DTDrizzle Team
•Created by DaR on 5/28/2024 in #help
Strange timestamp side-effect introduced to TypeORM when initialized drizzle db client
Hi all,
Recently I have migrated our db migration tool to use
drizzle-kit
and it's amazing. However, while working on the ORM migration from TypeORM to drizzle, I discovered a very strange side-effect that TypeORM timestampz
column stops transforming date string
to Date
object after initialized drizzle db client in the codebase.
For example, in TypeORM, createdAt
used to return a Date
object (2024-05-01T15:00:00.000Z
when doing console log), but after initialized drizzle db client, it becomes the raw string stored in the DB '2024-05-01 15:00:00+00'
.
Unfortunately, this is blocking us for fully migrating to drizzle. Currently I still need TypeORM and drizzleORM to co-exist since my codebase is pretty large.
I'm not sure whether this is a bug in drizzle-orm
, so I haven't create any issue yet and currently trying to seek for help and workarounds. It would be really appreciated if someone can share some knowledge about this side-effect. Thanks3 replies