pub struct SummaryResult {
pub protobuf: SummaryResult,
pub warnings: Vec<String>,
pub tables: Vec<Table>,
pub aliases: HashMap<String, String>,
pub cte_names: Vec<String>,
pub functions: Vec<Function>,
pub filter_columns: Vec<FilterColumn>,
pub truncated_query: String,
pub statement_types: Vec<String>,
}Expand description
Result from calling summary. Where possible, this is API-compatible with ParseResult.
The main distinction is that summary does truncation on the C side,
whereas parse does it on the Rust side. This requires passing the
maximum length ahead of time to summary(query, max_length).
This means that summary(query, max_length).truncated_query is equivalent
to parse(query).truncate(max_length)
For tables, functions, and filter_columns, SummaryResult stores
more details than ParseResult, so the signatures have changed.
However, the functions that correspond to them should be equivalent.
Fields§
§protobuf: SummaryResult§warnings: Vec<String>§tables: Vec<Table>§aliases: HashMap<String, String>§cte_names: Vec<String>§functions: Vec<Function>§filter_columns: Vec<FilterColumn>§truncated_query: String§statement_types: Vec<String>Implementations§
Source§impl SummaryResult
impl SummaryResult
pub fn new(protobuf: SummaryResult, stderr: String) -> Self
Sourcepub fn select_tables(&self) -> Vec<String>
pub fn select_tables(&self) -> Vec<String>
Returns only tables that were selected from
Sourcepub fn dml_tables(&self) -> Vec<String>
pub fn dml_tables(&self) -> Vec<String>
Returns only tables that were modified by the query
Sourcepub fn ddl_tables(&self) -> Vec<String>
pub fn ddl_tables(&self) -> Vec<String>
Returns only tables that were modified by DDL statements
Sourcepub fn ddl_functions(&self) -> Vec<String>
pub fn ddl_functions(&self) -> Vec<String>
Returns DDL functions
Sourcepub fn call_functions(&self) -> Vec<String>
pub fn call_functions(&self) -> Vec<String>
Returns functions that were called
Sourcepub fn statement_types(&self) -> Vec<&str>
pub fn statement_types(&self) -> Vec<&str>
Returns all statement types in the query
Trait Implementations§
Source§impl Debug for SummaryResult
impl Debug for SummaryResult
Source§impl PartialEq for SummaryResult
impl PartialEq for SummaryResult
impl StructuralPartialEq for SummaryResult
Auto Trait Implementations§
impl Freeze for SummaryResult
impl RefUnwindSafe for SummaryResult
impl Send for SummaryResult
impl Sync for SummaryResult
impl Unpin for SummaryResult
impl UnsafeUnpin for SummaryResult
impl UnwindSafe for SummaryResult
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
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>
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>
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