27 releases (15 breaking)

Uses old Rust 2015

0.16.1 May 27, 2018
0.16.0 Aug 24, 2017
0.15.0 Jul 23, 2017
0.12.0 Mar 16, 2017
0.2.0 Nov 30, 2015

#82 in #postgres

Download history 523/week @ 2024-03-13 487/week @ 2024-03-20 519/week @ 2024-03-27 499/week @ 2024-04-03 419/week @ 2024-04-10 572/week @ 2024-04-17 701/week @ 2024-04-24 454/week @ 2024-05-01 466/week @ 2024-05-08 428/week @ 2024-05-15 461/week @ 2024-05-22 539/week @ 2024-05-29 426/week @ 2024-06-05 349/week @ 2024-06-12 473/week @ 2024-06-19 329/week @ 2024-06-26

1,698 downloads per month
Used in 6 crates (5 directly)

MIT/Apache

2MB
36K SLoC

Diesel Codegen

This crate implements Diesel's procedural macros using the Macros 1.1 system. It depends on features introduced in Rust 1.15. Make sure to always use the latest stable release for optimal performance and feature support.

Diesel Codegen provides custom derive implementations for Queryable, Identifiable, Insertable, AsChangeset, and Associations. It also provides the macros infer_schema!, infer_table_from_schema!, and embed_migrations!.

Using this crate

First, add this crate to Cargo.toml as so:

diesel_codegen = { version = "0.16.0", features = ["postgres"] }

If you are using SQLite, be sure to specify sqlite instead of postgres in the features section.

Next, at the root of your crate add:

#[macro_use] extern crate diesel_codegen;

See the documentation for each trait/macro for additional details and configuration options.

Dependencies

~4–9MB
~190K SLoC