typeorm icon indicating copy to clipboard operation
typeorm copied to clipboard

Create query builder with "with" clause in Postgres

Open dennbagas opened this issue 7 years ago • 3 comments

Issue type:

[*] question [ ] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [*] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo

TypeORM version:

[*] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

I have raw query like this:

WITH w AS (UPDATE foo SET foo_type = 'WOW' WHERE foo_uuid = 17 RETURNING "foo_uuid", "foo_paired_to", "foo_type")
SELECT bar.name, w.foo_uuid, w.foo_type
FROM bar, w
WHERE bar.id = w.foo_paired_to;

How to convert that into a query builder with typeorm?

dennbagas avatar Nov 27 '19 08:11 dennbagas

Duplicate of #1116

Ginden avatar Dec 04 '19 16:12 Ginden

I'm also looking into how to use with (recursive) with the QueryBuilder.

fullofcaffeine avatar Mar 14 '20 00:03 fullofcaffeine

Duplicate of #1116

imnotjames avatar Oct 10 '20 12:10 imnotjames