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

Function jsonb_stringify

src/expr/src/scalar/func.rs:80–89  ·  view source on GitHub ↗
(a: Datum<'a>, temp_storage: &'a RowArena)

Source from the content-addressed store, hash-verified

78pub const MAX_STRING_FUNC_RESULT_BYTES: usize = 1024 * 1024 * 100;
79
80pub fn jsonb_stringify<'a>(a: Datum<'a>, temp_storage: &'a RowArena) -> Option<&'a str> {
81 match a {
82 Datum::JsonNull => None,
83 Datum::String(s) => Some(s),
84 _ => {
85 let s = cast_jsonb_to_string(JsonbRef::from_datum(a));
86 Some(temp_storage.push_string(s))
87 }
88 }
89}
90
91#[sqlfunc(
92 is_monotone = "(true, true)",

Callers 5

jsonb_each_stringifyFunction · 0.85
jsonb_get_path_stringifyFunction · 0.85

Calls 2

cast_jsonb_to_stringFunction · 0.85
push_stringMethod · 0.80

Tested by

no test coverage detected