pub fn concat_ws<'a, V, S, I>(
sep: S,
values: I,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, S::Nullable, <S::Aggregate as AggOr<<I::Item as Expr<'a, V>>::Aggregate>>::Output>Expand description
CONCAT_WS - concatenates values with a separator, skipping NULLs.
Unlike ||, CONCAT_WS skips NULL values and never returns NULL
(unless the separator itself is NULL).
Supported by both SQLite (3.44+) and PostgreSQL.
ยงExample
use drizzle_core::expr::concat_ws;
// SELECT CONCAT_WS(', ', users.city, users.state, users.country)
let location = concat_ws(", ", [users.city, users.state, users.country]);