MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / ascii

Function ascii

src/expr/src/scalar/func/impls/string.rs:979–984  ·  view source on GitHub ↗
(a: &'a str)

Source from the content-addressed store, hash-verified

977
978#[sqlfunc(sqlname = "ascii")]
979fn ascii<'a>(a: &'a str) -> i32 {
980 a.chars()
981 .next()
982 .and_then(|c| i32::try_from(u32::from(c)).ok())
983 .unwrap_or(0)
984}
985
986#[sqlfunc(sqlname = "char_length")]
987fn char_length<'a>(a: &'a str) -> Result<i32, EvalError> {

Callers

nothing calls this directly

Calls 2

nextMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected