indents(sql): initial support (#4857)

* indents(sql): initial support

* indents(sql): fix queries and lua style
This commit is contained in:
Matthias Q 2023-05-25 07:53:14 +02:00 committed by GitHub
parent 9bef726044
commit dae928b3bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,8 @@
select
case
when a = 1 then '1'
when a = 2 then '2'
when a = 3 then '3'
else '0'
end as stmt1
from tab;

View file

@ -0,0 +1,3 @@
begin
create table foo (bar int);
end;

View file

@ -0,0 +1,4 @@
create table my_table (
id bigint,
date date
);

7
tests/indent/sql/cte.sql Normal file
View file

@ -0,0 +1,7 @@
with data as (
select
a,
b
from tab
)
select * from data;

View file

@ -0,0 +1,5 @@
insert into mytable
(column1, column2)
values
('john', 123),
('jane', 124);

View file

@ -0,0 +1,4 @@
select
a,
b
from tab;

View file

@ -0,0 +1,9 @@
select
id
from foo
where id < (
select
id
from bar
limit 1
);