Skip to main content

string_concat

Function string_concat 

Source
pub fn string_concat<'a, V, L, R>(
    left: L,
    right: R,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, <L::Nullable as Nullability>::Or<R::Nullable>, <L::Aggregate as AggregateKind>::Or<R::Aggregate>, (L::Sources, R::Sources)>
where V: SQLParam + 'a, L: Expr<'a, V>, R: Expr<'a, V>, L::SQLType: Textual, R::SQLType: Textual, R::Nullable: Nullability, R::Aggregate: AggregateKind,
Expand description

Joins two text values; same as concat.

Renders left || right on SQLite and PostgreSQL and CONCAT(left, right) on MySQL. Both arguments must be text. The result is text, nullable if either argument is.

ยงExamples

let label = string_concat(users.name, "!");
assert_eq!(label.sql(), r#""users"."name" || ?"#);