Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks query when CTE is present #296

Open
trsdln opened this issue Oct 20, 2022 · 1 comment
Open

Breaks query when CTE is present #296

trsdln opened this issue Oct 20, 2022 · 1 comment

Comments

@trsdln
Copy link

trsdln commented Oct 20, 2022

Input query:

some_cte as (select a from test_table)
select
  my_fn ((select * from some_cte1))
from
  test_table;

Expected output query:

some_cte as (
  select
    a
  from
    test_table
)
select
  my_fn ((
    select
      *
    from some_cte1))
from
  test_table;

Actual output query:

some_cte as (
  select
    a
  from
    test_table
)
select
  my_fn (
    select
      *
    from some_cte1)
from
  test_table;

Removing one pair of round brackets breaks the query.

pgformatter version: 5.3

@darold
Copy link
Owner

darold commented Oct 20, 2022

Right, most of the remaining open issue on pgFormatter are about CTE formatting. Unfortunately fixing them require a huge work in pgFormatter code so it require lot of time. That sadly, I don't have for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants