Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

indention of named queries in WITH clause #186

@PhilippSalvisberg

Description

@PhilippSalvisberg

With the default formatter settings the following formatter input

with e as (select * from emp where deptno = 10) select *  from e;

produces this result:

with e as (
   select *
     from emp
    where deptno = 10
)
select *
  from e;

I think the named queres should be indented an additional level, something like this:

with 
   e as (
      select *
        from emp
       where deptno = 10
   )
select *
  from e; 

It should be possible to add a line break after the with keyword.

Here's a query that shows the wrong indentation:

with
   function f (
      in_value in number
   ) return number is
   begin
      return in_value;
   end;
e as (
   select f(empno) as empno,
          ename,
          deptno
     from emp
    where deptno = 10
)
select *
  from e;

Expected is a result like this:

with
   function f (
      in_value in number
   ) return number is
   begin
      return in_value;
   end;
   e as (
      select f(empno) as empno,
             ename,
             deptno
        from emp
       where deptno = 10
   )
select *
  from e;

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions