5 unstable releases

Uses old Rust 2015

0.9.0 Dec 8, 2016
0.8.0 Oct 10, 2016
0.7.2 Aug 20, 2016
0.7.1 Aug 11, 2016
0.7.0 Aug 1, 2016

#1649 in Database interfaces

Download history 45/week @ 2023-01-17 83/week @ 2023-01-24 88/week @ 2023-01-31 72/week @ 2023-02-07 73/week @ 2023-02-14 66/week @ 2023-02-21 52/week @ 2023-02-28 53/week @ 2023-03-07 67/week @ 2023-03-14 57/week @ 2023-03-21 51/week @ 2023-03-28 45/week @ 2023-04-04 70/week @ 2023-04-11 28/week @ 2023-04-18 70/week @ 2023-04-25 69/week @ 2023-05-02

244 downloads per month

MIT/Apache

1.5MB
33K SLoC

Diesel Codegen Syntex

Provides the functionality of diesel_codegen using Syntex for usage on stable.

Getting started

Add diesel_codegen_syntex to your Cargo.toml, specifying which backends you use.

diesel_codegen_syntex = { version = "0.9.0", features = ["postgres"] }

Next, move the mod declarations of any modules that need codegen to a separate file, such as lib.in.rs, like so:

// main.in.rs
mod schema;
mod models;
// main.rs
include!(concat!(env!("OUT_DIR"), "/main.rs"));

Finally, add a build file which calls diesel_codgen_syntex::expand

// build.rs
fn main() {
    let out_dir = env::var("OUT_DIR").unwrap();
    let src = Path::new("src/main.in.rs");
    let dst = Path::new(&out_dir).join("main.rs");
    diesel_codegen_syntex::expand(&src, &dst).unwrap();
}

For more examples, please see section 4 of the getting started guide

Dependencies

~2.3–5.5MB
~112K SLoC