tree: ecdbba9f5dc7375119000b98c979fced57d69ac5 [path history] [tgz]
  1. src/
  2. tests/
  3. Cargo.toml
  4. README.md
diesel_codegen/README.md

Diesel Codegen

This crate implements Diesel's procedural macros using the Macros 1.1 system. It requires nightly Rust from October 10, 2016 or later. For usage on stable Rust, see diesel_codegen_syntex.

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.11.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.