postgres-querybuilder 0.3.0

A simple tool to help you build your postgres queries easily
Documentation

Postgres QueryBuilder

postgres-querybuilder is a tool to help you write dynamic sql queries in rust and make them work with rust-postgres.

Example

let client = pool.get().await?;
let mut builder = SelectBuilder::new("users");
builder.select("id");
builder.select("email");
builder.where_eq("password", "123456".to_string());
let query = builder.get_query();
let params = builder.get_ref_params();
let stmt = client.prepare(query.as_str()).await?;
let rows = client.query(&stmt, &params).await?;
let user = rows.first().map(User::from);

TODO

  • Select query
    • choose columns
    • where equal
    • where not equal
    • or where condition
    • group by
    • limit
    • offset
    • order by
    • WITH query
  • Update query
    • set value
    • where equal
    • where not equal
    • or where condition
    • returning
    • WITH query
  • Insert query
  • Delete query
  • from subrequest