pub struct PortableColumn {
pub name: String,
pub source_type: String,
pub family: SqlTypeFamily,
pub nullable: bool,
pub primary_key: bool,
pub unique: bool,
pub default_sql: Option<String>,
pub generated: bool,
pub identity: bool,
pub collation: Option<String>,
}Expand description
Portable column: everything a generation strategy needs to know about a single column, independent of the source SQL dialect.
Deserialization accepts a concise hand-authored shorthand: type: as an
alias for source_type, with family derived automatically when it is
absent (see [PortableColumnInput]). Serialization always emits the
canonical source_type + family fields; --emit-config never writes
the type: shorthand.
Fields§
§name: String§source_type: String§family: SqlTypeFamily§nullable: bool§primary_key: bool§unique: bool§default_sql: Option<String>§generated: bool§identity: bool§collation: Option<String>Trait Implementations§
Source§impl Clone for PortableColumn
impl Clone for PortableColumn
Source§fn clone(&self) -> PortableColumn
fn clone(&self) -> PortableColumn
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 PortableColumn
impl Debug for PortableColumn
Source§impl<'de> Deserialize<'de> for PortableColumn
impl<'de> Deserialize<'de> for PortableColumn
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 Eq for PortableColumn
Source§impl JsonSchema for PortableColumn
Manual schema: #[serde(try_from = "PortableColumnInput")] means the
derive macro would describe PortableColumn’s own fields (which always
require source_type + family), not what YAML actually accepts. This
impl instead mirrors [PortableColumnInput]: family is optional, and
either source_type or its type shorthand alias may supply the type
name (see D1 in the module tests below).
impl JsonSchema for PortableColumn
Manual schema: #[serde(try_from = "PortableColumnInput")] means the
derive macro would describe PortableColumn’s own fields (which always
require source_type + family), not what YAML actually accepts. This
impl instead mirrors [PortableColumnInput]: family is optional, and
either source_type or its type shorthand alias may supply the type
name (see D1 in the module tests below).
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for PortableColumn
impl PartialEq for PortableColumn
Source§impl Serialize for PortableColumn
impl Serialize for PortableColumn
impl StructuralPartialEq for PortableColumn
Auto Trait Implementations§
impl Freeze for PortableColumn
impl RefUnwindSafe for PortableColumn
impl Send for PortableColumn
impl Sync for PortableColumn
impl Unpin for PortableColumn
impl UnsafeUnpin for PortableColumn
impl UnwindSafe for PortableColumn
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<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§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.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