Skip to main content

operation_to_sql

Function operation_to_sql 

Source
pub fn operation_to_sql(
    table: &str,
    operation: &Operation,
) -> Result<QueryResult, Error>
Expand description

Converts an Operation to SQL

§Arguments

  • table - Table name (can be schema-qualified)
  • operation - The operation to convert

§Examples

use postgrest_parser::{parse, operation_to_sql};

let op = parse("GET", "users", "id=eq.123", None, None).unwrap();
let result = operation_to_sql("users", &op).unwrap();
assert!(result.query.contains("SELECT"));