IgnisMurasaki
DTDrizzle Team
•Created by IgnisMurasaki on 9/12/2024 in #help
Drizzle failed to parse an empty JSONB Array
so I have a query that calls
ARRAY_AGG()
function and the result of query returned the aggregated value
since the aggregated column is a JSONB this results in Array of JSONB, but some of the row may return an empty json,
this is the query for the selector
however due to the particular empty array i got an error SyntaxError: Unexpected token N in JSON at position 0
, I was able to confirm this by adding a limit(1)
to the query
by limiting the query which only return 1 row
the query was performed sucesfully1 replies
DTDrizzle Team
•Created by IgnisMurasaki on 8/13/2024 in #help
Setup drizzle using 'pg' instead of 'postgres' driver package
1 replies
DTDrizzle Team
•Created by IgnisMurasaki on 7/10/2024 in #help
A more modular way to combine predefined query into a single transaction
Hello currently I write my query into something like this
This function sometimes called separately, but there are times that I wanted to combine those query into a single transaction.
What I do right now is creating a whole new transaction query without reusing the query above something like
as you can see it's seems inefficient, since the query is the same with those 3 defined function, is there any way i can utilize it and use it into transaction ?
i suspect that i can use a QueryBuilder or something
a suggestion would be very much appreciated
3 replies
DTDrizzle Team
•Created by IgnisMurasaki on 3/26/2024 in #help
Magic SQL type parse into zod schema
wondering if it's possible to parse a value from the select using magic sql into a zod schema
to parse into validated object you need to call the
schema.parse()
function, however the magic sql only give typehints
it's not a big problem for a single query selector, but the thing is that actually i'm using it to aggregate an array1 replies
DTDrizzle Team
•Created by IgnisMurasaki on 3/18/2024 in #help
having trouble to include relations with query function
how do you exactly use the
with
field in the query options to include relations ?, my functions always returned referencedTable
error
my relation is declared like the following
and here's the query
i've also tried to change the with
object to {users:true}
but still receiving the referencedTable
error5 replies
DTDrizzle Team
•Created by IgnisMurasaki on 3/13/2024 in #help
conditional select return wrong type
so I've tried using conditional select query, so that i'm able to reuse my query syntax without repeating to get the rows and the count, I'm not sure where I'm wrong at be when I do this the registereeResult would return this object instead
3 replies