pub struct EntityFilter {
pub ids: Vec<Uuid>,
pub kinds: Vec<String>,
pub property_equalities: Vec<(String, SqlValue)>,
pub tombstones: EntityTombstones,
pub entity_types: Vec<String>,
pub entity_types_by_kind: BTreeMap<String, Vec<String>>,
pub legacy_entity_type_fallback: bool,
pub name_prefix: Option<String>,
pub name_exact: Option<String>,
pub tags_any: Vec<String>,
pub namespaces: Vec<String>,
pub names_ci: Vec<String>,
}Expand description
Entity filter for query operations.
New fields deserialize to defaults for older serialized filters. Complete
external Rust struct literals must specify them or use ..Default::default().
Fields§
§ids: Vec<Uuid>§kinds: Vec<String>§property_equalities: Vec<(String, SqlValue)>ANDed SQL JSON equalities; see EntityFilter::property_eq.
tombstones: EntityTombstonesLive-only by default. Liveness builders replace this selection.
entity_types: Vec<String>Filter by exact entity_type value. Multiple values are ORed.
entity_types_by_kind: BTreeMap<String, Vec<String>>Kind-qualified accepted subtype spellings. Groups are ORed; each group requires its kind and one of its values. An empty value group matches nothing.
legacy_entity_type_fallback: boolFor entity listing, fall back to a string properties.type only when
entity_type is null. Does not change the returned entity or apply when
both type filters are empty. Other query callers retain exact-column filtering.
name_prefix: Option<String>§name_exact: Option<String>Deterministic, case-sensitive equality on entities.name (binary
comparison — SQLite’s default collation for = on a TEXT column
without an explicit COLLATE NOCASE). Distinct from name_prefix:
that stage’s LIKE is inherently prefix-shaped and, with SQLite’s
default NOCASE-free LIKE on ASCII, still ranks a page by
created_at DESC — a match that is exact but not the newest can be
paged out. name_exact skips paging risk entirely by filtering to
only rows that equal name at the SQL layer.
namespaces: Vec<String>When non-empty, restricts results to any of these namespaces using
namespace IN (...). Takes precedence over the namespace string
parameter passed to query_entities / count_entities. When empty the
caller-supplied namespace parameter is used (single-namespace path,
backward-compatible default).
names_ci: Vec<String>ASCII-case-insensitive batched exact-name match (ADR-104 Stage C).
Compares a caller-bounded set of raw and ASCII-lowercased candidate
strings to LOWER(name). Cased non-ASCII characters require exact form.
Distinct from single-value, case-sensitive name_exact. Results contain
at most one representative row per folded candidate before page limits
and offsets are applied.
Implementations may omit the page total to keep this lookup page-limited
instead of issuing a separate count.
Implementations§
Source§impl EntityFilter
impl EntityFilter
Sourcepub fn property_eq(self, path: impl Into<String>, value: SqlValue) -> Self
pub fn property_eq(self, path: impl Into<String>, value: SqlValue) -> Self
Require SQL json_extract(properties, path) = value equality.
Paths must be $.field[.subfield] with nonempty ASCII alphanumeric or
underscore segments; queries reject other paths. Calls are ANDed.
SQL NULL matches neither a missing field nor explicit JSON null.
JSON booleans compare as 0/1, including numeric coercion. JSON objects
and arrays compare their serialized SQL text, not structural JSON equality.
Sourcepub fn include_tombstones(self) -> Self
pub fn include_tombstones(self) -> Self
Include live and tombstoned rows, replacing a previous liveness choice.
Sourcepub fn tombstoned_only(self) -> Self
pub fn tombstoned_only(self) -> Self
Include only tombstoned rows, replacing a previous liveness choice.