Skip to content

Commit

Permalink
Make .as mode case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
MS authored and Groxan committed Sep 19, 2022
1 parent 2449819 commit c0e97cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Tzkt.Api/Utils/SqlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@ public SqlBuilder Filter(string column, StringParameter str, Func<string, string
AppendFilter($@"(""{column}"" IS NULL OR ""{column}"" != {Param(str.Ne)})");

if (str.As != null)
AppendFilter($@"""{column}"" LIKE {Param(str.As)}");
AppendFilter($@"""{column}"" ILIKE {Param(str.As)}");

if (str.Un != null)
AppendFilter($@"NOT (""{column}"" LIKE ({Param(str.Un)}))");
AppendFilter($@"NOT (""{column}"" ILIKE ({Param(str.Un)}))");

if (str.In != null)
AppendFilter($@"""{column}"" = ANY ({Param(str.In)})");
Expand Down Expand Up @@ -587,15 +587,15 @@ public SqlBuilder Filter(string column, JsonParameter json, Func<string, string>
{
foreach (var (path, value) in json.As)
{
AppendFilter($@"""{column}"" #>> {Param(JsonPath.Select(path))} LIKE {Param(value)}");
AppendFilter($@"""{column}"" #>> {Param(JsonPath.Select(path))} ILIKE {Param(value)}");
}
}

if (json.Un != null)
{
foreach (var (path, value) in json.Un)
{
AppendFilter($@"NOT (""{column}"" #>> {Param(JsonPath.Select(path))} LIKE {Param(value)})");
AppendFilter($@"NOT (""{column}"" #>> {Param(JsonPath.Select(path))} ILIKE {Param(value)})");
}
}

Expand Down Expand Up @@ -729,15 +729,15 @@ public SqlBuilder FilterA(string column, JsonParameter json, Func<string, string
{
foreach (var (path, value) in json.As)
{
AppendFilter($"{column} #>> {Param(JsonPath.Select(path))} LIKE {Param(value)}");
AppendFilter($"{column} #>> {Param(JsonPath.Select(path))} ILIKE {Param(value)}");
}
}

if (json.Un != null)
{
foreach (var (path, value) in json.Un)
{
AppendFilter($"NOT ({column} #>> {Param(JsonPath.Select(path))} LIKE {Param(value)})");
AppendFilter($"NOT ({column} #>> {Param(JsonPath.Select(path))} ILIKE {Param(value)})");
}
}

Expand Down

0 comments on commit c0e97cc

Please sign in to comment.