string_concat

Function string_concat 

Source
pub fn string_concat<'a, V, L, R>(
    left: L,
    right: R,
) -> SQLExpr<'a, V, Text, <L::Nullable as NullOr<R::Nullable>>::Output, Scalar>
where V: SQLParam + 'a, L: Expr<'a, V>, R: Expr<'a, V>, L::SQLType: Textual, R::SQLType: Textual, L::Nullable: NullOr<R::Nullable>, R::Nullable: Nullability,
Expand description

Concatenate two string expressions using || operator.

Requires both operands to be Textual (Text or VarChar). Nullability follows SQL concatenation rules: nullable input -> nullable output.

§Type Safety

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

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

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

§Example

use drizzle_core::expr::string_concat;

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