-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathcasing.sql
More file actions
97 lines (66 loc) · 2.66 KB
/
casing.sql
File metadata and controls
97 lines (66 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
-- 1. Insert with simple mixed-case string
INSERT INTO users (name) VALUES ('John Doe');
-- 2. Insert with ALL CAPS
INSERT INTO users (name) VALUES ('ADMINISTRATOR');
-- 3. Insert with lowercase only
INSERT INTO users (name) VALUES ('lowercase');
-- 4. Insert with camelCase
INSERT INTO users (name) VALUES ('camelCaseString');
-- 5. Insert with snake_case
INSERT INTO users (name) VALUES ('snake_case_string');
-- 6. Insert with kebab-case (string literal)
INSERT INTO users (name) VALUES ('kebab-case-value');
-- 7. Insert with JSON-looking string
INSERT INTO data.snapshots (metadata) VALUES ('{"Type": "Full", "Status": "OK"}');
-- 8. Insert into quoted table and column
INSERT INTO "AppSchema"."User Data" ("Full Name") VALUES ('Jane Smith');
-- 9. Insert multiple values with mixed casing
-- FILE ISSUE FOR THIS upstream:
-- INSERT INTO logtable (message) VALUES ('Init'), ('Reboot'), ('ERROR'), ('Warning'), ('info');
INSERT INTO logtable (message) VALUES ('Init');
-- 10. Insert a string that looks like a function
INSERT INTO metrics.logs (message) VALUES ('NOW()');
-- 11. Insert with exact keyword-looking string
INSERT INTO users (name) VALUES ('SELECT');
-- 12. Insert lowercase string with special characters
INSERT INTO users (name) VALUES ('john_doe@example.com');
-- 13. Select mixed-case string literal
SELECT 'MixedCase';
-- 14. Select all uppercase
SELECT 'UPPERCASE';
-- 15. Select lowercase
SELECT 'lowercase';
-- 16. Select camelCase
SELECT 'camelCase';
-- 17. Select snake_case
SELECT 'snake_case';
-- 18. Select kebab-case
SELECT 'kebab-case';
-- 19. Select string that looks like SQL
SELECT 'SELECT * FROM users';
-- 20. Select string that looks like a function
SELECT 'sum(a + b)';
-- 21. Select with alias and quoted output name
SELECT name AS "UserLabel" FROM users;
-- 22. Select where literal is camelCase
SELECT * FROM users WHERE name = 'camelCaseString';
-- 23. Select where literal is lowercase
SELECT * FROM users WHERE name = 'lowercase';
-- 24. Select where literal is ALL CAPS
SELECT * FROM users WHERE name = 'ADMINISTRATOR';
-- 25. Select where message starts with capital W
SELECT * FROM logs WHERE message LIKE 'Warn%';
-- 26. Select with multiple casing in IN clause
SELECT * FROM alerts WHERE level IN ('Low', 'MEDIUM', 'High', 'CRITICAL');
-- 27. Select string with escaped quote
SELECT 'It''s working';
-- 28. Select with E-prefixed escape string
SELECT E'Line1\\nLine2';
-- 29. Select with Unicode emoji string
SELECT 'Status: ✅';
-- 30. Select into quoted alias
SELECT 'ALERT' AS "Level";
-- 31. Select with quoted function name
SELECT "HandleInsert"('TYPE_A', 'Region-1');
-- 32. Select with quoted table name
SELECT * FROM "dataPoints";