pub struct Column {
pub name: &'static str,
pub sql_type: &'static str,
pub not_null: bool,
}Expand description
A column of a Table.
Fields§
§name: &'static strThe column name, as it appears in the CSV header row.
sql_type: &'static strThe SQL type, for example "VARCHAR(30)" or "DECIMAL(10,4)".
not_null: boolWhether the column is declared NOT NULL.
Implementations§
Source§impl Column
impl Column
Sourcepub const fn new(
name: &'static str,
sql_type: &'static str,
not_null: bool,
) -> Self
pub const fn new( name: &'static str, sql_type: &'static str, not_null: bool, ) -> Self
Creates a column, given its name, its SQL type, and whether it
is declared NOT NULL.
Sourcepub fn base_type(&self) -> &'static str
pub fn base_type(&self) -> &'static str
Returns the SQL type without its precision, for example
"DECIMAL" given "DECIMAL(10,4)".
Sourcepub fn is_character(&self) -> bool
pub fn is_character(&self) -> bool
Returns whether values of this column need quoting in SQL.
Trait Implementations§
impl Copy for Column
impl Eq for Column
impl StructuralPartialEq for Column
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl UnwindSafe for Column
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