pub struct ComputedColumn {
pub function: QualifiedIdentifier,
pub data_type: String,
pub description: Option<String>,
pub row_argument: Option<String>,
pub session_argument: Option<String>,
pub takes_arguments: bool,
}Expand description
A function of the table’s row type, read as though it were a column.
Fields§
§function: QualifiedIdentifierThe function to call.
data_type: StringWhat it returns.
description: Option<String>The comment on the function, which is the field’s description.
A column’s description comes from a comment on the column; a computed column has no column to comment on, so it comes from the function – which is where a schema author would write it and where Hasura reads it from.
row_argument: Option<String>The name of the parameter that takes the table’s row.
Usually the first and usually the only one, but not always: Hasura
records a table_argument because a function may take the row second,
after the session. Where it is not first the call has to be written in
named notation, which is why the name is kept rather than the position.
session_argument: Option<String>The name of the parameter filled from the caller’s session, if any.
A function with one is not callable from the REST surface, which has no session document to give it, and is skipped there.
takes_arguments: boolWhether the function takes anything besides the row.
The REST surface has nowhere to write an argument and no session to supply, so it reads only the fields that take neither: a field it could only ever call wrongly is worse than a field that is not there.
Trait Implementations§
Source§impl Clone for ComputedColumn
impl Clone for ComputedColumn
Source§fn clone(&self) -> ComputedColumn
fn clone(&self) -> ComputedColumn
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 ComputedColumn
impl Debug for ComputedColumn
Source§impl<'de> Deserialize<'de> for ComputedColumn
impl<'de> Deserialize<'de> for ComputedColumn
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>,
Auto Trait Implementations§
impl Freeze for ComputedColumn
impl RefUnwindSafe for ComputedColumn
impl Send for ComputedColumn
impl Sync for ComputedColumn
impl Unpin for ComputedColumn
impl UnsafeUnpin for ComputedColumn
impl UnwindSafe for ComputedColumn
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more