iolyd
DTDrizzle Team
•Created by iolyd on 6/6/2024 in #help
Drizzle-zod errors
What is supposed to be the highest version of
drizzle-orm
supported by drizzle-zod
's latest release? I'm facing a breaking error when defining validation schemas using createInsertSchema
with drizzle-orm@latest
and it persists even when trying to regress all the way to @0.30.9
, where I stopped trying older versions.
4 replies
DTDrizzle Team
•Created by iolyd on 1/20/2024 in #help
Less verbose generic types for helper functions
Trying to implement various helper functions to join or filter data, I keep facing the need to add quite verbose generic types whenever I want to handle subqueries and/or selections alongside tables. Are there type helpers I'm unaware of that could make things a bit more straightforward? Here's an example illustrating what I mean:
I could implement some type helpers of my own, but was wondering if anything was already included in
drizzle-orm
10 replies
DTDrizzle Team
•Created by iolyd on 11/23/2023 in #help
Malformed migration file
For some reason, when running migrations on the latest versions of
drizzle-kit
and drizzle-orm
, it fails with data is malformed
on most of my previous migrations' metadata:
The logs are pretty bare, is there a way to get more detail? I updated both orm
and kit
and changed a few things across my app's types and queries (spanning multiple commits) before trying to run a migration so going back to the previous versions is not really an option as it would imply undoing all that :/5 replies
DTDrizzle Team
•Created by iolyd on 11/2/2023 in #help
Get subquery columns in a way similar to `getTableColumns`
Keeping track manually of all subquery fields can quickly become annoying, and I'm looking for a simple helper to allow specifying fields with a pattern similar to what
getTableColumns
enables. Has anyone implemented a small helper that's somewhat "battle-tested"? Here's what I have at the moment, but I'm not trusting it that much due to how naive it is and due to the necessary typecasting.
12 replies
DTDrizzle Team
•Created by iolyd on 10/19/2023 in #help
Typing a helper function parameter to be a table with required column(s)
I'm having a hard time typing some helper functions where I need some params to accept any table as long as it implements certain required columns (key and type). Here's what i'm aiming for:
Anyone have experience with this?
11 replies
DTDrizzle Team
•Created by iolyd on 9/19/2023 in #help
Json object aggregate
In a multilingual app, I am using relational queries (but I could also just work with normal
select
s) to retrieve rows and their related translation strings. My schema has a bunch of tables like so:
I'm looking for a query that would return the data formatted as:
but I'm struggling to get anything else than:
18 replies
DTDrizzle Team
•Created by iolyd on 8/30/2023 in #help
Select as db column names instead of js property names
Is there a helper to make select queries that return db column names, i.e. snake-cased instead of the camelCased schema names? I figure I can implement pretty easily, just wanted to know if there's already something provided by drizzle?
3 replies