fn new(
        scx: &'a StatementContext,
        query: String,
        filter: Option<ShowStatementFilter<Raw>>,
        order: Option<&str>,
        projection: Option<&[&str]>,
    ) -> ShowSelect<'a> {
        let filter = match filter {
            Some(ShowStatementFilter::Like(like)) => format!("name LIKE {}", Value::String(like)),
            Some(ShowStatementFilter::Where(expr)) => expr.to_string(),
            None => "true".to_string(),
        };
        let query = format!(
            "SELECT {} FROM ({}) q WHERE {} ORDER BY {}",
            projection
                .map(|ps| ps.join(", "))
                .unwrap_or_else(|| "*".into()),
            query,
            filter,
            order.unwrap_or("q.*")
        );
        let stmts = parse::parse(&query).expect("ShowSelect::new called with invalid SQL");
        let stmt = match stmts.into_element() {
            Statement::Select(select) => select,
            _ => panic!("ShowSelect::new called with non-SELECT statement"),
        };
        ShowSelect { scx, stmt }
    }
/// Constructs a new [`ShowSelect`] from a query that provides the base
/// data and an optional user-supplied filter, order column, and
/// projection on that data.
///
/// Note that the query must return a column named `name`, as the filter
/// may implicitly reference this column. Any `ORDER BY` in the query is
/// ignored. `ShowSelects`s are always ordered in ascending order by all
/// columns from left to right unless an order field is supplied.
Constructs a new [`ShowSelect`] from a query that provides the base
data and an optional user-supplied filter, order column, and
projection on that data.

Note that the query must return a column named `name`, as the filter
may implicitly reference this column. Any `ORDER BY` in the query is
ignored. `ShowSelects`s are always ordered in ascending order by all
columns from left to right unless an order field is supplied.
Constructs a new [ ` ShowSelect ` ] from a query that provides the base data and an optional user - supplied filter order column and projection on that data . Note that the query must return a column named ` name ` as the filter may implicitly reference this column . Any ` ORDER BY ` in the query is ignored . ` ShowSelects ` s are always ordered in ascending order by all columns from left to right unless an order field is supplied .
fn new(
        scx: &'a StatementContext,
        query: String,
        filter: Option<ShowStatementFilter<Raw>>,
        order: Option<&str>,
        projection: Option<&[&str]>,
    ) -> ShowSelect<'a> {
        let filter = match filter {
            Some(ShowStatementFilter::Like(like)) => format!("name LIKE {}", Value::String(like)),
            Some(ShowStatementFilter::Where(expr)) => expr.to_string(),
            None => "true".to_string(),
        };
        let query = format!(
            "SELECT {} FROM ({}) q WHERE {} ORDER BY {}",
            projection
                .map(|ps| ps.join(", "))
                .unwrap_or_else(|| "*".into()),
            query,
            filter,
            order.unwrap_or("q.*")
        );
        let stmts = parse::parse(&query).expect("ShowSelect::new called with invalid SQL");
        let stmt = match stmts.into_element() {
            Statement::Select(select) => select,
            _ => panic!("ShowSelect::new called with non-SELECT statement"),
        };
        ShowSelect { scx, stmt }
    }
fn new ( scx : & ' a StatementContext , query : String , filter : Option < ShowStatementFilter < Raw > > , order : Option < & str > , projection : Option < & [ & str ] > , ) -> ShowSelect < ' a > { let filter = match filter { Some ( ShowStatementFilter :: Like ( like ) ) => format ! ( " " Value String ( like ) ) , Some ( ShowStatementFilter :: Where ( expr ) ) => expr . to_string ( ) , None => " " . to_string ( ) , } ; let query = format ! ( " " projection map ( ps ps join ( " " ) ) unwrap_or_else ( " " into ( ) ) query filter order unwrap_or ( " " ) ) ; let stmts = parse :: parse ( & query ) . expect ( " " ) ; let stmt = match stmts . into_element ( ) { Statement :: Select ( select ) => select , _ => panic ! ( " " ) , } ; ShowSelect { scx , stmt } }
Constructs a new [`ShowSelect`] from a query that provides the base
data and an optional user-supplied filter, order column, and
projection on that data.
Constructs a new [ ` ShowSelect ` ] from a query that provides the base data and an optional user - supplied filter order column and projection on that data .
scx
&'a StatementContext
query
String
filter
Option<ShowStatementFilter<Raw>>
order
Option<&str>
projection
Option<&[&str]>
scx
&'a StatementContext
query
String
filter
Option<ShowStatementFilter<Raw>>
order
Option<&str>
projection
Option<&[&str]>