Skip to content

Create query builder with "with" clause in Postgres #5149

Closed

Description

@dennbagas

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?

Activity

  1. Ginden commented on Dec 4, 2019

    @Ginden
    Contributor

    Duplicate of #1116

  2. fullofcaffeine commented on Mar 14, 2020

    @fullofcaffeine

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

  3. imnotjames commented on Oct 10, 2020

    @imnotjames
    Contributor

    Duplicate of #1116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions