DuckDB text-expression helpers for Ecto queries.
import Ecto.Query
import QuackDB.Ecto.Text
from event in "events",
where: contains(event.name, "duck") and starts_with(event.kind, "bird"),
select: %{
second_part: split_part(event.name, "-", 2),
tags: string_split(event.tags, ",")
}contains_text/2 emits the same DuckDB contains(?, ?) call as
contains/2. It is useful with use QuackDB.Ecto, where shared
contains/2 may dispatch between text and spatial predicates.
Summary
Functions
Literal text containment with an explicit case-sensitivity option.
Functions
Literal text containment with an explicit case-sensitivity option.
contains(event.name, ^search, case_sensitive: false)With case_sensitive: false, both operands are lowercased by DuckDB before
matching. This is not full Unicode case folding. Wildcards remain literal;
an empty search matches and NULL operands produce NULL. Options must be a
literal keyword list with a boolean :case_sensitive value.