pub struct WhereFieldInfo {
pub declared_name: String,
pub is_relation: bool,
pub relation_type: Option<String>,
pub cast: Option<ScalarFieldType>,
pub hierarchy: Option<HierarchyContext>,
}Expand description
What the schema knows about one where key.
Fields§
§declared_name: StringThe name as the schema declares it, used for “did you mean” hints because that is the spelling a client writes.
is_relation: boolWhether {field: {sub: {eq: …}}} is a legitimate nested relation filter
on this field rather than a scalar handed a bogus operator.
This is the same question the published {Entity}WhereInput answers by
giving the field a nested filter type instead of an operator bag, and it
must be answered the same way: a field is a relation exactly when the
derived surface publishes a nested WhereInput for it.
relation_type: Option<String>The declared type a nested predicate on this field filters, when the schema can name it.
None on a scalar, and on a relation whose target the caller could not
resolve — the nested level is then unadjudicated rather than refused.
cast: Option<ScalarFieldType>The declared cast for a comparison against this field, when the caller can name one (#1157).
A JSON extraction is always text, so a comparison needs to be told what
the field really is. At the top level that came from
FieldTypeMap; one level down there was no entry at all, and the
generator inferred from the shape of the supplied JSON value. Inference is
right whenever the JSON type matches the SQL type and wrong whenever a
JSON string denotes something else — an instant, a date, a UUID. A
timestamp filter then compares text, and 2024-01-01T10:00:00+02:00
(08:00Z) sorts after 2024-01-01T09:00:00Z while being before it.
Carrying it here rather than pre-computing every dotted path is what keeps a relation cycle from making the path set unbounded: the parser records only the paths it actually walks.
None means the caller has keys but no type information — the level is
then typed exactly as it was before, by value shape.
hierarchy: Option<HierarchyContext>Where this field’s hierarchy keeps node paths, when the field is linked to one
(hierarchy = "<name>" + [hierarchies.<name>]) — what descendantOfId /
ancestorOfId on it resolve against (#1396).
Trait Implementations§
Source§impl Clone for WhereFieldInfo
impl Clone for WhereFieldInfo
Source§fn clone(&self) -> WhereFieldInfo
fn clone(&self) -> WhereFieldInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WhereFieldInfo
impl Debug for WhereFieldInfo
Source§impl Default for WhereFieldInfo
impl Default for WhereFieldInfo
Source§fn default() -> WhereFieldInfo
fn default() -> WhereFieldInfo
impl Eq for WhereFieldInfo
Source§impl PartialEq for WhereFieldInfo
impl PartialEq for WhereFieldInfo
impl StructuralPartialEq for WhereFieldInfo
Auto Trait Implementations§
impl Freeze for WhereFieldInfo
impl RefUnwindSafe for WhereFieldInfo
impl Send for WhereFieldInfo
impl Sync for WhereFieldInfo
impl Unpin for WhereFieldInfo
impl UnsafeUnpin for WhereFieldInfo
impl UnwindSafe for WhereFieldInfo
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.