replace

Function replace 

Source
pub fn replace<'a, V, E, F, T>(
    expr: E,
    from: F,
    to: T,
) -> SQLExpr<'a, V, Text, E::Nullable, Scalar>
where V: SQLParam + 'a, E: Expr<'a, V>, E::SQLType: Textual, F: Expr<'a, V>, F::SQLType: Textual, T: Expr<'a, V>, T::SQLType: Textual,
Expand description

REPLACE - replaces occurrences of a substring.

Replaces all occurrences of from with to in the expression. Preserves the nullability of the input expression.

§Example

use drizzle_core::expr::replace;

// SELECT REPLACE(users.email, '@old.com', '@new.com')
let new_email = replace(users.email, "@old.com", "@new.com");