imoby
DTDrizzle Team
•Created by imoby on 9/22/2023 in #help
Responses are coming back with Capitalized table names
When I run queries and joins, my table names are coming back with uppercase table names which breaks my models and UI that has existed with lowercase further down the chain. Any way to force everything to be lowercase?
For example:
2 replies
DTDrizzle Team
•Created by imoby on 9/21/2023 in #help
Help migrating a nested Prisma update
Been trying to set this up without going through the raw sql route for some time but cant seem to wrap my head around it. Basically the structure here is I have a Result that can optionally have an alert or a note. If an alert or note already exist then update them. Any help here is appreciated it! thank you
14 replies
DTDrizzle Team
•Created by imoby on 9/19/2023 in #help
Best practice on running migrations
I have a serverless framework setup and during my testing I've been using the db push but now that I have something setup to actually test my migrations I'd like to run:
whats the best path to actually running this from an npm script or from a ci for example. Or even locally without using push. Basically, I've generated my sql migrations but I now need to run them.
16 replies
DTDrizzle Team
•Created by imoby on 9/18/2023 in #help
Help migrating raw query from prisma to drizzle
Trying to get the below query which has multiple joins into drizzle. It's one of the last ones I have and I am not sure if I should go the route of query or select. Query didnt have or show any docs on joins. Whats the optimal way to do this and is it possible to do also the count in the same query or will that still have to be an extra or separate?
2 replies
DTDrizzle Team
•Created by imoby on 9/16/2023 in #help
Manually create migration file
Is it possible to manually create a migration file like the way prisma has it? basically just creating a sql file that is part of the migration but it does not get executed. I'm asking this because I want to create a migration file for a raw materialized view since views arent supported
13 replies
DTDrizzle Team
•Created by imoby on 9/12/2023 in #help
Unable to generate uuid as primary key
Hey everyone! I've searched through the help posts with similar titles but I could not get the answer I wanted. I have a prisma current setup, and trying to switch over, but my uuid is generated as my postgres primary key but I keep getting the following error:
I've tried all of the following:
and even the migration introspection tool set my id as this:
which definitely didnt work. Any ideas?
17 replies
DTDrizzle Team
•Created by imoby on 9/11/2023 in #help
Upsert create/update joined table similar to Prisma
Hey all, trying to get another one of my queries to migrate away from prisma. This one is a bit more complex. Trying to see if I am able to take a joined table and either update it or create it. Prisma has this as a nested option but I couldnt figure out how to solve this with drizzle. In the example below, I have a
store
that I want to update its joined table shelf
or create it if its not there
4 replies
DTDrizzle Team
•Created by imoby on 9/10/2023 in #help
Similar building of where clause to Prisma
I'm trying to migrate my prisma queries to drizzle but one thing I'm trying to do is convert the following. I'm lost on how best to 'build' a where clause similar to what prisma has depending on what properties I have passed into my function:
3 replies