pub struct Table {
pub name: String,
pub columns: Columns,
}
Expand description
The Table struct for defining a table
Fields§
§name: String
Name of the table
columns: Columns
Columns in the table
Implementations§
Source§impl Table
impl Table
Sourcepub fn is_valid_column(&self, column: &str) -> bool
pub fn is_valid_column(&self, column: &str) -> bool
Function to check if a column name is valid
Sourcepub fn get_primary_key(&self) -> String
pub fn get_primary_key(&self) -> String
Get the name of the primary key column
Sourcepub fn get_foreign_key(&self, table_name: String) -> &Column
pub fn get_foreign_key(&self, table_name: String) -> &Column
Get the foreign key by table name
Sourcepub fn get_fullname(&self, column: &str) -> Result<String, Error>
pub fn get_fullname(&self, column: &str) -> Result<String, Error>
Get the full name of a column (table.column)
Sourcepub fn get_dependencies(&self) -> Vec<String>
pub fn get_dependencies(&self) -> Vec<String>
Get dependencies for the table
This is a list of tables that the table depends on
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
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 Table
impl ToSqlite for Table
Source§fn on_delete(&self, query: &QueryBuilder) -> Result<(String, Values), Error>
fn on_delete(&self, query: &QueryBuilder) -> Result<(String, Values), Error>
Function to delete a row from the table
Only supports deleting by primary key
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, qb: &QueryBuilder) -> Result<String, Error>
fn on_select(&self, qb: &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 Table
Implement the ToTokens
trait for the Table
struct
impl ToTokens for Table
Implement the ToTokens
trait for the Table
struct
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 Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
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