concat

Function concat 

Source
pub fn concat<'a, V, E1, E2>(
    expr1: E1,
    expr2: E2,
) -> SQLExpr<'a, V, Text, <E1::Nullable as NullOr<E2::Nullable>>::Output, Scalar>
where V: SQLParam + 'a, E1: Expr<'a, V>, E1::SQLType: Textual, E2: Expr<'a, V>, E2::SQLType: Textual, E1::Nullable: NullOr<E2::Nullable>, E2::Nullable: Nullability,
Expand description

Concatenate two string expressions using || operator.

Nullability follows SQL concatenation rules: if either input is nullable, the result is nullable. string_concat is a compatibility alias.

§Type Safety

// ✅ OK: Both are Text
concat(users.first_name, users.last_name);

// ✅ OK: Text with string literal
concat(users.first_name, " ");

// ❌ Compile error: Int is not Textual
concat(users.id, users.name);

§Example

use drizzle_core::expr::concat;

// SELECT users.first_name || ' ' || users.last_name
let full_name = concat(concat(users.first_name, " "), users.last_name);