String Operators
KQL string operators cover case-sensitive and case-insensitive equality, substring containment, prefix/suffix matching, word-boundary token matching, and regular expressions. The most important distinction to be aware of is that KQL contains and has are case-insensitive by default. The compiler handles this per dialect — using ILIKE where the engine provides it (ClickHouse, PostgreSQL, DuckDB), and relying on the engine's default case-insensitive collation with plain LIKE elsewhere (SQLite, MySQL).
Legend: ✅ Supported · ⚠️ Approximated · ❌ Not Supported · 🔄 Rewritten
| Operator | SQLite | MySQL | ClickHouse | PostgreSQL | DuckDB | Notes |
|---|---|---|---|---|---|---|
== | ✅ | ✅ | ✅ | ✅ | ✅ | Case-sensitive equality |
!= / <> | ✅ | ✅ | ✅ | ✅ | ✅ | |
=~ | ✅ | ✅ | ✅ | ✅ | ✅ | lower(a) = lower(b) |
!~ | ✅ | ✅ | ✅ | ✅ | ✅ | lower(a) != lower(b) |
contains | ⚠️ | ⚠️ | ✅ | ✅ | ✅ | KQL contains is case-insensitive. ClickHouse/Postgres/DuckDB: col ILIKE '%val%'. SQLite/MySQL: plain col LIKE '%val%' relying on default case-insensitive collation — no ILIKE |
!contains | ⚠️ | ⚠️ | ✅ | ✅ | ✅ | |
contains_cs | ✅ | ✅ | ✅ | ✅ | ✅ | Case-sensitive LIKE |
startswith | ⚠️ | ⚠️ | ✅ | ✅ | ✅ | SQLite/MySQL: LIKE val%; Postgres/DuckDB: ILIKE val% |
!startswith | ⚠️ | ⚠️ | ✅ | ✅ | ✅ | |
startswith_cs | ✅ | ✅ | ✅ | ✅ | ✅ | |
endswith | ⚠️ | ⚠️ | ✅ |