Struct TypeDropStatement
pub struct TypeDropStatement { /* private fields */ }Implementations§
§impl TypeDropStatement
impl TypeDropStatement
pub fn new() -> Self
pub fn name<T>(&mut self, name: T) -> &mut Selfwhere
T: IntoTypeRef,
pub fn name<T>(&mut self, name: T) -> &mut Selfwhere
T: IntoTypeRef,
Drop a type
use sea_query::{extension::postgres::Type, *};
struct FontFamily;
impl Iden for FontFamily {
fn unquoted(&self) -> &str {
"font_family"
}
}
assert_eq!(
Type::drop()
.if_exists()
.name(FontFamily)
.restrict()
.to_string(PostgresQueryBuilder),
r#"DROP TYPE IF EXISTS "font_family" RESTRICT"#
);pub fn names<T, I>(&mut self, names: I) -> &mut Selfwhere
T: IntoTypeRef,
I: IntoIterator<Item = T>,
pub fn names<T, I>(&mut self, names: I) -> &mut Selfwhere
T: IntoTypeRef,
I: IntoIterator<Item = T>,
Drop multiple types
use sea_query::{extension::postgres::Type, *};
#[derive(Iden)]
enum KycStatus {
#[iden = "kyc_status"]
Type,
Pending,
Approved,
}
#[derive(Iden)]
enum FontFamily {
#[iden = "font_family"]
Type,
Aerial,
Forte,
}
assert_eq!(
Type::drop()
.if_exists()
.names([KycStatus::Type.into_iden(), FontFamily::Type.into_iden()])
.cascade()
.to_string(PostgresQueryBuilder),
r#"DROP TYPE IF EXISTS "kyc_status", "font_family" CASCADE"#
);pub fn if_exists(&mut self) -> &mut Self
pub fn if_exists(&mut self) -> &mut Self
Set IF EXISTS
pub fn cascade(&mut self) -> &mut Self
pub fn cascade(&mut self) -> &mut Self
Set CASCADE
pub fn restrict(&mut self) -> &mut Self
pub fn restrict(&mut self) -> &mut Self
Set RESTRICT
§impl TypeDropStatement
impl TypeDropStatement
pub fn build_ref<T: TypeBuilder>(&self, type_builder: &T) -> String
pub fn build_collect<T: TypeBuilder>( &self, type_builder: T, sql: &mut impl SqlWriter, ) -> String
pub fn build_collect_ref<T: TypeBuilder>( &self, type_builder: &T, sql: &mut impl SqlWriter, ) -> String
pub fn to_string<T>(&self, type_builder: T) -> Stringwhere
T: TypeBuilder + QueryBuilder,
pub fn to_string<T>(&self, type_builder: T) -> Stringwhere
T: TypeBuilder + QueryBuilder,
Build corresponding SQL statement and return SQL string
Trait Implementations§
§impl Clone for TypeDropStatement
impl Clone for TypeDropStatement
§fn clone(&self) -> TypeDropStatement
fn clone(&self) -> TypeDropStatement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for TypeDropStatement
impl Debug for TypeDropStatement
§impl Default for TypeDropStatement
impl Default for TypeDropStatement
§fn default() -> TypeDropStatement
fn default() -> TypeDropStatement
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeDropStatement
impl RefUnwindSafe for TypeDropStatement
impl Send for TypeDropStatement
impl Sync for TypeDropStatement
impl Unpin for TypeDropStatement
impl UnwindSafe for TypeDropStatement
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
Mutably borrows from an owned value. Read more