pub enum JsonFilter {
Contains(Json),
Extract(String, JsonCmp),
HasKey(String),
}Expand description
JSON-specific filter operations.
Provides three types of filtering on JSON columns:
- Contains: Structural containment check (PostgreSQL
@>style) - Extract: Extract value at path and apply comparison
- HasKey: Check if a path exists in the JSON
Variants§
Contains(Json)
Structural containment: column’s JSON contains the pattern.
Implements PostgreSQL @> style containment:
- Objects: all key-value pairs in pattern exist in target (recursive)
- Arrays: all elements in pattern exist in target (order-independent)
- Primitives: must be equal
Extract(String, JsonCmp)
Extract a value at the specified JSON path and apply a comparison operation.
Paths use dot notation with bracket array indices: user.items[0].name
HasKey(String)
Check whether a path/key exists in the JSON structure.
Paths use dot notation with bracket array indices: user.items[0].name
Implementations§
Source§impl JsonFilter
impl JsonFilter
Sourcepub fn contains(pattern: Json) -> JsonFilter
pub fn contains(pattern: Json) -> JsonFilter
Creates a Contains filter with the given JSON pattern.
Sourcepub fn extract_eq(path: &str, value: Value) -> JsonFilter
pub fn extract_eq(path: &str, value: Value) -> JsonFilter
Creates an Extract filter with an equality comparison.
Sourcepub fn extract_ne(path: &str, value: Value) -> JsonFilter
pub fn extract_ne(path: &str, value: Value) -> JsonFilter
Creates an Extract filter with a not-equal comparison.
Sourcepub fn extract_gt(path: &str, value: Value) -> JsonFilter
pub fn extract_gt(path: &str, value: Value) -> JsonFilter
Creates an Extract filter with a greater-than comparison.
Sourcepub fn extract_lt(path: &str, value: Value) -> JsonFilter
pub fn extract_lt(path: &str, value: Value) -> JsonFilter
Creates an Extract filter with a less-than comparison.
Sourcepub fn extract_ge(path: &str, value: Value) -> JsonFilter
pub fn extract_ge(path: &str, value: Value) -> JsonFilter
Creates an Extract filter with a greater-than-or-equal comparison.
Sourcepub fn extract_le(path: &str, value: Value) -> JsonFilter
pub fn extract_le(path: &str, value: Value) -> JsonFilter
Creates an Extract filter with a less-than-or-equal comparison.
Sourcepub fn extract_in(path: &str, values: Vec<Value>) -> JsonFilter
pub fn extract_in(path: &str, values: Vec<Value>) -> JsonFilter
Creates an Extract filter with an In comparison.
Sourcepub fn extract_is_null(path: &str) -> JsonFilter
pub fn extract_is_null(path: &str) -> JsonFilter
Creates an Extract filter checking for null.
Sourcepub fn extract_not_null(path: &str) -> JsonFilter
pub fn extract_not_null(path: &str) -> JsonFilter
Creates an Extract filter checking for not null.
Sourcepub fn has_key(path: &str) -> JsonFilter
pub fn has_key(path: &str) -> JsonFilter
Creates a HasKey filter.
Trait Implementations§
Source§impl CandidType for JsonFilter
impl CandidType for JsonFilter
Source§impl Clone for JsonFilter
impl Clone for JsonFilter
Source§fn clone(&self) -> JsonFilter
fn clone(&self) -> JsonFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JsonFilter
impl Debug for JsonFilter
Source§impl<'de> Deserialize<'de> for JsonFilter
impl<'de> Deserialize<'de> for JsonFilter
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonFilter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsonFilter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for JsonFilter
impl PartialEq for JsonFilter
Source§impl Serialize for JsonFilter
impl Serialize for JsonFilter
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for JsonFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.