Identifier Case
Config Key: identifier_case
Description: Case type for identifiers
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": " ",
"identifier_case": "lowercase",
"beautifiers": [
"sqlformat"
]
}
}
Difference from original
Index: lowercase
===================================================================
--- lowercase Original
+++ lowercase 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
🔧 "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": " ",
"identifier_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": " ",
"identifier_case": "capitalize",
"beautifiers": [
"sqlformat"
]
}
}
Difference from original
Index: capitalize
===================================================================
--- capitalize Original
+++ capitalize 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