Simple SQL code generator. May be used with pooled Sqlite3 connection.
To use sqlite3builder
, first add this to your Cargo.toml
:
[dependencies]
sqlite3builder = "0.3"
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("salary > 25000")
.sql()?;
assert_eq!("SELECT id, name FROM company WHERE salary > 25000;", &sql);
- SELECT
- INSERT
- UPDATE
- DELETE
- join
- distinct
- group by
- order by
- where
- limit, offset
- subquery
- get all results
- get first row
- get first value, first integer value, first string value
- escape
- query
This project is licensed under the MIT license.