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

Function extract_byte_param_value

src/sql/src/plan/statement/dml.rs:2090–2096  ·  view source on GitHub ↗
(v: Option<String>, param_name: &str)

Source from the content-addressed store, hash-verified

2088}
2089
2090fn extract_byte_param_value(v: Option<String>, param_name: &str) -> Result<Option<u8>, PlanError> {
2091 match v {
2092 Some(v) if v.len() == 1 => Ok(Some(v.as_bytes()[0])),
2093 Some(..) => sql_bail!("COPY {} must be a single one-byte character", param_name),
2094 None => Ok(None),
2095 }
2096}
2097
2098generate_extracted_config!(
2099 CopyOption,

Callers 2

plan_copy_to_exprFunction · 0.85
plan_copy_fromFunction · 0.85

Calls 2

lenMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected