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:
[]
= "0.5"
Example
let query = select
.fields
.filter
.order_by
.build;
assert_eq!;
See included tests for additional examples.
Features
Statements
DELETE
WHERE
clause
INSERT
SELECT
- Table alias (
AS
) - Field selection
JOIN
clauseWHERE
clauseORDER BY
clauseLIMIT
andOFFSET
clause
- Table alias (
UPDATE
WHERE
clause
Documentation
- "First Steps" (recommended for beginners)
- API documentation
License
MIT