petja
DTDrizzle Team
•Created by petja on 8/16/2024 in #help
Is there more elegant way to infer enums?
This works:
type TransactionReason = (typeof transactionReasonEnum)['enumValues'][number]
But I wonder if Drizzle happen to have built-in way to infer TypeScript union from PostgreSQL enum.2 replies
DTDrizzle Team
•Created by petja on 4/2/2023 in #help
Mocking database
I want to mock the PostgreSQL database and access it with Drizzle ORM. I tried to write a TypeScript class that should work the same way as pg's Pool class, but instead of hitting an actual database, returns rows from an in-memory object. However when SELECT'ing from the table I had mocked, Drizzle returned an object with all keys having undefined values.
Any help? 🙂
Using the mock pool:
11 replies