Skip to content

Commit

Permalink
Merge pull request #3260 from weiznich/prepare_2.0_release
Browse files Browse the repository at this point in the history
Prepare 2.0 release
  • Loading branch information
weiznich authored Aug 29, 2022
2 parents 10c369e + 107ea0f commit 269e8b2
Show file tree
Hide file tree
Showing 214 changed files with 7,960 additions and 3,054 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/benches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,21 @@ jobs:
echo 'DATABASE_URL=mysql://root:root@localhost/diesel_test' >> $GITHUB_ENV
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable

- name: Install critcmp
uses: actions-rs/cargo@v1
with:
command: install
args: critcmp
run: cargo +stable install critcmp

- name: Benchmark changes
uses: actions-rs/cargo@v1
with:
command: bench
args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline changes
run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline changes

- name: Checkout master
run: |
git fetch origin
git reset --hard origin/master
- name: Benchmark master
uses: actions-rs/cargo@v1
with:
command: bench
args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline master
run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline master

- name: Critcmp
run: |
Expand Down
276 changes: 117 additions & 159 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ jobs:
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,19 @@ jobs:
echo 'DATABASE_URL=mysql://root:root@localhost/diesel_test' >> $GITHUB_ENV
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
uses: dtolnay/rust-toolchain@stable

- name: Run Benchmarks (Postgres)
if: matrix.backend == 'postgres'
uses: actions-rs/cargo@v1
with:
command: bench
args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} rust_postgres futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/postgresql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"
run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} rust_postgres futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/postgresql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"

- name: Run Benchmarks (Sqlite)
if: matrix.backend == 'sqlite'
uses: actions-rs/cargo@v1
with:
command: bench
args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rusqlite futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio"
run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rusqlite futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio"

- name: Run Benchmarks (Mysql)
if: matrix.backend == 'mysql'
uses: actions-rs/cargo@v1
with:
command: bench
args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rustorm rustorm/with-${{matrix.backend}} rustorm_dao rust_mysql futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/mysql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"
run: cargo +stable bench --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}} sqlx-bench sqlx/${{matrix.backend}} tokio rustorm rustorm/with-${{matrix.backend}} rustorm_dao rust_mysql futures sea-orm sea-orm/sqlx-${{matrix.backend}} criterion/async_tokio quaint quaint/mysql quaint/serde-support serde diesel-async diesel-async/${{matrix.backend}}"

- name: Push metrics
env:
Expand All @@ -96,6 +83,7 @@ jobs:
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "${{ secrets.METRIC_ACCESS_KEY }}" >> ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
rm diesel_bench/target/release -rf
git clone --depth 1 git@github.com:diesel-rs/metrics.git
Expand Down
43 changes: 20 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,9 @@ default features enabled using some set of dependencies. Those set of dependenci
an up to date version of the specific dependency. We check this by using the unstable `-Z minimal-version` cargo flag.
Increasing the minimal supported Rust version will always be coupled at least with a minor release.

## [2.0.0 Rc1] 2022-07-22
## Unreleased

### Changed

* We've changed the `RunQueryDsl::load_iter` interface to support different
loading modes. This enables us to support more than one strategy for loading
values by iterator from the database.

### Added

* Adds an `ipnet-address` feature flag, allowing support (de)serializing IP
values from the database using types provided by `ipnet`. This feature
may be enabled concurrently with the previously existing `network-address`
feature.
* We've added support for loading values using libpq's row-by-row mode via
the new iterator interface

### Fixed

* Updated `ipnetwork` to allow version 0.20.
* Updated `libsqlite3-sys` to allow version 0.25
* Fix a bug that prevents connection reusing with r2d2

## [2.0.0 Rc0] 2022-04-22
## [2.0.0] 2022-08-29

### Added

Expand Down Expand Up @@ -109,6 +88,17 @@ the new iterator interface

* Added support for updating individual array elements `UPDATE table SET array_column[1] = true`

* Adds an `ipnet-address` feature flag, allowing support (de)serializing IP
values from the database using types provided by `ipnet`. This feature
may be enabled concurrently with the previously existing `network-address`
feature.

* We've added support for loading values using libpq's row-by-row mode via
the new iterator interface

* Adds `Timestamp`, `Timestamptz` support for appropriate types for `time v0.3.9`.
This feature enables using the `time` crate as an alternative to `chrono`.

### Removed

* All previously deprecated items have been removed.
Expand Down Expand Up @@ -230,6 +220,12 @@ the new iterator interface
with the database. Beside of the changed signature, existing impls of this trait should remain unchanged in almost
all cases.

* The `PIPES_AS_CONCAT` sql_mode is no longer set
by default. This setting requires a modification to MySQL query parsing that is
not supported by certain systems (such as Vitess). If you are using MySQL and
executing raw queries with the `||` operator, you will need to rewrite your
queries or set `PIPES_AS_CONCAT` manually.

### Fixed

* Many types were incorrectly considered non-aggregate when they should not
Expand Down Expand Up @@ -1960,3 +1956,4 @@ the new iterator interface
[1.4.8]: https://github.com/diesel-rs/diesel/compare/v1.4.7...v1.4.8
[2.0.0 Rc0]: https://github.com/diesel-rs/diesel/compare/v.1.4.0...v2.0.0-rc0
[2.0.0 Rc1]: https://github.com/diesel-rs/diesel/compare/v.2.0.0-rc0...v2.0.0-rc1
[2.0.0]: https://github.com/diesel-rs/diesel/compare/v.1.4.0...v2.0.0
4 changes: 2 additions & 2 deletions bin/diesel
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -e
SCRIPT_DIR=$(dirname "$0")
ABSOLUTE_SCRIPT_DIR=$(cd "$SCRIPT_DIR" && pwd)
BASE_DIR=$(dirname "$ABSOLUTE_SCRIPT_DIR")
$(cd $BASE_DIR/diesel_cli && cargo build --quiet --no-default-features --features "$BACKEND")
$BASE_DIR/target/debug/diesel $@
eval "$(cd "$BASE_DIR"/diesel_cli && cargo build --quiet --no-default-features --features "$BACKEND")"
"$BASE_DIR"/target/debug/diesel "$@"
84 changes: 42 additions & 42 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@
set -ex

if [ "$1" = "integration" ]; then
if [ "$2" ]; then
BACKEND="$2"
shift 2
else
BACKEND=postgres
shift
fi
if [ "$BACKEND" = "mysql" ]; then
export RUST_TEST_THREADS=1
fi
(cd diesel_tests && cargo test --features "$BACKEND" --no-default-features $*)
if [ "$2" ]; then
BACKEND="$2"
shift 2
else
BACKEND=postgres
shift
fi
if [ "$BACKEND" = "mysql" ]; then
export RUST_TEST_THREADS=1
fi
(cd diesel_tests && cargo test --features "$BACKEND" --no-default-features "$*")
elif [ "$1" = "compile" ]; then
shift
(cd diesel_compile_tests && cargo test $*)
shift
(cd diesel_compile_tests && cargo test "$*")
else
(cd diesel && cargo test --no-default-features --features "extras sqlite" $*)
(cd diesel && cargo test --no-default-features --features "extras postgres" $*)
(cd diesel && cargo test --no-default-features --features "mysql" $* -- --test-threads 1)
(cd diesel && cargo test --no-default-features --features "extras sqlite" "$*")
(cd diesel && cargo test --no-default-features --features "extras postgres" "$*")
(cd diesel && cargo test --no-default-features --features "mysql" "$*" -- --test-threads 1)

(cd diesel_cli && cargo test --features "sqlite" --no-default-features $*)
(cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" $*)
(cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" $*)
(cd diesel_derives && cargo test --features "diesel/sqlite" $*)
(cd diesel_tests && cargo test --features "sqlite" --no-default-features $*)
(cd diesel_dynamic_schema && cargo test --features "sqlite diesel/sqlite" $*)
(cd diesel_bench && cargo test --features "sqlite" --benches $*)
(cd diesel_cli && cargo test --features "sqlite" --no-default-features "$*")
(cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" "$*")
(cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" "$*")
(cd diesel_derives && cargo test --features "diesel/sqlite" "$*")
(cd diesel_tests && cargo test --features "sqlite" --no-default-features "$*")
(cd diesel_dynamic_schema && cargo test --features "sqlite diesel/sqlite" "$*")
(cd diesel_bench && cargo test --features "sqlite" --benches "$*")

(cd diesel_migrations && cargo test --features "postgres diesel/postgres" $*)
(cd diesel_migrations/migrations_macros && cargo test --features "diesel/postgres postgres" $*)
(cd diesel_derives && cargo test --features "diesel/postgres" $*)
(cd diesel_cli && cargo test --features "postgres" --no-default-features $*)
(cd diesel_tests && cargo test --features "postgres" --no-default-features $*)
(cd diesel_dynamic_schema && cargo test --features "postgres diesel/postgres" $*)
(cd diesel_bench && cargo test --features "postgres" --benches $*)
(cd diesel_migrations && cargo test --features "postgres diesel/postgres" "$*")
(cd diesel_migrations/migrations_macros && cargo test --features "diesel/postgres postgres" "$*")
(cd diesel_derives && cargo test --features "diesel/postgres" "$*")
(cd diesel_cli && cargo test --features "postgres" --no-default-features "$*")
(cd diesel_tests && cargo test --features "postgres" --no-default-features "$*")
(cd diesel_dynamic_schema && cargo test --features "postgres diesel/postgres" "$*")
(cd diesel_bench && cargo test --features "postgres" --benches "$*")

(cd diesel_migrations && cargo test --features "mysql diesel/mysql" $* -- --test-threads 1)
(cd diesel_migrations/migrations_macros && cargo test --features "diesel/mysql mysql" $* -- --test-threads 1)
(cd diesel_derives && cargo test --features "diesel/mysql" $* -- --test-threads 1)
(cd diesel_cli && cargo test --features "mysql" --no-default-features $* -- --test-threads 1)
(cd diesel_tests && cargo test --features "mysql" --no-default-features $* -- --test-threads 1)
(cd diesel_dynamic_schema && cargo test --features "mysql diesel/mysql" $* -- --test-threads 1)
(cd diesel_bench && cargo test --features "mysql" --benches $* -- --test-threads 1)
(cd diesel_migrations && cargo test --features "mysql diesel/mysql" "$*" -- --test-threads 1)
(cd diesel_migrations/migrations_macros && cargo test --features "diesel/mysql mysql" "$*" -- --test-threads 1)
(cd diesel_derives && cargo test --features "diesel/mysql" "$*" -- --test-threads 1)
(cd diesel_cli && cargo test --features "mysql" --no-default-features "$*" -- --test-threads 1)
(cd diesel_tests && cargo test --features "mysql" --no-default-features "$*" -- --test-threads 1)
(cd diesel_dynamic_schema && cargo test --features "mysql diesel/mysql" "$*" -- --test-threads 1)
(cd diesel_bench && cargo test --features "mysql" --benches "$*")

(cd diesel_compile_tests && cargo test $*)
(cd diesel_migrations/migrations_internals && cargo test $*)
export BACKEND="mysql sqlite postgres"
(cd examples && ./test_all $*)
fi;
(cd diesel_compile_tests && cargo test "$*")
(cd diesel_migrations/migrations_internals && cargo test "$*")
export BACKEND="mysql sqlite postgres"
(cd examples && ./test_all "$*")
fi
14 changes: 10 additions & 4 deletions diesel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel"
version = "2.0.0-rc.1"
version = "2.0.0"
license = "MIT OR Apache-2.0"
description = "A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL"
readme = "README.md"
Expand All @@ -14,7 +14,7 @@ rust-version = "1.56.0"

[dependencies]
byteorder = { version = "1.0", optional = true }
chrono = { version = "0.4.19", optional = true, default-features = false, features = ["clock", "std"] }
chrono = { version = "0.4.20", optional = true, default-features = false, features = ["clock", "std"] }
libc = { version = "0.2.0", optional = true }
libsqlite3-sys = { version = ">=0.17.2, <0.26.0", optional = true, features = ["bundled_bindings"] }
mysqlclient-sys = { version = "0.2.5", optional = true }
Expand All @@ -33,9 +33,10 @@ bigdecimal = { version = ">=0.0.13, < 0.4.0", optional = true }
bitflags = { version = "1.2.0", optional = true }
r2d2 = { version = ">= 0.8.2, < 0.9.0", optional = true }
itoa = { version = "1.0.0", optional = true }
time = { version = "0.3.9", optional = true, features = ["macros", "formatting", "parsing"] }

[dependencies.diesel_derives]
version = "~2.0.0-rc.1"
version = "~2.0.0"
path = "../diesel_derives"

[dev-dependencies]
Expand All @@ -46,14 +47,18 @@ quickcheck = "1.0.3"

[features]
default = ["with-deprecated", "32-column-tables"]
extras = ["chrono", "serde_json", "uuid", "network-address", "numeric", "r2d2"]
extras = ["chrono", "time", "serde_json", "uuid", "network-address", "numeric", "r2d2"]
unstable = ["diesel_derives/nightly"]
large-tables = ["32-column-tables"]
huge-tables = ["64-column-tables"]
32-column-tables = ["diesel_derives/32-column-tables"]
64-column-tables = ["32-column-tables", "diesel_derives/64-column-tables"]
128-column-tables = ["64-column-tables", "diesel_derives/128-column-tables"]
postgres = ["pq-sys", "postgres_backend"]
# If we bumped the diesel MSRV to 1.60, we could eliminate the `time` "formatting" and "parsing" features
# from the main import and instead put them into the `sqlite` dependency here, as
# sqlite = ["libsqlite3-sys", "diesel_derives/sqlite", "time?/formatting", "time?/parsing"]
# https://doc.rust-lang.org/cargo/reference/features.html#dependency-features
sqlite = ["libsqlite3-sys", "diesel_derives/sqlite"]
mysql = ["mysqlclient-sys", "url", "percent-encoding", "bitflags", "mysql_backend"]
without-deprecated = ["diesel_derives/without-deprecated"]
Expand All @@ -65,6 +70,7 @@ postgres_backend = ["diesel_derives/postgres", "bitflags", "byteorder", "itoa"]
mysql_backend = ["diesel_derives/mysql", "byteorder"]
returning_clauses_for_sqlite_3_35 = []
i-implement-a-third-party-backend-and-opt-into-breaking-changes = []
nightly-error-messages = []

[package.metadata.docs.rs]
features = ["postgres", "mysql", "sqlite", "extras"]
Expand Down
Loading

0 comments on commit 269e8b2

Please sign in to comment.