rsyesql

Crates.iorsyesql
lib.rsrsyesql
version0.3.1
sourcesrc
created_at2020-04-15 08:06:40.657147
updated_at2020-04-15 08:35:14.7444
descriptionTransform SQL queries text to Rust strings.
homepage
repositoryhttps://github.com/fanatid/rsyesql
max_upload_size
id230409
size10,573
Kirill Fomichev (fanatid)

documentation

https://docs.rs/rsyesql/

README

rsyesql

crates.io docs.rs ci

Inspired by Yesql, see rational section there for more info.

Usage

queries.sql:

-- name: select
SELECT * FROM users;

-- name: delete
DELETE FROM users WHERE id = $1;

In Rust code:

let queries = rsyesql::parse(include_str!("./queries.sql"));
println!("{}", queries.get("select").unwrap()); // SELECT * FROM users;
println!("{}", queries.get("delete").unwrap()); // DELETE FROM users WHERE id = $1;

LICENSE MIT

Commit count: 12

cargo fmt