cal
Explore posts from serversDTDrizzle Team
•Created by cal on 1/13/2024 in #help
Changing a column name completely breaks the queries
I went back and forth multiple times now and this is really weird.
So when using the following schema and queries everything works as expected:
Upsert query
Reset query
when changing
updated_at
to completed_at
while keeping everything else the same, I am getting the following error:
If I revert back to updatedAt and push the schema again, everything works fine...
What am I missing here?1 replies
DTDrizzle Team
•Created by cal on 10/25/2023 in #help
`sql.join` with `ODER BY` leads to syntax error while the sql query seems correct.
I am conditionally sorting the results from a database query
The query builder returns the following query
Which seems to be correct. When executing the code I get the following
PostgresError
:
Something seems to be off with 'desc'
but I don't have a clue what is causing this.
Any help is appreciated6 replies
DTDrizzle Team
•Created by cal on 8/20/2023 in #help
findMany without additional options
When using
const results = await db.query.habits.findMany()
in my project, results
is []
.
If add any option like
I get all habits in the table. Normally findMany()
should be enough, shouldn't it?
https://orm.drizzle.team/docs/rqb#find-many6 replies
DTDrizzle Team
•Created by cal on 7/24/2023 in #help
How do I define a composite foreign key?
Similar to this syntax in prisma?
I saw the section about composite primary keys but I didn't find anything about composite foreign keys.
Thank you in advance
9 replies
TTCTheo's Typesafe Cult
•Created by cal on 7/9/2023 in #questions
Handle custom error class in error UI boundary
Hey guys,
I am throwing a custom error
in a subpage. I then try to handle it using a error UI boundary. Everything works as expected but inside of
error.tsx
is always false. I assume nextjs internally handles/wraps the error. Is there a way to get a hold of the thrown error directly in order to display different UI in case of an GQLError?
Thank you in advance2 replies
TTCTheo's Typesafe Cult
•Created by cal on 6/28/2023 in #questions
Where would I initialize a 3rd party API to use in TRPC routes?
I am currently initializing this client in
server/client.ts
similar to the global definition of prisma. I then import client
in my TRPC router. Does this make sense or would it be smarter to do that somewhere else.
Best reards and thank you in advance 🙂1 replies