Skip to content

Commit

Permalink
chore: case insensitive collation
Browse files Browse the repository at this point in the history
  • Loading branch information
lejoko committed May 16, 2024
1 parent 74fb74f commit f411bd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sql_implementation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ defmodule AshMysql.SqlImplementation do
Ecto.Query.dynamic(type(^expr, ^type))

Ash.Type.storage_type(type, []) == :ci_string ->
Ecto.Query.dynamic(fragment("(? COLLATE NOCASE)", ^expr))
Ecto.Query.dynamic(fragment("(? COLLATE utf8mb4_0900_ai_ci)", ^expr))

true ->
Ecto.Query.dynamic(type(^expr, ^Ash.Type.storage_type(type, [])))
Expand All @@ -130,7 +130,7 @@ defmodule AshMysql.SqlImplementation do
case type do
{:parameterized, inner_type, constraints} ->
if inner_type.type(constraints) == :ci_string do
Ecto.Query.dynamic(fragment("(? COLLATE NOCASE)", ^expr))
Ecto.Query.dynamic(fragment("(? COLLATE utf8mb4_0900_ai_ci)", ^expr))
else
Ecto.Query.dynamic(type(^expr, ^type))
end
Expand Down

0 comments on commit f411bd0

Please sign in to comment.