Enum geekorm::ColumnType
source · pub enum ColumnType {
Identifier(ColumnTypeOptions),
ForeignKey(ColumnTypeOptions),
Text(ColumnTypeOptions),
Integer(ColumnTypeOptions),
Boolean(ColumnTypeOptions),
Blob(ColumnTypeOptions),
}Expand description
A column type and its options / properties
Variants§
Identifier(ColumnTypeOptions)
Identifier column type (Primary Key) which is a UUID (TEXT)
ForeignKey(ColumnTypeOptions)
Foreign Key column type with the table name
Text(ColumnTypeOptions)
Text column type with options
Integer(ColumnTypeOptions)
Integer column type with options
Boolean(ColumnTypeOptions)
Boolean column type with options
Blob(ColumnTypeOptions)
Blob / Vec / List column type with options
Implementations§
source§impl ColumnType
impl ColumnType
sourcepub fn is_primary_key(&self) -> bool
pub fn is_primary_key(&self) -> bool
Check if the column type is a primary key
sourcepub fn is_auto_increment(&self) -> bool
pub fn is_auto_increment(&self) -> bool
Check if the column type is an auto increment
sourcepub fn is_foreign_key(&self) -> bool
pub fn is_foreign_key(&self) -> bool
Check if the column type is a foreign key
sourcepub fn is_foreign_key_table(&self, table: &String) -> bool
pub fn is_foreign_key_table(&self, table: &String) -> bool
Get the foreign key table & column name
Trait Implementations§
source§impl Clone for ColumnType
impl Clone for ColumnType
source§fn clone(&self) -> ColumnType
fn clone(&self) -> ColumnType
Returns a copy 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 moresource§impl Debug for ColumnType
impl Debug for ColumnType
source§impl<'de> Deserialize<'de> for ColumnType
impl<'de> Deserialize<'de> for ColumnType
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColumnType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColumnType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for ColumnType
impl Display for ColumnType
source§impl Serialize for ColumnType
impl Serialize for ColumnType
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
source§impl ToSqlite for ColumnType
impl ToSqlite for ColumnType
source§fn on_create(&self, query: &QueryBuilder) -> Result<String, Error>
fn on_create(&self, query: &QueryBuilder) -> Result<String, Error>
Convert to SQLite for creating a table
source§fn on_select(&self, query: &QueryBuilder) -> Result<String, Error>
fn on_select(&self, query: &QueryBuilder) -> Result<String, Error>
Convert to SQLite for selecting a row
Auto Trait Implementations§
impl Freeze for ColumnType
impl RefUnwindSafe for ColumnType
impl Send for ColumnType
impl Sync for ColumnType
impl Unpin for ColumnType
impl UnwindSafe for ColumnType
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)