Skip to main content

JsonStatement

Enum JsonStatement 

Source
pub enum JsonStatement {
Show 43 variants CreateTable { table: RichTable, }, DropTable { table: Table, table_key: String, }, RenameTable { schema: String, from: String, to: String, }, AddColumn { column: Box<Column>, is_pk: bool, is_composite_pk: bool, }, DropColumn { column: Box<Column>, }, AlterColumn { to: Box<Column>, was_enum: bool, is_enum: bool, diff: HashMap<String, Value>, }, RenameColumn { from: Box<Column>, to: Box<Column>, }, CreateIndex { index: Index, }, DropIndex { index: Index, }, CreateFk { fk: ForeignKey, }, DropFk { fk: ForeignKey, }, AddPk { pk: PrimaryKey, }, DropPk { pk: PrimaryKey, }, AddUnique { unique: UniqueConstraint, }, DropUnique { unique: UniqueConstraint, }, AddCheck { check: CheckConstraint, }, DropCheck { check: CheckConstraint, }, CreateSchema { name: String, }, DropSchema { name: String, }, RenameSchema { from: Schema, to: Schema, }, CreateEnum { enum_: Enum, }, DropEnum { enum_: Enum, }, AlterEnum { from: Enum, to: Enum, diff: Vec<EnumDiff>, }, CreateSequence { sequence: Sequence, }, DropSequence { sequence: Sequence, }, CreateView { view: View, }, DropView { view: View, }, AlterView { old_view: Box<View>, new_view: Box<View>, }, CreateRole { role: Role, }, DropRole { role: Role, }, CreatePolicy { policy: Policy, }, DropPolicy { policy: Policy, }, AlterTable { old_table: Table, new_table: Table, }, RecreateFk { old_fk: ForeignKey, new_fk: ForeignKey, }, RecreateUnique { old_unique: UniqueConstraint, new_unique: UniqueConstraint, }, RecreateColumn { old_column: Box<Column>, new_column: Box<Column>, }, RecreateIndex { old_index: Box<Index>, new_index: Box<Index>, }, RecreatePk { old_pk: PrimaryKey, new_pk: PrimaryKey, }, RecreateCheck { old_check: CheckConstraint, new_check: CheckConstraint, }, RecreatePolicy { old_policy: Box<Policy>, new_policy: Box<Policy>, }, AlterSequence { old_sequence: Sequence, new_sequence: Sequence, }, AlterRole { old_role: Role, new_role: Role, }, RecreateEnum { old_enum: Enum, new_enum: Enum, columns: Vec<Column>, },
}
Available on crate feature std only.

Variants§

§

CreateTable

Fields

§

DropTable

Fields

§table: Table
§table_key: String
§

RenameTable

Fields

§schema: String
§from: String
§

AddColumn

Fields

§column: Box<Column>
§is_pk: bool
§is_composite_pk: bool
§

DropColumn

Fields

§column: Box<Column>
§

AlterColumn

Fields

§was_enum: bool
§is_enum: bool
§

RenameColumn

Fields

§from: Box<Column>
§

CreateIndex

Fields

§index: Index
§

DropIndex

Fields

§index: Index
§

CreateFk

Fields

§

DropFk

Fields

§

AddPk

Fields

§

DropPk

Fields

§

AddUnique

Fields

§

DropUnique

Fields

§

AddCheck

Fields

§

DropCheck

Fields

§

CreateSchema

Fields

§name: String
§

DropSchema

Fields

§name: String
§

RenameSchema

Fields

§from: Schema
§

CreateEnum

Fields

§enum_: Enum
§

DropEnum

Fields

§enum_: Enum
§

AlterEnum

Fields

§from: Enum
§to: Enum
§

CreateSequence

Fields

§sequence: Sequence
§

DropSequence

Fields

§sequence: Sequence
§

CreateView

Fields

§view: View
§

DropView

Fields

§view: View
§

AlterView

Alter a view by dropping and recreating (PostgreSQL doesn’t support ALTER VIEW for definition changes)

Fields

§old_view: Box<View>
§new_view: Box<View>
§

CreateRole

Fields

§role: Role
§

DropRole

Fields

§role: Role
§

CreatePolicy

Fields

§policy: Policy
§

DropPolicy

Fields

§policy: Policy
§

AlterTable

Fields

§old_table: Table
§new_table: Table
§

RecreateFk

Fields

§old_fk: ForeignKey
§new_fk: ForeignKey
§

RecreateUnique

Fields

§old_unique: UniqueConstraint
§new_unique: UniqueConstraint
§

RecreateColumn

Recreate column by dropping and re-adding (for generated columns, type changes, etc.)

Fields

§old_column: Box<Column>
§new_column: Box<Column>
§

RecreateIndex

Recreate an index by dropping and re-creating (PostgreSQL has no general ALTER INDEX for definition changes).

Fields

§old_index: Box<Index>
§new_index: Box<Index>
§

RecreatePk

Recreate a primary key: DROP CONSTRAINT + ADD CONSTRAINT.

Fields

§old_pk: PrimaryKey
§new_pk: PrimaryKey
§

RecreateCheck

Recreate a check constraint: DROP CONSTRAINT + ADD CONSTRAINT.

Fields

§

RecreatePolicy

Recreate a policy: DROP POLICY + CREATE POLICY (drizzle-kit style).

Fields

§old_policy: Box<Policy>
§new_policy: Box<Policy>
§

AlterSequence

ALTER SEQUENCE with the changed options.

Fields

§old_sequence: Sequence
§new_sequence: Sequence
§

AlterRole

ALTER ROLE with the changed flags.

Fields

§old_role: Role
§new_role: Role
§

RecreateEnum

Recreate an enum type whose values were removed or reordered (drizzle-kit flow: alter dependent columns to text, drop + recreate the type, alter the columns back with USING ::text::type, restore defaults).

Fields

§old_enum: Enum
§new_enum: Enum
§columns: Vec<Column>

Columns (from the current schema) whose type is this enum.

Trait Implementations§

Source§

impl Clone for JsonStatement

Source§

fn clone(&self) -> JsonStatement

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 JsonStatement

Source§

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

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

impl Serialize for JsonStatement

Source§

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AliasExt for T

Source§

fn alias(self, name: &'static str) -> AliasedExpr<Self>

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<Mk> MarkerAggValidFor<()> for Mk

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Scope> ScopeSatisfies<Nil, ()> for Scope

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 = !

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