MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse

Method parse

nodedb/src/engine/document/predicate.rs:39–42  ·  view source on GitHub ↗

Parse the raw SQL text of a partial-index predicate. Returns `None` if the text cannot be parsed — callers should treat an unparsable predicate as a bug in the stored catalog entry, not as a pass-through (defaulting to "index everything" would silently over-populate a partial index). The caller is expected to surface a clear error; the DDL path already validates the text at CREATE INDEX time.

(text: &str)

Source from the content-addressed store, hash-verified

37 /// expected to surface a clear error; the DDL path already
38 /// validates the text at CREATE INDEX time.
39 pub fn parse(text: &str) -> Option<Self> {
40 let (expr, _deps) = expr_parse::parse_generated_expr(text).ok()?;
41 Some(Self { expr })
42 }
43
44 /// Evaluate the predicate against a document value. Returns `true`
45 /// only when the expression evaluates to `Bool(true)` — `NULL`,

Callers 6

parse_expiry_keyFunction · 0.45
parse_sys_fromFunction · 0.45
parse_segment_seqFunction · 0.45
parseFunction · 0.45
parse_hop_rangeFunction · 0.45
parse_versioned_edge_keyFunction · 0.45

Calls 2

parse_generated_exprFunction · 0.85
okMethod · 0.45

Tested by

no test coverage detected