sql-builder 0.10.3

Simple SQL code generator.

sql-builder

Build Status Latest Version Docs

Simple SQL code generator.

Usage

To use sql-builder, first add this to your Cargo.toml:

[dependencies]
sql-builder = "0.10"

Next, add this to your crate:

extern crate sql_builder;

use sql_builder::SqlBuilder;

Example:

let sql = SqlBuilder::select_from("company")
    .field("id")
    .field("name")
    .and_where_gt("salary", 25000)
    .sql()?;

assert_eq!("SELECT id, name FROM company WHERE salary > 25000;", &sql);

See more examples

SQL support

Statements

  • SELECT
  • INSERT
  • UPDATE
  • DELETE

Operations

  • join
  • distinct
  • group by
  • order by
  • where
  • union
  • limit, offset
  • subquery

Functions

  • escape
  • quote, double quote, back quote

License

This project is licensed under the MIT license.