Theo Gravity
Explore posts from serversHow to use the errorFormatter when using an adapter?
The example here uses
context.create()
, which isn't something you do when using an adapter.
I don't see an errorFormatter
exposed in createExpressMiddleware()
https://trpc.io/docs/server/error-formatting4 replies
How do I log thrown errors from the query/ mutation on the server side globally?
I was surprised to find that the server servicing tRPC requests do not log any thrown errors from a query / mutation to the console by default (but the client does capture errors). I want to be able to log all errors on the server side. How would I do this?
This page doesn't really give me any clues as I don't know what
trpcNext.createNextApiHandler
refers to:
https://trpc.io/docs/server/error-handling#handling-errors
I am using the express adapter with tRPC. I do not want to have to attach an error handling function to each query / mutation I define.9 replies
How to translate the WITH keyword in postgres when SELECT does not have FROM?
I'm trying to translate the following postgres function into pure Kysley:
I'm able to translate the main select body:
But I'm not sure how to translate the WITH part:
9 replies
Using Postgres function in an insert with a field as a select
I'm trying to translate the following SQL:
to:
It doesn't seem to like
[document.text_content, '. ']
and where('sentence')
. It seems the array value has to be a ReferenceExpression
type, but the documentation isn't very clear on what that is.20 replies
How to insert JSONB types in postgres?
I've looked at https://kysely-org.github.io/kysely/classes/InsertQueryBuilder.html#values and it's not very clear how I'd apply JSON to that column type when inserting. Do I need to create some sort of special helper like in: https://github.com/kysely-org/kysely/blob/master/site/docs/recipes/extending-kysely.md
Also for the interface, do we define the field as a
Record
type? What if the field is optional?12 replies