pub struct Column {
pub name: String,
pub column_type: ColumnType,
pub alias: String,
pub skip: bool,
}
Expand description
A column in a table
Fields§
§name: String
Name of the column
column_type: ColumnType
Type of the column (e.g. TEXT, INTEGER, etc)
alias: String
Alias for the column
skip: bool
Metadata for the column
Implementations§
Source§impl Column
impl Column
Sourcepub fn new(name: String, column_type: ColumnType) -> Self
pub fn new(name: String, column_type: ColumnType) -> Self
Create a new instance of Column
Sourcepub fn is_primary_key(&self) -> bool
pub fn is_primary_key(&self) -> bool
Check if the column is a primary key
Sourcepub fn is_not_null(&self) -> bool
pub fn is_not_null(&self) -> bool
Check if the column is nullable
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Column
impl<'de> Deserialize<'de> for Column
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ToSqlite for Column
impl ToSqlite for Column
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_alter(&self, query: &AlterQuery) -> Result<String, Error>
fn on_alter(&self, query: &AlterQuery) -> Result<String, Error>
Convert to SQLite for altering 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
Source§fn on_insert(&self, query: &QueryBuilder) -> Result<(String, Values), Error>
fn on_insert(&self, query: &QueryBuilder) -> Result<(String, Values), Error>
Convert to SQLite for inserting a row
Source§impl ToTokens for Column
impl ToTokens for Column
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request