pub trait TableLike:
ReadableValueSet
+ WritableValueSet
+ Send
+ Sync {
Show 14 methods
// Required methods
fn table_name(&self) -> &str;
fn table_alias(&self) -> &str;
fn column_names(&self) -> Vec<String>;
fn add_condition(
&mut self,
condition: Box<dyn Any + Send + Sync>,
) -> Result<()>;
fn temp_add_condition(
&mut self,
condition: AnyExpression,
) -> Result<ConditionHandle>;
fn temp_remove_condition(&mut self, handle: ConditionHandle) -> Result<()>;
fn search_expression(&self, search_value: &str) -> Result<AnyExpression>;
fn clone_box(
&self,
) -> Box<dyn TableLike<Value = Self::Value, Id = Self::Id>>;
fn into_any(self: Box<Self>) -> Box<dyn Any>;
fn as_any_ref(&self) -> &dyn Any;
fn set_pagination(&mut self, pagination: Option<Pagination>);
fn get_pagination(&self) -> Option<&Pagination>;
fn get_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn get_ref(&self, _relation: &str) -> Result<AnyTable> { ... }
}Expand description
Dyn-safe trait for table operations.
Required Methods§
fn table_name(&self) -> &str
fn table_alias(&self) -> &str
fn column_names(&self) -> Vec<String>
Sourcefn add_condition(&mut self, condition: Box<dyn Any + Send + Sync>) -> Result<()>
fn add_condition(&mut self, condition: Box<dyn Any + Send + Sync>) -> Result<()>
Add a condition to this table using a type-erased expression The expression must be of type T::Expr for the underlying table’s TableSource
Sourcefn temp_add_condition(
&mut self,
condition: AnyExpression,
) -> Result<ConditionHandle>
fn temp_add_condition( &mut self, condition: AnyExpression, ) -> Result<ConditionHandle>
Add a temporary condition using AnyExpression that can be removed later
Sourcefn temp_remove_condition(&mut self, handle: ConditionHandle) -> Result<()>
fn temp_remove_condition(&mut self, handle: ConditionHandle) -> Result<()>
Remove a temporary condition by its handle
Sourcefn search_expression(&self, search_value: &str) -> Result<AnyExpression>
fn search_expression(&self, search_value: &str) -> Result<AnyExpression>
Create a search expression for this table
Sourcefn clone_box(&self) -> Box<dyn TableLike<Value = Self::Value, Id = Self::Id>>
fn clone_box(&self) -> Box<dyn TableLike<Value = Self::Value, Id = Self::Id>>
Clone into a Box for object-safe cloning
fn as_any_ref(&self) -> &dyn Any
Sourcefn set_pagination(&mut self, pagination: Option<Pagination>)
fn set_pagination(&mut self, pagination: Option<Pagination>)
Set pagination for this table
Sourcefn get_pagination(&self) -> Option<&Pagination>
fn get_pagination(&self) -> Option<&Pagination>
Get pagination for this table
Provided Methods§
Sourcefn get_ref(&self, _relation: &str) -> Result<AnyTable>
fn get_ref(&self, _relation: &str) -> Result<AnyTable>
Traverse a named reference and return the related table as AnyTable.
Default impl returns an error so wrappers without ref support compile
unchanged. Table<T, E> overrides this to delegate to its inherent
get_ref; AnyTable, CborAdapter and LiveTable override to forward
through to the underlying table that holds the refs.