Skip to content

Commit 8eab0dc

Browse files
Fix CA1308: Replace ToLowerInvariant with ToUpperInvariant
1 parent 7c6b8e9 commit 8eab0dc

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

DataProvider/Nimblesite.DataProvider.Core/CodeGeneration/DataAccessGenerator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ public static partial class DataAccessGenerator
103103
/// <returns>The escaped identifier if it's a reserved keyword, otherwise the original</returns>
104104
private static string EscapeReservedKeyword(string identifier)
105105
{
106-
var lowerIdentifier = identifier.ToLowerInvariant();
107-
return CSharpReservedKeywords.Contains(lowerIdentifier)
108-
? $"@{lowerIdentifier}"
109-
: lowerIdentifier;
106+
var upperIdentifier = identifier.ToUpperInvariant();
107+
return CSharpReservedKeywords.Contains(upperIdentifier)
108+
? $"@{upperIdentifier}"
109+
: upperIdentifier;
110110
}
111111

112112
/// <summary>

Migration/Nimblesite.DataProvider.Migration.Core/LqlDefaultTranslator.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static string ToPostgres(string lqlExpression)
1818
{
1919
ArgumentNullException.ThrowIfNull(lqlExpression);
2020

21-
var normalized = lqlExpression.Trim().ToLowerInvariant();
21+
var normalized = lqlExpression.Trim().ToUpperInvariant();
2222

2323
// Handle common LQL functions
2424
return normalized switch
@@ -58,24 +58,24 @@ public static string ToSqlite(string lqlExpression)
5858
{
5959
ArgumentNullException.ThrowIfNull(lqlExpression);
6060

61-
var normalized = lqlExpression.Trim().ToLowerInvariant();
61+
var normalized = lqlExpression.Trim().ToUpperInvariant();
6262

6363
// Handle common LQL functions
6464
return normalized switch
6565
{
6666
// Timestamp functions - SQLite uses datetime/date/time functions
67-
"now()" => "(datetime('now'))",
68-
"current_timestamp()" => "CURRENT_TIMESTAMP",
69-
"current_date()" => "(date('now'))",
70-
"current_time()" => "(time('now'))",
67+
"NOW()" => "(datetime('now'))",
68+
"CURRENT_TIMESTAMP()" => "CURRENT_TIMESTAMP",
69+
"CURRENT_DATE()" => "(date('now'))",
70+
"CURRENT_TIME()" => "(time('now'))",
7171

7272
// UUID generation - SQLite needs manual UUID v4 construction
7373
"gen_uuid()" => UuidV4SqliteExpression,
7474
"uuid()" => UuidV4SqliteExpression,
7575

7676
// Boolean literals - SQLite uses 0/1
77-
"true" => "1",
78-
"false" => "0",
77+
"TRUE" => "1",
78+
"FALSE" => "0",
7979

8080
// Numeric literals (pass through)
8181
var n when int.TryParse(n, out _) => n,
@@ -109,7 +109,7 @@ Func<string, string[], string> functionTranslator
109109
return expression;
110110
}
111111

112-
var functionName = match.Groups["func"].Value.ToLowerInvariant();
112+
var functionName = match.Groups["func"].Value.ToUpperInvariant();
113113
var argsString = match.Groups["args"].Value;
114114

115115
// Parse arguments (simple split, doesn't handle nested functions with commas)

0 commit comments

Comments
 (0)