Ramazan
Explore posts from servers`useSuspenseQuery` still runs a fetch on SSR even when setting `ssr: false` in the api config
Beside double-fetching, this causes issues during rendering if you have auth on your routes as the SSR server doesn't seem to pass through the cookies to the tRPC route.
Using Next.js 14.0.3 with the pages directory.
Repro here: https://github.com/relsunkaev/trpc-ssr-suspense-repro
3 replies
DTDrizzle Team
•Created by Ramazan on 9/20/2023 in #help
Prepend raw fields with table/subquery name in rendered SQL
Currently, it doesn't seem like raw fields in a select statement hold any information on the table/subquery they're used in. This results in subsequent usage of these fields elsewhere rendering to SQL as
"field_name"
instead of "alias"."field_name"
.
This actually causes issues when you have overlapping field names in sql in your joins.
Example:
will result in an error
with the following workaround
This behavior persists through subsequent subqueries where
will result in a similar error due to the ambiguity between someTable.date
and sq2.balanceDate
.6 replies
Server-side error tracing with Datadog
Hey, has anyone had any luck setting up tracing with tRPC? Specifically with
dd-trace-js
.
We’re using Datadog and because tRPC handles all errors internally, the tracer doesn’t actually get access to the stack trace. Likewise, it stops creating spans before hitting the tRPC route and only resumes if any library underneath is instrumented.5 replies
DTDrizzle Team
•Created by Ramazan on 8/7/2023 in #help
Cast columns in relations
A great feature of drizzle's relational queries is that they don't actually require a foreign key, which provides a great amount of flexibility in querying your data. However, it doesn't seem like there is currently a way to cast the fields so that their types match.
Something along the lines of
where an action's
ownerId
is text
so that it can refer to multiple different owner types regardless of their primary key type.2 replies
DTDrizzle Team
•Created by Ramazan on 7/19/2023 in #help
Update existing schema when introspecting db
Is it possible to update an existing schema using introspection? Currently, drizzle-kit just wipes any changes I make to the schema (relations, renaming, etc.).
7 replies
DTDrizzle Team
•Created by Ramazan on 5/31/2023 in #help
Prepared Stements
I was looking into using AWS RDS Proxy with Prisma and ran into this
https://www.prisma.io/docs/guides/deployment/deployment-guides/caveats-when-deploying-to-aws-platforms#aws-rds-proxy
I was wondering does DrizzleORM use prepared statements for everything like Prisma does? Would I run into the same issue if I switched to Drizzle?
2 replies
TTCTheo's Typesafe Cult
•Created by Ramazan on 2/21/2023 in #questions
Aurora Serverless V2?
I’m currently looking into using this for a Postgres db and Prisma. Does anyone have experience with this? Would you recommend it? I’ve heard a lot of bad things about V1, but also heard V2 is way better.
1 replies
TTCTheo's Typesafe Cult
•Created by Ramazan on 2/7/2023 in #questions
Saving filter state to query params
Does anyone have any experience using Geschichte with nextjs? I need to save the filter state to query params but it seems kind of overkill plus throws an erroneous type error. Should I just use Zustand and write my own simple persistence store?
https://github.com/BowlingX/geschichte
1 replies
TTCTheo's Typesafe Cult
•Created by Ramazan on 2/1/2023 in #questions
`getServerSideProps` fails silently and returns 404
I’m currently tinkering with something and noticed that when an exception is thrown in
getServerSideProps
, the page just returns a 404 with nothing logged in either console. Is there a way to make it not fail silently and log the error? (I’ve tried putting it in a try catch block)5 replies