Release v1.3.0

New Features
==

This release includes a couple of major changes to how Diesel projects
are developed. In the past, we've had 2 ways to generate `schema.rs`. A
procedural macro called `infer_schema!`, and a CLI command `diesel
print-schema`. We've recommended using the CLI command for a long time,
but `infer_schema!` was still useful for early prototypes.

At the beginning of a project, your database schema changes much more
frequently. It's extremely annoying to have to remember to run a
second command after running your migrations.

Diesel CLI 1.3 now supports a configuration file to customize its
behavior. One of the new capabilities this provides is the ability to
automatically regenerate `schema.rs` whenever you run or revert a
migration. This means you no longer have to remember to run `diesel
print-schema` when things change.

Because of this, we are deprecating `diesel_infer_schema`. 1.3 will be
the final release of that crate. However, `diesel_infer_schema` 1.3 will
continue to work with `diesel` until at least Diesel 2.0. You can see
all of the capabilities of the new configuration file at
http://diesel.rs/guides/configuring-diesel-cli.

This release also includes a complete redesign of the [`sql_function!`]
macro. The new syntax is significantly closer to normal Rust. For
example, what used to be written as:

```rust
sql_function! {
    lower, lower_t, (x: Text) -> Text,
    "Here are the docs for `lower`
It's awkward to make multiline"
}
```

Can now be written as:

```rust
sql_function! {
    /// Here are the docs for `lower`
    /// It's just a normal doc comment.
    fn lower(x: Text) -> Text;
}
```

The new form also supports much more than the old one, including
aggregate functions, function renaming, and generic functions. Things
like `MAX` could previously not be expressed with `sql_function!`.
However, now the definition looks like this:

```rust
sql_function! {
    #[aggregate]
    fn max<ST: SqlOrd + IntoNullable>(expr: ST) -> ST::Nullable;
}
```

Finally, the redesigned `sql_function!` supoprts user defined
functions on SQLite. SQLite differs from other databases, in that custom
functions aren't defined in SQL. Instead you give it a C function
pointer to use for the body. With Diesel, you can just give us any Rust
closure that takes appropriate argument types, and we'll handle gluing
that to SQLite for you.

You can find examples for all of this in [the docs for
`sql_function!`][`sql_function!`].

[`sql_function!`]: http://docs.diesel.rs/diesel/macro.sql_function.html

In addition to the headline features, this release includes a ton of
quality of life changes including expanded support for locking clauses,
more global support for mathematic operators, and more. As always, for a
full list of changes you can find it in [the changelog].

[the changelog]: https://github.com/diesel-rs/diesel/blob/v1.3.0/CHANGELOG.md

Thanks
==

Thank you to everyone who helped make this release happen through bug
reports, and discussion on Gitter. While we don't have a way to collect
stats on that form of contribution, it's greatly appreciated.

In addition to the Diesel core team, 12 people contributed code to this
release. A huge thank you to:

- Aleksey Ivanov
- Christopher Brickley
- David Reid
- Diggory Blake
- Graham Turner
- Katharina
- Matt Kraai
- Nick Babcock
- Richard Petrie
- Simon Dickson
- Sunrin SHIMURA
- Thierry Berger
27 files changed
tree: 92b275d97c6e88a8da1fc6c83d319a03b0b66ec7
  1. .github/
  2. bin/
  3. diesel/
  4. diesel_cli/
  5. diesel_compile_tests/
  6. diesel_derives/
  7. diesel_infer_schema/
  8. diesel_migrations/
  9. diesel_tests/
  10. examples/
  11. guide_drafts/
  12. migrations/
  13. .appveyor.yml
  14. .editorconfig
  15. .env.sample
  16. .gitignore
  17. .rustfmt.toml
  18. .travis.yml
  19. Cargo.toml
  20. CHANGELOG.md
  21. clippy.toml
  22. code_of_conduct.md
  23. CONTRIBUTING.md
  24. LICENSE-APACHE
  25. LICENSE-MIT
  26. README.md
README.md

A safe, extensible ORM and Query Builder for Rust

Build Status Appveyor Build Status Gitter Crates.io

API Documentation: latest releasemaster branch

Homepage

Diesel gets rid of the boilerplate for database interaction and eliminates runtime errors without sacrificing performance. It takes full advantage of Rust's type system to create a low overhead query builder that “feels like Rust.”

Getting Started

Find our extensive Getting Started tutorial at https://diesel.rs/guides/getting-started. Guides on more specific features are coming soon.

Getting help

If you run into problems, Diesel has a very active Gitter room. You can come ask for help at gitter.im/diesel-rs/diesel

Code of conduct

Anyone who interacts with Diesel in any space, including but not limited to this GitHub repository, must follow our code of conduct.

License

Licensed under either of these:

Contributing

Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in the work, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.