1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Per-backend SQL fragments that sea-query does not translate on its own.
use DatabaseConnection;
use ;
/// Cast target type for comparing/reading a column as text, valid on the real
/// backend behind `db`.
///
/// `sea_query::Expr::cast_as`/`Expr::cust` take an arbitrary type-name string and
/// emit it verbatim — unlike `ColumnType::Enum`, which sea-query's own per-backend
/// renderer does translate automatically, a raw `CAST(x AS ...)` target name is
/// never dialect-aware. MariaDB/MySQL reject `TEXT` as a `CAST` target (`CAST(x AS
/// CHAR)` is the equivalent there); PostgreSQL and SQLite both accept `TEXT`.
/// `db.get_database_backend()` is sea-orm's own detection — this function only
/// supplies the one mapping sea-orm has no way to know on its own.
/// `col` (cast to text for the real backend) compared equal to `val` — the
/// common pattern behind every builtin resource's column filter/scope check.
/// Case-insensitive `LIKE` on `col` (cast to text for the real backend) against
/// `pattern` — the common pattern behind every builtin resource's search.