pub fn query_string_to_sql(
table: &str,
query_string: &str,
) -> Result<QueryResult, Error>Expand description
Parses a PostgREST query string and converts it directly to SQL.
This is a convenience function that combines parse_query_string and to_sql.
§Arguments
table- The table name to queryquery_string- A PostgREST query string
§Returns
Returns a QueryResult containing the SQL query and parameters.
§Examples
use postgrest_parser::query_string_to_sql;
let result = query_string_to_sql(
"users",
"select=id,name,email&age=gte.18&status=eq.active"
).unwrap();
assert!(result.query.contains("SELECT"));
assert!(result.query.contains("\"id\""));
assert_eq!(result.tables, vec!["users"]);