Skip to content

Commit

Permalink
Release v1.3.0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sgrif committed May 22, 2018
1 parent 433a93c commit e319bd1
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 53 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All user visible changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/), as described
for Rust libraries in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/text/1105-api-evolution.md)

## Unreleased
## [1.3.0] - 2018-05-22

### Added

Expand Down Expand Up @@ -1510,3 +1510,4 @@ for Rust libraries in [RFC #1105](https://github.com/rust-lang/rfcs/blob/master/
[1.2.0]: https://github.com/diesel-rs/diesel/compare/v1.1.2...v1.2.0
[1.2.1]: https://github.com/diesel-rs/diesel/compare/v1.2.0...v1.2.1
[1.2.2]: https://github.com/diesel-rs/diesel/compare/v1.2.1...v1.2.2
[1.3.0]: https://github.com/diesel-rs/diesel/compare/v1.2.2...v1.3.0
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ members = [
]

[replace]
"diesel:1.2.2" = { path = "diesel" }
"diesel_derives:1.2.0" = { path = "diesel_derives" }
"diesel_infer_schema:1.2.0" = { path = "diesel_infer_schema" }
"infer_schema_macros:1.2.0" = { path = "diesel_infer_schema/infer_schema_macros" }
"infer_schema_internals:1.2.0" = { path = "diesel_infer_schema/infer_schema_internals" }
"diesel_migrations:1.2.0" = { path = "diesel_migrations" }
"migrations_internals:1.2.0" = { path = "diesel_migrations/migrations_internals" }
"migrations_macros:1.2.0" = { path = "diesel_migrations/migrations_macros" }
"diesel:1.3.0" = { path = "diesel" }
"diesel_derives:1.3.0" = { path = "diesel_derives" }
"diesel_infer_schema:1.3.0" = { path = "diesel_infer_schema" }
"infer_schema_macros:1.3.0" = { path = "diesel_infer_schema/infer_schema_macros" }
"infer_schema_internals:1.3.0" = { path = "diesel_infer_schema/infer_schema_internals" }
"diesel_migrations:1.3.0" = { path = "diesel_migrations" }
"migrations_internals:1.3.0" = { path = "diesel_migrations/migrations_internals" }
"migrations_macros:1.3.0" = { path = "diesel_migrations/migrations_macros" }
4 changes: 2 additions & 2 deletions diesel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel"
version = "1.2.2"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL"
Expand All @@ -13,7 +13,7 @@ categories = ["database"]

[dependencies]
byteorder = "1.0"
diesel_derives = "~1.2.0"
diesel_derives = "~1.3.0"
chrono = { version = "0.4", optional = true }
clippy = { optional = true, version = "=0.0.195" }
libc = { version = "0.2.0", optional = true }
Expand Down
8 changes: 4 additions & 4 deletions diesel_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel_cli"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Provides the CLI for the Diesel crate"
Expand All @@ -18,10 +18,10 @@ path = "src/main.rs"
chrono = "0.4"
clap = "2.27"
clippy = { optional = true, version = "=0.0.195" }
diesel = { version = "~1.2.0", default-features = false }
diesel = { version = "~1.3.0", default-features = false }
dotenv = ">=0.8, <0.11"
infer_schema_internals = { version = "~1.2.0", features = ["serde"] }
migrations_internals = "~1.2.0"
infer_schema_internals = { version = "~1.3.0", features = ["serde"] }
migrations_internals = "~1.3.0"
serde = { version = "1.0.0", features = ["derive"] }
tempfile = "3.0.0"
toml = "0.4.6"
Expand Down
6 changes: 3 additions & 3 deletions diesel_compile_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ authors = ["Sean Griffin <[email protected]>"]
[workspace]

[dependencies]
diesel = { version = "1.2.0", default-features = false, features = ["extras", "sqlite", "postgres", "mysql", "unstable"] }
diesel = { version = "1.3.0", default-features = false, features = ["extras", "sqlite", "postgres", "mysql", "unstable"] }
compiletest_rs = "=0.3.11"

[replace]
"diesel:1.2.2" = { path = "../diesel" }
"diesel_derives:1.2.0" = { path = "../diesel_derives" }
"diesel:1.3.0" = { path = "../diesel" }
"diesel_derives:1.3.0" = { path = "../diesel_derives" }
4 changes: 2 additions & 2 deletions diesel_derives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel_derives"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "You should not use this crate directly, it is internal to Diesel."
Expand All @@ -16,7 +16,7 @@ proc-macro2 = "0.3.0"

[dev-dependencies]
cfg-if = "0.1.0"
diesel = "1.2.0"
diesel = "1.3.0"
dotenv = "0.10.0"

[lib]
Expand Down
6 changes: 3 additions & 3 deletions diesel_infer_schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel_infer_schema"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Provides functionality to infer the schema of a database"
Expand All @@ -10,11 +10,11 @@ repository = "https://github.com/diesel-rs/diesel"
keywords = ["diesel"]

[dependencies]
infer_schema_macros = { version = "~1.2.0", default-features = false }
infer_schema_macros = { version = "~1.3.0", default-features = false }
clippy = { optional = true, version = "=0.0.195" }

[dev-dependencies]
diesel = { version = "1.2.0", default-features = false }
diesel = { version = "1.3.0", default-features = false }
dotenv = ">= 0.8, <0.11"
cfg-if = "0.1.0"

Expand Down
4 changes: 2 additions & 2 deletions diesel_infer_schema/infer_schema_internals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "infer_schema_internals"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Provides functionality to infer the schema of a database"
Expand All @@ -10,7 +10,7 @@ repository = "https://github.com/diesel-rs/diesel"
keywords = ["orm", "database", "postgres", "postgresql", "sql"]

[dependencies]
diesel = { version = "~1.2.0", default-features = false }
diesel = { version = "~1.3.0", default-features = false }
clippy = { optional = true, version = "=0.0.195" }
serde = { version = "1.0.0", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions diesel_infer_schema/infer_schema_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "infer_schema_macros"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "This crate is internal to diesel_infer_schema and should not be used directly"
Expand All @@ -9,7 +9,7 @@ description = "This crate is internal to diesel_infer_schema and should not be u
syn = { version = "0.11.4", features = ["aster"] }
quote = "0.3.12"
dotenv = { version = ">=0.8, <0.11", optional = true, default-features = false }
infer_schema_internals = { version = "~1.2.0", default-features = false }
infer_schema_internals = { version = "~1.3.0", default-features = false }
clippy = { optional = true, version = "=0.0.195" }

[dev-dependencies]
Expand Down
8 changes: 4 additions & 4 deletions diesel_migrations/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel_migrations"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Migration management for diesel"
Expand All @@ -10,11 +10,11 @@ homepage = "http://diesel.rs"

[dependencies]
clippy = { optional = true, version = "=0.0.195" }
migrations_internals = "~1.2.0"
migrations_macros = "~1.2.0"
migrations_internals = "~1.3.0"
migrations_macros = "~1.3.0"

[dev-dependencies]
diesel = { version = "1.2.0", default-features = false, features = ["sqlite", "postgres", "mysql"] }
diesel = { version = "1.3.0", default-features = false, features = ["sqlite", "postgres", "mysql"] }
dotenv = ">=0.8, <0.11"
cfg-if = "0.1.0"

Expand Down
4 changes: 2 additions & 2 deletions diesel_migrations/migrations_internals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "migrations_internals"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Internal implementation of diesels migration mechanism"
homepage = "http://diesel.rs"

[dependencies]
clippy = { optional = true, version = "=0.0.195" }
diesel = { version = "~1.2.0", default-features = false }
diesel = { version = "~1.3.0", default-features = false }
barrel = { version = "<= 0.2.0", optional = true, features = ["diesel-filled"] }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions diesel_migrations/migrations_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "migrations_macros"
version = "1.2.0"
version = "1.3.0"
authors = ["Sean Griffin <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Codegeneration macros for diesels embedded migrations"
Expand All @@ -9,7 +9,7 @@ homepage = "http://diesel.rs"

[dependencies]
clippy = { optional = true, version = "=0.0.195" }
migrations_internals = "~1.2.0"
migrations_internals = "~1.3.0"
syn = { version = "0.11.4", features = ["aster"] }
quote = "0.3.12"

Expand Down
6 changes: 3 additions & 3 deletions diesel_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ build = "build.rs"

[build-dependencies]
diesel = { path = "../diesel", default-features = false }
diesel_migrations = { version = "1.2.0" }
diesel_migrations = { version = "1.3.0" }
dotenv = ">=0.8, <0.11"

[dependencies]
assert_matches = "1.0.1"
chrono = { version = "0.4" }
diesel = { path = "../diesel", default-features = false, features = ["quickcheck", "chrono", "uuid", "serde_json", "network-address", "numeric", "with-deprecated"] }
diesel_infer_schema = { version = "1.2.0" }
diesel_migrations = { version = "1.2.0" }
diesel_infer_schema = { version = "1.3.0" }
diesel_migrations = { version = "1.3.0" }
dotenv = ">=0.8, <0.11"
quickcheck = { version = "0.4", features = ["unstable"] }
uuid = { version = ">=0.2.0, <0.7.0" }
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql/all_about_inserts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["mysql", "chrono"] }
diesel = { version = "1.3.0", features = ["mysql", "chrono"] }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql/getting_started_step_1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["mysql"] }
diesel = { version = "1.3.0", features = ["mysql"] }
dotenv = "0.10"
2 changes: 1 addition & 1 deletion examples/mysql/getting_started_step_2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["mysql"] }
diesel = { version = "1.3.0", features = ["mysql"] }
dotenv = "0.10"
2 changes: 1 addition & 1 deletion examples/mysql/getting_started_step_3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["mysql"] }
diesel = { version = "1.3.0", features = ["mysql"] }
dotenv = "0.10"
4 changes: 2 additions & 2 deletions examples/postgres/advanced-blog-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ authors = ["Sean Griffin <[email protected]>"]
[dependencies]
bcrypt = "0.1.0"
chrono = "0.4.0"
diesel = { version = "1.2.0", features = ["postgres", "chrono"] }
diesel = { version = "1.3.0", features = ["postgres", "chrono"] }
dotenv = "0.10.0"
structopt = "0.1.6"
structopt-derive = "0.1.6"
tempfile = "2.2.0"

[dev-dependencies]
assert_matches = "1.1"
diesel_migrations = { version = "1.2.0", features = ["postgres"] }
diesel_migrations = { version = "1.3.0", features = ["postgres"] }
lazy_static = "1.0"
2 changes: 1 addition & 1 deletion examples/postgres/all_about_inserts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["postgres"] }
diesel = { version = "1.3.0", features = ["postgres"] }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
2 changes: 1 addition & 1 deletion examples/postgres/all_about_updates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["postgres"] }
diesel = { version = "1.3.0", features = ["postgres"] }
2 changes: 1 addition & 1 deletion examples/postgres/getting_started_step_1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["postgres"] }
diesel = { version = "1.3.0", features = ["postgres"] }
dotenv = "0.10"
2 changes: 1 addition & 1 deletion examples/postgres/getting_started_step_2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["postgres"] }
diesel = { version = "1.3.0", features = ["postgres"] }
dotenv = "0.10"
2 changes: 1 addition & 1 deletion examples/postgres/getting_started_step_3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["postgres"] }
diesel = { version = "1.3.0", features = ["postgres"] }
dotenv = "0.10"
2 changes: 1 addition & 1 deletion examples/sqlite/all_about_inserts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Sean Griffin <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["sqlite", "chrono"] }
diesel = { version = "1.3.0", features = ["sqlite", "chrono"] }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlite/getting_started_step_1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "MIT OR Apache-2.0"
authors = ["Taryn Hill <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["sqlite"] }
diesel = { version = "1.3.0", features = ["sqlite"] }
dotenv = "0.10"
2 changes: 1 addition & 1 deletion examples/sqlite/getting_started_step_2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "MIT OR Apache-2.0"
authors = ["Taryn Hill <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["sqlite"] }
diesel = { version = "1.3.0", features = ["sqlite"] }
dotenv = "0.10"
2 changes: 1 addition & 1 deletion examples/sqlite/getting_started_step_3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "MIT OR Apache-2.0"
authors = ["Taryn Hill <[email protected]>"]

[dependencies]
diesel = { version = "1.2.0", features = ["sqlite"] }
diesel = { version = "1.3.0", features = ["sqlite"] }
dotenv = "0.10"

0 comments on commit e319bd1

Please sign in to comment.