How to add a raw PostgreSQL function to a query builder join in TypeORM?

Viewed 192

I am using TypeORM on a NestJS service written in TypeScript.

I am trying to use PostgreSQL's jsonb_each function as a table in a join to create a query similar to this: select * from customers c left join jsonb_each(c.some_json_column) as d

When I put jsonb_each(c.some_json_column) in TypeORM's leftJoin function, TypeORM wraps it with double quotes, which forces PostgreSQL to think that I am trying to access a table named jsonb_each(c.some_json_column) and PostgreSQL throws an error.

How can I force TypeORM to use jsonb_each(c.some_json_column) as a raw value in the leftJoin function, and not wrappiwrapg it with double-quotes?

0 Answers
Related