Keyword Case
Config Key: keyword_case
Description: Case type for keywords
Available since version: 0.17.0 (Current: )
Type: string
Default: "lowercase"
Allowed values: "lowercase"
or "uppercase"
or "capitalize"
Support
Languages: SQL
Beautifiers: sqlformat
Comparison Table
Language | sqlformat |
---|---|
SQL | ✅ |
Examples
Carriage Return = ␍; Line Feed = ␊; Tab = ⇥; Whitespace = ·.
🚧 Original Code
SELECT·*␊
from·USERS·u␊
Join·Users_Permission·up·On·U.User_Id·=·up.user_id␊
where·u.USER_ID·=·1␊
··AND·U.Permission_id·=·2;␊
🔧 "lowercase"
Using sqlformat beautifier:
select·*␊
from·USERS·u␊
join·Users_Permission·up·on·U.User_Id·=·up.user_id␊
where·u.USER_ID·=·1␊
··and·U.Permission_id·=·2;
How to configure
A .unibeautify.json
file would look like the following:
{
"SQL": {
"indent_size": 2,
"indent_char": " ",
"keyword_case": "lowercase",
"beautifiers": [
"sqlformat"
]
}
}
Difference from original
Index: lowercase
===================================================================
--- lowercase Original
+++ lowercase Beautified
@@ -1,5 +1,5 @@
-SELECT·*␊
+select·*␊
from·USERS·u␊
-Join·Users_Permission·up·On·U.User_Id·=·up.user_id␊
+join·Users_Permission·up·on·U.User_Id·=·up.user_id␊
where·u.USER_ID·=·1␊
-··AND·U.Permission_id·=·2;␊
+··and·U.Permission_id·=·2;
\ No newline at end of file
🔧 "uppercase"
Using sqlformat beautifier:
SELECT·*␊
FROM·USERS·u␊
JOIN·Users_Permission·up·ON·U.User_Id·=·up.user_id␊
WHERE·u.USER_ID·=·1␊
··AND·U.Permission_id·=·2;
How to configure
A .unibeautify.json
file would look like the following:
{
"SQL": {
"indent_size": 2,
"indent_char": " ",
"keyword_case": "uppercase",
"beautifiers": [
"sqlformat"
]
}
}
Difference from original
Index: uppercase
===================================================================
--- uppercase Original
+++ uppercase Beautified
@@ -1,5 +1,5 @@
SELECT·*␊
-from·USERS·u␊
-Join·Users_Permission·up·On·U.User_Id·=·up.user_id␊
-where·u.USER_ID·=·1␊
-··AND·U.Permission_id·=·2;␊
+FROM·USERS·u␊
+JOIN·Users_Permission·up·ON·U.User_Id·=·up.user_id␊
+WHERE·u.USER_ID·=·1␊
+··AND·U.Permission_id·=·2;
\ No newline at end of file
🔧 "capitalize"
Using sqlformat beautifier:
Select·*␊
From·USERS·u␊
Join·Users_Permission·up·On·U.User_Id·=·up.user_id␊
Where·u.USER_ID·=·1␊
··And·U.Permission_id·=·2;
How to configure
A .unibeautify.json
file would look like the following:
{
"SQL": {
"indent_size": 2,
"indent_char": " ",
"keyword_case": "capitalize",
"beautifiers": [
"sqlformat"
]
}
}
Difference from original
Index: capitalize
===================================================================
--- capitalize Original
+++ capitalize Beautified
@@ -1,5 +1,5 @@
-SELECT·*␊
-from·USERS·u␊
+Select·*␊
+From·USERS·u␊
Join·Users_Permission·up·On·U.User_Id·=·up.user_id␊
-where·u.USER_ID·=·1␊
-··AND·U.Permission_id·=·2;␊
+Where·u.USER_ID·=·1␊
+··And·U.Permission_id·=·2;
\ No newline at end of file