lorentz
Using AsyncLocalStorage to Propagate Transaction Context
yeah, alright π¦ thanks for responding, and thank you for an amazing library.
our broader problem is that we accumulated a substantial collection of queries that we combine in various ways as subqueries, which works really really well so far. it's working better than any other db lib ive worked with β
the only issue now is that we have an increasing need to wrap queries in transactions, and the code change to transform all queries to functions taking an optional transaction would be significant. so far those are the only two options i've thought of:
1. wrapping in functions with optional transaction argument
2. use AsyncLocalStorage
are there any other approaches to this problem im not thinking of?
9 replies
how to union two queries with json_build_object?
ok i think i have something https://kyse.link/xpMTf. perhaps not ideal, but works. thank you very much for the help!
10 replies
how to union two queries with json_build_object?
ah ok! π so this in full https://kyse.link/CtZGS. now i realize what i need is really a discriminated union type though, so something closer to this https://kyse.link/4Zw87. the result gets the correct type now
but then back to
Types of property 'details' are incompatible.
where union
is not happy. is there any way to just convince the union that all is good? π don't mind explicitly casting anything at this point10 replies
how to decode a point to `{x: number, y: number}` when selected inside `jsonBuildObject`?
ah ok, thanks! in my case the point column is nullable, making it more complicated i guess π€ if i were to do it in js-land instead, is a plugin with
transformResult
a reasonable approach?12 replies