pub enum JsonFilter {
HasKey {
column: &'static str,
key: String,
},
GetText {
column: &'static str,
key: String,
op: FilterOp,
value: FilterValue,
},
}Expand description
JSON / JSONB filter predicates. Two flavors:
HasKey—col ? 'key'on PG (key-exists operator). On SQLite this lowers tojson_extract(col, '$.key') IS NOT NULL, which has the same matches-some-non-null-value semantics for the most common case (records where the schema sometimes carries a key, sometimes doesn’t); JSON values explicitly stored asnulldiverge between backends, mirroring the operators themselves.GetText—col ->> 'key' <op> $1on PG (extract-as-text + compare). On SQLite the samejson_extractpath with a column accessor handles it. Supported comparison ops are the standardEq/Ne/Lt/Lte/Gt/GteplusIsNull/IsNotNull.
Keys are owned String so callers can pass runtime-supplied
metric / setting names (e.g. user-driven model_run_timeseries
queries that pivot on args.metric). The column slot stays
&'static str because columns are always schema-rooted.
Variants§
Trait Implementations§
Source§impl Clone for JsonFilter
impl Clone for JsonFilter
Source§fn clone(&self) -> JsonFilter
fn clone(&self) -> JsonFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonFilter
impl Debug for JsonFilter
Source§impl PartialEq for JsonFilter
impl PartialEq for JsonFilter
Source§fn eq(&self, other: &JsonFilter) -> bool
fn eq(&self, other: &JsonFilter) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for JsonFilter
Auto Trait Implementations§
impl Freeze for JsonFilter
impl RefUnwindSafe for JsonFilter
impl Send for JsonFilter
impl Sync for JsonFilter
impl Unpin for JsonFilter
impl UnsafeUnpin for JsonFilter
impl UnwindSafe for JsonFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more