-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#15 Change default case format settings to lower
- Loading branch information
1 parent
43cd6ac
commit fbfe595
Showing
89 changed files
with
1,447 additions
and
1,447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 45 additions & 45 deletions
90
crates/uroborosql-fmt/testfiles/config_test/dst_default/case.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
SELECT | ||
ID AS ID | ||
, CASE | ||
WHEN | ||
GRADE_POINT >= 80 | ||
THEN | ||
select | ||
id as id | ||
, case | ||
when | ||
grade_point >= 80 | ||
then | ||
'A' | ||
WHEN | ||
GRADE_POINT < 80 | ||
AND GRADE_POINT >= 70 | ||
THEN | ||
when | ||
grade_point < 80 | ||
and grade_point >= 70 | ||
then | ||
'B' | ||
WHEN | ||
GRADE_POINT < 70 | ||
AND GRADE_POINT >= 60 | ||
THEN | ||
when | ||
grade_point < 70 | ||
and grade_point >= 60 | ||
then | ||
'C' | ||
ELSE | ||
else | ||
'D' | ||
END | ||
AS GRADE | ||
FROM | ||
RISYU | ||
WHERE | ||
SUBJECT_NUMBER = '005' | ||
end | ||
as grade | ||
from | ||
risyu | ||
where | ||
subject_number = '005' | ||
; | ||
SELECT | ||
ID AS ID | ||
, CASE | ||
GRADE | ||
WHEN | ||
select | ||
id as id | ||
, case | ||
grade | ||
when | ||
'A' | ||
THEN | ||
then | ||
5 | ||
WHEN | ||
when | ||
'B' | ||
THEN | ||
then | ||
4 | ||
WHEN | ||
when | ||
'C' | ||
THEN | ||
then | ||
3 | ||
ELSE | ||
else | ||
0 | ||
END | ||
AS P | ||
FROM | ||
RISYU | ||
WHERE | ||
SUBJECT_NUMBER = '006' | ||
end | ||
as p | ||
from | ||
risyu | ||
where | ||
subject_number = '006' | ||
; | ||
SELECT | ||
CASE | ||
/*param*/A -- simple case cond | ||
WHEN | ||
select | ||
case | ||
/*param*/a -- simple case cond | ||
when | ||
/*a*/'a' | ||
THEN | ||
then | ||
'A' | ||
ELSE | ||
else | ||
'B' | ||
END | ||
end |
12 changes: 6 additions & 6 deletions
12
crates/uroborosql-fmt/testfiles/config_test/dst_default/cast.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
SELECT | ||
CAST('2023-01-01' AS DATE) | ||
, CAST(100 AS CHAR(3)) | ||
, CAST((1 + 2) AS CHAR(1)) | ||
WHERE | ||
TEST = TEST | ||
select | ||
cast('2023-01-01' as date) | ||
, cast(100 as char(3)) | ||
, cast((1 + 2) as char(1)) | ||
where | ||
test = test |
10 changes: 5 additions & 5 deletions
10
crates/uroborosql-fmt/testfiles/config_test/dst_default/complement_as.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
SELECT | ||
IDENTIFIER AS ID | ||
, STUDENT_NAME AS STUDENT_NAME | ||
FROM | ||
JAPANESE_STUDENT_TABLE | ||
select | ||
identifier as id | ||
, student_name as student_name | ||
from | ||
japanese_student_table |
56 changes: 28 additions & 28 deletions
56
crates/uroborosql-fmt/testfiles/config_test/dst_default/join.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
SELECT | ||
select | ||
* | ||
FROM | ||
T1 | ||
INNER JOIN | ||
T2 | ||
ON | ||
T1.NUM = T2.NUM | ||
from | ||
t1 | ||
inner join | ||
t2 | ||
on | ||
t1.num = t2.num | ||
; | ||
SELECT | ||
select | ||
* | ||
FROM | ||
T1 | ||
LEFT OUTER JOIN | ||
T2 | ||
ON | ||
T1.NUM = T2.NUM | ||
from | ||
t1 | ||
left outer join | ||
t2 | ||
on | ||
t1.num = t2.num | ||
; | ||
SELECT | ||
select | ||
* | ||
FROM | ||
T1 | ||
RIGHT OUTER JOIN | ||
T2 | ||
ON | ||
T1.NUM = T2.NUM | ||
from | ||
t1 | ||
right outer join | ||
t2 | ||
on | ||
t1.num = t2.num | ||
; | ||
SELECT | ||
select | ||
* | ||
FROM | ||
T1 | ||
FULL OUTER JOIN | ||
T2 | ||
ON | ||
T1.NUM = T2.NUM | ||
from | ||
t1 | ||
full outer join | ||
t2 | ||
on | ||
t1.num = t2.num | ||
; |
68 changes: 34 additions & 34 deletions
68
crates/uroborosql-fmt/testfiles/config_test/dst_default/keyword.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
SELECT | ||
CASE | ||
WHEN | ||
A = 1 | ||
THEN | ||
select | ||
case | ||
when | ||
a = 1 | ||
then | ||
'one' | ||
ELSE | ||
else | ||
'other' | ||
END | ||
AS GRADE | ||
FROM | ||
STUDENT STD | ||
WHERE | ||
GRADE BETWEEN /*start1*/60 AND /*end1*/100 | ||
AND GRADE NOT BETWEEN /*start2*/70 AND /*end2*/80 | ||
end | ||
as grade | ||
from | ||
student std | ||
where | ||
grade between /*start1*/60 and /*end1*/100 | ||
and grade not between /*start2*/70 and /*end2*/80 | ||
; | ||
UPDATE | ||
WEATHER | ||
SET | ||
(TEMP_LO, TEMP_HI, PRCP) = (TEMP_LO + 1, TEMP_LO + 15, DEFAULT) | ||
WHERE | ||
CITY = 'San Francisco' | ||
update | ||
weather | ||
set | ||
(temp_lo, temp_hi, prcp) = (temp_lo + 1, temp_lo + 15, default) | ||
where | ||
city = 'San Francisco' | ||
; | ||
DELETE | ||
FROM | ||
PRODUCTS | ||
WHERE | ||
OBSOLETION_DATE = 'today' | ||
RETURNING | ||
delete | ||
from | ||
products | ||
where | ||
obsoletion_date = 'today' | ||
returning | ||
* | ||
; | ||
INSERT | ||
INTO | ||
DISTRIBUTORS | ||
insert | ||
into | ||
distributors | ||
( | ||
DID | ||
, DNAME | ||
) VALUES ( | ||
DEFAULT | ||
did | ||
, dname | ||
) values ( | ||
default | ||
, 'XYZ Widgets' | ||
) | ||
RETURNING | ||
DID | ||
returning | ||
did | ||
; |
60 changes: 30 additions & 30 deletions
60
crates/uroborosql-fmt/testfiles/config_test/dst_default/long_func.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
SELECT | ||
NORMAL_FUNC(COL1 + COL2, PARAM2) | ||
select | ||
normal_func(col1 + col2, param2) | ||
; | ||
SELECT | ||
MANY_ARGS_FUNC(PARAM1, PARAM2, PARAM3, PARAM4) | ||
select | ||
many_args_func(param1, param2, param3, param4) | ||
; | ||
SELECT | ||
LONG_ARGS_FUNC( | ||
COL1 + LONGLONGLONGLONGLONGLONGLONG | ||
, PARAM2 | ||
select | ||
long_args_func( | ||
col1 + longlonglonglonglonglonglong | ||
, param2 | ||
) | ||
; | ||
SELECT | ||
LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG_FUNC( | ||
PARAM1 | ||
, PARAM2 | ||
, PARAM3 | ||
select | ||
longlonglonglonglonglonglonglonglonglonglonglong_func( | ||
param1 | ||
, param2 | ||
, param3 | ||
) | ||
; | ||
SELECT | ||
FUNC1( | ||
CASE | ||
WHEN | ||
Z = 1 | ||
THEN | ||
FUNC3(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5) | ||
ELSE | ||
FUNC2( | ||
CASE | ||
WHEN | ||
Z = 1 | ||
THEN | ||
select | ||
func1( | ||
case | ||
when | ||
z = 1 | ||
then | ||
func3(param1, param2, param3, param4, param5) | ||
else | ||
func2( | ||
case | ||
when | ||
z = 1 | ||
then | ||
'ONE' | ||
ELSE | ||
FUNC3(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5) | ||
END | ||
else | ||
func3(param1, param2, param3, param4, param5) | ||
end | ||
) | ||
END | ||
end | ||
) |
16 changes: 8 additions & 8 deletions
16
crates/uroborosql-fmt/testfiles/config_test/dst_default/order_by.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
SELECT | ||
COL AS COL | ||
FROM | ||
TAB | ||
ORDER BY | ||
COL ASC -- 昇順 | ||
, LONG_COL DESC NULLS FIRST -- 降順 | ||
, NULL_COL NULLS FIRST -- NULL先 | ||
select | ||
col as col | ||
from | ||
tab | ||
order by | ||
col asc -- 昇順 | ||
, long_col desc nulls first -- 降順 | ||
, null_col nulls first -- NULL先 |
Oops, something went wrong.