-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dataTypeCase & functionCase (#689)
- Loading branch information
Showing
83 changed files
with
804 additions
and
583 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# dataTypeCase (experimental) | ||
|
||
Converts data types to upper- or lowercase. | ||
|
||
## Options | ||
|
||
- `"preserve"` (default) preserves the original case. | ||
- `"upper"` converts to uppercase. | ||
- `"lower"` converts to lowercase. | ||
|
||
### preserve | ||
|
||
```sql | ||
CREATE TABLE user ( | ||
id InTeGeR PRIMARY KEY, | ||
first_name VarChaR(30) NOT NULL, | ||
bio teXT, | ||
is_email_verified BooL, | ||
created_timestamp timestamP | ||
); | ||
``` | ||
|
||
### upper | ||
|
||
```sql | ||
CREATE TABLE user ( | ||
id INTEGER PRIMARY KEY, | ||
first_name VARCHAR(30) NOT NULL, | ||
bio TEXT, | ||
is_email_verified BOOL, | ||
created_timestamp TIMESTAMP | ||
); | ||
``` | ||
|
||
### lower | ||
|
||
```sql | ||
CREATE TABLE user ( | ||
id integer PRIMARY KEY, | ||
first_name varchar(30) NOT NULL, | ||
bio text, | ||
is_email_verified bool, | ||
created_timestamp timestamp | ||
); | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# functionCase (experimental) | ||
|
||
Converts function names to upper- or lowercase. | ||
|
||
## Options | ||
|
||
- `"preserve"` (default) preserves the original case. | ||
- `"upper"` converts to uppercase. | ||
- `"lower"` converts to lowercase. | ||
|
||
### preserve | ||
|
||
```sql | ||
SELECT | ||
Concat(Trim(first_name), ' ', Trim(last_name)) AS name, | ||
Max(salary) AS max_pay, | ||
Cast(ssid AS INT) | ||
FROM | ||
employee | ||
WHERE | ||
expires_at > Now() | ||
``` | ||
|
||
### upper | ||
|
||
```sql | ||
SELECT | ||
CONCAT(TRIM(first_name), ' ', TRIM(last_name)) AS name, | ||
MAX(salary) AS max_pay, | ||
CAST(ssid AS INT) | ||
FROM | ||
employee | ||
WHERE | ||
expires_at > NOW() | ||
``` | ||
|
||
### lower | ||
|
||
```sql | ||
SELECT | ||
concat(trim(first_name), ' ', trim(last_name)) AS name, | ||
max(salary) AS max_pay, | ||
cast(ssid AS INT) | ||
FROM | ||
employee | ||
WHERE | ||
expires_at > now() | ||
``` |
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
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
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
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
Oops, something went wrong.