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

Function jsonb_get_string

src/expr/src/scalar/func.rs:1684–1688  ·  view source on GitHub ↗
(a: JsonbRef<'a>, k: &str)

Source from the content-addressed store, hash-verified

1682
1683#[sqlfunc(sqlname = "->", is_infix_op = true)]
1684fn jsonb_get_string<'a>(a: JsonbRef<'a>, k: &str) -> Option<JsonbRef<'a>> {
1685 let dict = DatumMap::try_from_result(Ok::<_, ()>(a.into_datum())).ok()?;
1686 let v = dict.iter().find(|(k2, _v)| k == *k2).map(|(_k, v)| v)?;
1687 JsonbRef::try_from_result(Ok::<_, ()>(v)).ok()
1688}
1689
1690#[sqlfunc(sqlname = "->>", is_infix_op = true)]
1691fn jsonb_get_string_stringify<'a>(

Callers 2

for_funcMethod · 0.85

Calls 5

okMethod · 0.45
into_datumMethod · 0.45
mapMethod · 0.45
findMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected