Custom postgres JSON_AGG function help
I want to create a function simmilar to
db.select
that for JsonAgg.
I also want to be able to do things like jsonAgg({...}).orderBy(...).filter(...).as(..)
In my sql queries to make it more like the rest of the ORM. (I need these orderBy and filters optionally, and I know I can just pass them in as arguments but i'm trying to keep the api similar to how the rest of drizzle would implement a feature like this.
I tried extending the SQL class function like this
The issue is I can't find a function I can actually override that will let me finish the builder pattern.
I know at this point I could just not override as
and not extend SQL
and add a build
function. I was just wondering if there was a way to do this without having to do that?0 Replies