IstoraMandiri
IstoraMandiri
DTDrizzle Team
Created by IstoraMandiri on 9/3/2023 in #help
Schema Definition Performance / Best Practice
Is it considered bad practice to have one massive client / schema definition for my whole project that is imported everywhere, or should I be creating a client with small smaller sub-schemas for each module? are there any significiant performance benefits to the latter? My project has about 20 tables with relations and am running into performance problems in my development environment (nextjs takes a long time to build routes in dev mode). Is splitting out multiple smaller schemas something that is likely to help much? EDIT: Performace seems to be a nextjs issue rather than drizzle, sorry.
2 replies
DTDrizzle Team
Created by IstoraMandiri on 8/24/2023 in #help
Sub-field Filtering example
In the 0.28.0 update that removed relation filters, the changelog suggests: https://github.com/drizzle-team/drizzle-orm/releases/tag/0.28.0
If you have used those fields in the where callback before, there are several workarounds: 1. Applying those filters manually on the code level after the rows are fetched; 2. Using the core API.
I'd rather not apply the filter in the code level. Could someone provide an example of "2. Using the core API." to achieve a basic top level filter based on a sub-field property?
3 replies