Skip to content

[FORMATTING] Parenthesized query starting directly after CTE #687

Open
@karlhorky

Description

@karlhorky

Input data

Which SQL and options did you provide as input?

WITH a AS (
  SELECT * FROM items
)
(SELECT a.x FROM a) UNION (SELECT b.x FROM b);

Expected Output

WITH
  a AS (
    SELECT
      *
    FROM
      items
  )
(
  SELECT
    a.x
  FROM
    a
)
UNION
(
  SELECT
    b.x
  FROM
    b
);

Actual Output

Parenthesized SELECT a.x FROM a query follows directly after the CTE (and has an extra indent) instead of starting on position 0 of the next line.

WITH
  a AS (
    SELECT
      *
    FROM
      items
  ) (
    SELECT
      a.x
    FROM
      a
  )
UNION
(
  SELECT
    b.x
  FROM
    b
);

Usage

  • How are you calling / using the library? Demo website
  • What SQL language(s) does this apply to? PostgreSQL
  • Which SQL Formatter version are you using? 14.0.0

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