pub struct GenericSQLVirtualServerModel(/* private fields */);Expand description
A stateless SQL query builder virtual server operations.
This struct generates SQL query strings without executing them, allowing the caller to execute the queries against a SQL connection.
Implementations§
Source§impl GenericSQLVirtualServerModel
impl GenericSQLVirtualServerModel
Sourcepub fn new(args: GenericSQLVirtualServerModelArgs) -> Self
pub fn new(args: GenericSQLVirtualServerModelArgs) -> Self
Creates a new GenericSQLVirtualServerModel instance.
Sourcepub fn get_hosted_tables(&self) -> GenericSQLResult<String>
pub fn get_hosted_tables(&self) -> GenericSQLResult<String>
Sourcepub fn table_schema(&self, table_id: &str) -> GenericSQLResult<String>
pub fn table_schema(&self, table_id: &str) -> GenericSQLResult<String>
Sourcepub fn table_size(&self, table_id: &str) -> GenericSQLResult<String>
pub fn table_size(&self, table_id: &str) -> GenericSQLResult<String>
Sourcepub fn view_column_size(&self, view_id: &str) -> GenericSQLResult<String>
pub fn view_column_size(&self, view_id: &str) -> GenericSQLResult<String>
Sourcepub fn table_validate_expression(
&self,
table_id: &str,
expression: &str,
) -> GenericSQLResult<String>
pub fn table_validate_expression( &self, table_id: &str, expression: &str, ) -> GenericSQLResult<String>
Sourcepub fn view_delete(&self, view_id: &str) -> GenericSQLResult<String>
pub fn view_delete(&self, view_id: &str) -> GenericSQLResult<String>
Sourcepub fn table_make_view(
&self,
table_id: &str,
view_id: &str,
config: &ViewConfig,
) -> GenericSQLResult<String>
pub fn table_make_view( &self, table_id: &str, view_id: &str, config: &ViewConfig, ) -> GenericSQLResult<String>
Returns the SQL query to create a view from a table with the given configuration.
§Arguments
table_id- The identifier of the source table.view_id- The identifier for the new view.config- The view configuration specifying columns, group_by, split_by, etc.
§Returns
SQL: CREATE TABLE {view_id} AS (...)
Sourcepub fn view_get_data(
&self,
view_id: &str,
config: &ViewConfig,
viewport: &ViewPort,
schema: &IndexMap<String, ColumnType>,
) -> GenericSQLResult<String>
pub fn view_get_data( &self, view_id: &str, config: &ViewConfig, viewport: &ViewPort, schema: &IndexMap<String, ColumnType>, ) -> GenericSQLResult<String>
Returns the SQL query to fetch data from a view with the given viewport.
§Arguments
view_id- The identifier of the view.config- The view configuration.viewport- The viewport specifying row/column ranges.schema- The schema of the view (column names to types).
§Returns
SQL: SELECT ... FROM {view_id} LIMIT ... OFFSET ...
Sourcepub fn view_schema(&self, view_id: &str) -> GenericSQLResult<String>
pub fn view_schema(&self, view_id: &str) -> GenericSQLResult<String>
Trait Implementations§
Source§impl Clone for GenericSQLVirtualServerModel
impl Clone for GenericSQLVirtualServerModel
Source§fn clone(&self) -> GenericSQLVirtualServerModel
fn clone(&self) -> GenericSQLVirtualServerModel
Returns a duplicate 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 GenericSQLVirtualServerModel
impl Debug for GenericSQLVirtualServerModel
Source§impl Default for GenericSQLVirtualServerModel
impl Default for GenericSQLVirtualServerModel
Source§fn default() -> GenericSQLVirtualServerModel
fn default() -> GenericSQLVirtualServerModel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GenericSQLVirtualServerModel
impl RefUnwindSafe for GenericSQLVirtualServerModel
impl Send for GenericSQLVirtualServerModel
impl Sync for GenericSQLVirtualServerModel
impl Unpin for GenericSQLVirtualServerModel
impl UnwindSafe for GenericSQLVirtualServerModel
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more