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 |
#113 in #postgres
1,534 downloads per month
Used in 6 crates
(5 directly)
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
~5.5–10MB
~218K SLoC