Struct sea_query::extension::postgres::TypeCreateStatement [−][src]
This is supported on crate feature
backend-postgres
only.Implementations
impl TypeCreateStatement
[src]
pub fn new() -> Self
[src]
pub fn as_enum<T: 'static>(&mut self, name: T) -> &mut Self where
T: Iden,
[src]
T: Iden,
Create enum as custom type
use sea_query::{*, extension::postgres::Type}; enum FontFamily { Type, Serif, Sans, Monospace, } impl Iden for FontFamily { fn unquoted(&self, s: &mut dyn std::fmt::Write) { write!(s, "{}", match self { Self::Type => "font_family", Self::Serif => "serif", Self::Sans => "sans", Self::Monospace => "monospace", }).unwrap(); } } assert_eq!( Type::create() .as_enum(FontFamily::Type) .values(vec![FontFamily::Serif, FontFamily::Sans, FontFamily::Monospace]) .to_string(PostgresQueryBuilder), r#"CREATE TYPE "font_family" AS ENUM ('serif', 'sans', 'monospace')"# );
pub fn values<T: 'static>(&mut self, values: Vec<T>) -> &mut Self where
T: Iden,
[src]
T: Iden,
pub fn values_dyn(&mut self, values: Vec<Rc<dyn Iden>>) -> &mut Self
[src]
pub fn build<T: TypeBuilder>(&self, type_builder: T) -> (String, Vec<Value>)
[src]
pub fn build_ref<T: TypeBuilder>(
&self,
type_builder: &T
) -> (String, Vec<Value>)
[src]
&self,
type_builder: &T
) -> (String, Vec<Value>)
pub fn build_collect<T: TypeBuilder>(
&self,
type_builder: T,
collector: &mut dyn FnMut(Value)
) -> String
[src]
&self,
type_builder: T,
collector: &mut dyn FnMut(Value)
) -> String
pub fn build_collect_ref<T: TypeBuilder>(
&self,
type_builder: &T,
collector: &mut dyn FnMut(Value)
) -> String
[src]
&self,
type_builder: &T,
collector: &mut dyn FnMut(Value)
) -> String
pub fn to_string<T>(&self, type_builder: T) -> String where
T: TypeBuilder + QueryBuilder,
[src]
T: TypeBuilder + QueryBuilder,
Build corresponding SQL statement and return SQL string
Trait Implementations
impl Clone for TypeCreateStatement
[src]
fn clone(&self) -> TypeCreateStatement
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TypeCreateStatement
[src]
impl Default for TypeCreateStatement
[src]
fn default() -> TypeCreateStatement
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TypeCreateStatement
impl !Send for TypeCreateStatement
impl !Sync for TypeCreateStatement
impl Unpin for TypeCreateStatement
impl !UnwindSafe for TypeCreateStatement
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,