Thanks to visit codestin.com
Credit goes to docs.rs

Enum ColumnOption

Source
pub enum ColumnOption {
Show 20 variants Null, NotNull, Default(Expr), Materialized(Expr), Ephemeral(Option<Expr>), Alias(Expr), Unique { is_primary: bool, characteristics: Option<ConstraintCharacteristics>, }, ForeignKey { foreign_table: ObjectName, referred_columns: Vec<Ident>, on_delete: Option<ReferentialAction>, on_update: Option<ReferentialAction>, characteristics: Option<ConstraintCharacteristics>, }, Check(Expr), DialectSpecific(Vec<Token>), CharacterSet(ObjectName), Collation(ObjectName), Comment(String), OnUpdate(Expr), Generated { generated_as: GeneratedAs, sequence_options: Option<Vec<SequenceOptions>>, generation_expr: Option<Expr>, generation_expr_mode: Option<GeneratedExpressionMode>, generated_keyword: bool, }, Options(Vec<SqlOption>), Identity(IdentityPropertyKind), OnConflict(Keyword), Policy(ColumnPolicy), Tags(TagsColumnOption),
}
Expand description

ColumnOptions are modifiers that follow a column definition in a CREATE TABLE statement.

Variants§

§

Null

NULL

§

NotNull

NOT NULL

§

Default(Expr)

DEFAULT <restricted-expr>

§

Materialized(Expr)

MATERIALIZE <expr> Syntax: b INT MATERIALIZE (a + 1)

ClickHouse

§

Ephemeral(Option<Expr>)

EPHEMERAL [<expr>]

ClickHouse

§

Alias(Expr)

ALIAS <expr>

ClickHouse

§

Unique

{ PRIMARY KEY | UNIQUE } [<constraint_characteristics>]

Fields

§is_primary: bool
§

ForeignKey

A referential integrity constraint ([FOREIGN KEY REFERENCES <foreign_table> (<referred_columns>) { [ON DELETE <referential_action>] [ON UPDATE <referential_action>] | [ON UPDATE <referential_action>] [ON DELETE <referential_action>] } [<constraint_characteristics>] ).

Fields

§foreign_table: ObjectName
§referred_columns: Vec<Ident>
§

Check(Expr)

CHECK (<expr>)

§

DialectSpecific(Vec<Token>)

Dialect-specific options, such as:

  • MySQL’s AUTO_INCREMENT or SQLite’s AUTOINCREMENT
§

CharacterSet(ObjectName)

§

Collation(ObjectName)

§

Comment(String)

§

OnUpdate(Expr)

§

Generated

Generateds are modifiers that follow a column definition in a CREATE TABLE statement.

Fields

§generated_as: GeneratedAs
§sequence_options: Option<Vec<SequenceOptions>>
§generation_expr: Option<Expr>
§generation_expr_mode: Option<GeneratedExpressionMode>
§generated_keyword: bool

false if ‘GENERATED ALWAYS’ is skipped (option starts with AS)

§

Options(Vec<SqlOption>)

BigQuery specific: Explicit column options in a view 1 or table 2 Syntax

OPTIONS(description="field desc")
§

Identity(IdentityPropertyKind)

Creates an identity or an autoincrement column in a table. Syntax

{ IDENTITY | AUTOINCREMENT } [ (seed , increment) | START num INCREMENT num ] [ ORDER | NOORDER ]
§

OnConflict(Keyword)

SQLite specific: ON CONFLICT option on column definition https://www.sqlite.org/lang_conflict.html

§

Policy(ColumnPolicy)

Snowflake specific: an option of specifying security masking or projection policy to set on a column. Syntax:

[ WITH ] MASKING POLICY <policy_name> [ USING ( <col_name> , <cond_col1> , ... ) ]
[ WITH ] PROJECTION POLICY <policy_name>
§

Tags(TagsColumnOption)

Snowflake specific: Specifies the tag name and the tag string value. Syntax:

[ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] )

Trait Implementations§

Source§

impl Clone for ColumnOption

Source§

fn clone(&self) -> ColumnOption

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColumnOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ColumnOption

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ColumnOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for ColumnOption

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ColumnOption

Source§

fn cmp(&self, other: &ColumnOption) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ColumnOption

Source§

fn eq(&self, other: &ColumnOption) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ColumnOption

Source§

fn partial_cmp(&self, other: &ColumnOption) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for ColumnOption

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Spanned for ColumnOption

§partial span

Missing spans:

Source§

fn span(&self) -> Span

Return the Span (the minimum and maximum Location) for this AST node, by recursively combining the spans of its children.
Source§

impl Visit for ColumnOption

Source§

fn visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break>

Source§

impl VisitMut for ColumnOption

Source§

fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>

Source§

impl Eq for ColumnOption

Source§

impl StructuralPartialEq for ColumnOption

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,