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. Thanks
1 Reply
DaR
DaROP7mo ago
By the way, I'm using the following version: drizzle-orm: v0.30.10 typescript: 5.4.5 typeorm: 0.3.20 I found a workaround, which is to switch the db driver to postgres for drizzle, such it won't conflict with the one used by TypeORM (pg). Problems solved, tks
Want results from more Discord servers?
Add your server