pub enum JsonTableColumn<X: Extension = NoExt> {
ForOrdinality {
name: Ident,
meta: Meta,
},
Regular {
name: Ident,
data_type: Box<DataType<X>>,
format: Option<JsonFormat>,
path: Option<Box<Expr<X>>>,
wrapper: JsonWrapperBehavior,
quotes: JsonQuotesBehavior,
on_empty: Option<JsonBehavior<X>>,
on_error: Option<JsonBehavior<X>>,
meta: Meta,
},
Exists {
name: Ident,
data_type: Box<DataType<X>>,
path: Option<Box<Expr<X>>>,
on_error: Option<JsonBehavior<X>>,
meta: Meta,
},
Nested {
path: Box<Expr<X>>,
path_name: Option<Ident>,
columns: ThinVec<JsonTableColumn<X>>,
meta: Meta,
},
}Expand description
One column of a JsonTable COLUMNS specification (PostgreSQL’s JsonTableColumn,
tagged by coltype).
The wrapper/quotes/behaviour clauses reuse the SQL/JSON expression-function nodes. The
per-kind clause legality is enforced at parse (matching PostgreSQL): only a
Regular column takes FORMAT/wrapper/quotes/ON EMPTY;
Exists takes only ON ERROR; Nested takes no
behaviours and recurses through its own COLUMNS.
Variants§
ForOrdinality
<name> FOR ORDINALITY — a 1-based row-sequence column; no type, no other clauses.
Regular
<name> <type> [FORMAT JSON …] [PATH <string>] [wrapper] [quotes] [<b> ON EMPTY] [<b> ON ERROR] — a value column projecting the JSON at its path.
Fields
format: Option<JsonFormat>Optional format for this syntax.
wrapper: JsonWrapperBehaviorThe WITH/WITHOUT WRAPPER behaviour; see JsonWrapperBehavior.
quotes: JsonQuotesBehaviorThe KEEP/OMIT QUOTES behaviour; see JsonQuotesBehavior.
on_empty: Option<JsonBehavior<X>>Optional on empty for this syntax.
on_error: Option<JsonBehavior<X>>Optional on error for this syntax.
Exists
<name> <type> EXISTS [PATH <string>] [<b> ON ERROR] — a boolean-ish column testing
whether the path matches; takes neither FORMAT/wrapper/quotes nor ON EMPTY.
Fields
on_error: Option<JsonBehavior<X>>Optional on error for this syntax.
Nested
NESTED [PATH] <string> [AS <name>] COLUMNS ( … ) — a sub-table joined against a
nested path, recursing through its own column list (PostgreSQL requires the nested
COLUMNS to be present and non-empty).
Trait Implementations§
Source§impl<X: Clone + Extension> Clone for JsonTableColumn<X>
impl<X: Clone + Extension> Clone for JsonTableColumn<X>
Source§fn clone(&self) -> JsonTableColumn<X>
fn clone(&self) -> JsonTableColumn<X>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, X> Deserialize<'de> for JsonTableColumn<X>where
X: Deserialize<'de> + Extension,
impl<'de, X> Deserialize<'de> for JsonTableColumn<X>where
X: Deserialize<'de> + Extension,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<X: Eq + Extension> Eq for JsonTableColumn<X>
Source§impl<X: Extension + Render> Render for JsonTableColumn<X>
impl<X: Extension + Render> Render for JsonTableColumn<X>
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl<X> Serialize for JsonTableColumn<X>
impl<X> Serialize for JsonTableColumn<X>
Source§impl<X: Extension> Spanned for JsonTableColumn<X>
impl<X: Extension> Spanned for JsonTableColumn<X>
impl<X: PartialEq + Extension> StructuralPartialEq for JsonTableColumn<X>
Auto Trait Implementations§
impl<X> Freeze for JsonTableColumn<X>
impl<X> RefUnwindSafe for JsonTableColumn<X>where
X: RefUnwindSafe,
impl<X> Send for JsonTableColumn<X>where
X: Send,
impl<X> Sync for JsonTableColumn<X>where
X: Sync,
impl<X> Unpin for JsonTableColumn<X>
impl<X> UnsafeUnpin for JsonTableColumn<X>
impl<X> UnwindSafe for JsonTableColumn<X>where
X: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.