Pinto

Pinto is a small, easy-to-use library for constructing SQL queries programmatically in Rust.

⚠️ This library does not provide query parameterization. Do not use raw user-supplied data in your queries. If inputs are not properly escaped, your software will be suspectible to SQL injection attacks.

Compatibility

The library aims to generate queries compatible with PostgreSQL, MySQL, and SQLite.

Install

Add pinto as a dependency:

toml [dependencies] pinto = "0.4"

Example

```rust let query = querybuilder::select("users") .fields(&["id", "name"]) .filter("name = $1") .orderby("id", query_builder::Order::Asc) .build();

assert_eq!("SELECT id, name FROM users WHERE name = $1 ORDER BY id ASC;", query); ```

See included tests for additional examples.

Features

Statements

Documentation

License

MIT