Skip to main content

octet_length

Function octet_length 

Source
pub fn octet_length<'a, V, E>(
    expr: E,
) -> SQLExpr<'a, V, <E::SQLType as LengthPolicy<V::DialectMarker>>::Output, E::Nullable, E::Aggregate>
where V: SQLParam + 'a, E: Expr<'a, V>, E::SQLType: LengthPolicy<V::DialectMarker>,
Expand description

OCTET_LENGTH - returns the number of bytes in a string.

Standard SQL function. Works on both SQLite (3.43+) and PostgreSQL.

ยงExample

use drizzle_core::expr::octet_length;

// SELECT OCTET_LENGTH(users.name)
let byte_len = octet_length(users.name);