[−][src]Crate postgres_query
Exposes the trait Query
which can be used to execute queries against a
rust-postgres
database connection.
The trait Query
may be derived and used as follows:
#[derive(Query)] #[query(sql = "SELECT * FROM people WHERE name = $name AND age >= $min_age")] struct PersonByName { name: String, min_age: i32, } let get_person = PersonByName { name: "Josh".to_owned(), min_age: 19, }; let rows = get_person.query(&connection).unwrap();
Traits
Query | A type which can execute an SQL query. |
Derive Macros
Query |