Skip to main content

AlterAction

Enum AlterAction 

Source
pub enum AlterAction {
    AddColumn {
        name: String,
        type_name: String,
        required: bool,
    },
    DropColumn {
        name: String,
        if_exists: bool,
    },
    AddIndex {
        target: IndexTarget,
        if_not_exists: bool,
    },
    AddUnique {
        target: IndexTarget,
        if_not_exists: bool,
    },
    DropIndex {
        target: IndexTarget,
        if_exists: bool,
    },
    AddLink {
        name: String,
        target: String,
        local_key: String,
        target_key: String,
    },
}
Expand description

An individual ALTER TABLE action.

Variants§

§

AddColumn

Fields

§name: String
§type_name: String
§required: bool
§

DropColumn

Fields

§name: String
§if_exists: bool

drop column if exists — a missing column is a no-op instead of an error.

§

AddIndex

alter <Table> add index [if not exists] .<column> — creates a B+Tree index on column. No-op if the index already exists.

Fields

§if_not_exists: bool

Parsed for symmetry with the other DDL; add index is already idempotent, so this does not change behavior.

§

AddUnique

alter <Table> add unique [if not exists] .<column> — creates a UNIQUE B+Tree index on column. Scans existing data first and fails if any duplicate (non-null) value is present. Without if not exists it errors when the column is already indexed (no in-place upgrade); with it, an existing index is a no-op.

Fields

§if_not_exists: bool
§

DropIndex

alter <Table> drop index [if exists] <target> — removes either a stored-column index or an expression index with the exact path identity.

Fields

§if_exists: bool

alter <Owner> add link <name> -> <Target> on <local> = <target>: declare a persistent entity link on the altered type. Lowers to Catalog::create_link; cardinality is derived there.

Fields

§name: String
§target: String
§local_key: String
§target_key: String

Trait Implementations§

Source§

impl Clone for AlterAction

Source§

fn clone(&self) -> AlterAction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AlterAction

Source§

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

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

impl PartialEq for AlterAction

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AlterAction

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more