Skip to content

Commit f6e13a5

Browse files
committed
Merge branch 'master' of github.com:diesel-rs/diesel
2 parents 60506c9 + 7e67602 commit f6e13a5

373 files changed

Lines changed: 6380 additions & 2843 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
110
<!--
2-
If you want to report a bug, we added some points below you can fill out. If you want to request a feature, feel free to remove all the irrelevant text. In addition to this [issue tracker](https://github.com/diesel-rs/diesel/issues), you can also talk to Diesel maintainers and users on [Gitter](https://gitter.im/diesel-rs/diesel).
11+
If you want to report a bug, we added some points below which help us track down the problem faster.
312
-->
413

514
## Setup
@@ -33,16 +42,22 @@ If you want to report a bug, we added some points below you can fill out. If you
3342
### Steps to reproduce
3443

3544
<!--
36-
Please include as much of your codebase as needed to reproduce the error. If the relevant files are large, please consider linking to a public repository or a [Gist](https://gist.github.com/).
45+
Please include as much of your codebase as needed to reproduce the error. If the relevant files are large, please consider linking to a public repository or a [Gist](https://gist.github.com/). This includes normally the following parts:
3746
38-
Please post as much of your database schema as necessary. If you are using `infer_schema!`, you can use `diesel print-schema` and post the relevant parts from that.
47+
* The exact code where your hit the problem
48+
* Relevant parts your schema, so any `table!` macro calls required for the
49+
* Any other type definitions involved in the code, which produces your problem
3950
-->
4051

4152
## Checklist
4253

43-
- [ ] I have already looked over the [issue tracker](https://github.com/diesel-rs/diesel/issues) for similar issues.
54+
- [ ] I have already looked over the [issue tracker](https://github.com/diesel-rs/diesel/issues) and the [disussion forum](https://github.com/diesel-rs/diesel/discussions) for similar possible closed issues.
55+
<!--
56+
If you are unsure if your issue is a duplicate of an existing issue please link the issue in question here
57+
-->
4458
- [ ] This issue can be reproduced on Rust's stable channel. (Your issue will be
4559
closed if this is not the case)
60+
- [ ] This issue can be reproduced without requiring a third party crate
4661

4762
<!--
4863
Thank you for your submission! You're helping make Diesel more robust 🎉

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Compiler error while compiling diesel
4+
url: https://github.com/diesel-rs/diesel/issues?q=is%3Aissue+ld+returned+1+exit+status+
5+
about: Failed to compile diesel? Have a look at existing issues. You've likely miss some required dependency.
6+
- name: Simple Questions
7+
url: https://gitter.im/diesel-rs/diesel
8+
about: If you have a simple question please use our gitter channel.
9+
- name: Complex Questions
10+
url: https://github.com/diesel-rs/diesel/discussions/categories/q-a
11+
about: Do you have a larger question? Ask in our forum.
12+
- name: Feature Requests
13+
url: https://github.com/diesel-rs/diesel/discussions/categories/ideas
14+
about: If you want to suggest a new feature please create a new topic in our discussions forum

.github/workflows/benches.yml

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
backend: ["postgres", "sqlite", "mysql"]
1515
steps:
1616
- name: Checkout sources
17-
if: steps.bench.outputs.triggered == 'true'
1817
uses: actions/checkout@v2
1918

2019
- name: Install postgres (Linux)
@@ -26,28 +25,76 @@ jobs:
2625
sudo service postgresql restart && sleep 3
2726
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
2827
sudo service postgresql restart && sleep 3
29-
echo '::set-env name=PG_DATABASE_URL::postgres://postgres:postgres@localhost/'
28+
echo 'DATABASE_URL=postgres://postgres:postgres@localhost/' >> $GITHUB_ENV
3029
3130
- name: Install sqlite (Linux)
3231
if: matrix.backend == 'sqlite'
3332
run: |
3433
sudo apt-get update
3534
sudo apt-get install -y libsqlite3-dev
36-
echo '::set-env name=SQLITE_DATABASE_URL::/tmp/test.db'
35+
echo 'DATABASE_URL=/tmp/test.db' >> $GITHUB_ENV
3736
38-
3937
- name: Install mysql (Linux)
4038
if: matrix.backend == 'mysql'
4139
run: |
4240
sudo apt-get update
4341
sudo apt-get -y install mysql-server libmysqlclient-dev
4442
sudo /etc/init.d/mysql start
4543
mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot -proot
46-
echo '::set-env name=MYSQL_DATABASE_URL::mysql://root:root@localhost/diesel_test'
44+
echo 'DATABASE_URL=mysql://root:root@localhost/diesel_test' >> $GITHUB_ENV
4745
48-
- name: Run benches
49-
uses: jasonwilliams/criterion-compare-action@move_to_actions
46+
- name: Install rust toolchain
47+
uses: actions-rs/toolchain@v1
5048
with:
51-
cwd: "diesel_bench"
52-
token: ${{ secrets.GITHUB_TOKEN }}
53-
49+
profile: minimal
50+
toolchain: stable
51+
override: true
52+
53+
- name: Install critcmp
54+
uses: actions-rs/cargo@v1
55+
with:
56+
command: install
57+
args: critcmp
58+
59+
- name: Benchmark changes
60+
uses: actions-rs/cargo@v1
61+
with:
62+
command: bench
63+
args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline changes
64+
65+
- name: Checkout master
66+
run: |
67+
git fetch origin
68+
git reset --hard origin/master
69+
70+
- name: Benchmark master
71+
uses: actions-rs/cargo@v1
72+
with:
73+
command: bench
74+
args: --manifest-path diesel_bench/Cargo.toml --no-default-features --features "${{matrix.backend}}" -- --save-baseline master
75+
76+
- name: Critcmp
77+
run: |
78+
cd diesel_bench
79+
critcmp master changes
80+
echo "# ${{matrix.backend}}" > output.txt
81+
echo "" >> output.txt
82+
echo '```' >> output.txt
83+
critcmp master changes >> output.txt
84+
echo '```' >> output.txt
85+
86+
# This does not work due to github not allowing to post comments from forked repos
87+
# - name: Post the output as comment
88+
# uses: actions/github-script@v3
89+
# with:
90+
# github-token: ${{secrets.GITHUB_TOKEN}}
91+
# script: |
92+
# const fs = require('fs');
93+
# const data = fs.readFileSync('diesel_bench/output.txt', 'utf8');
94+
95+
# github.issues.createComment({
96+
# issue_number: context.issue.number,
97+
# owner: context.repo.owner,
98+
# repo: context.repo.repo,
99+
# body: data
100+
# })

.github/workflows/ci.yml

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
push:
55
branches:
66
- master
7-
- '0.[0-9]+.x'
8-
- '1.[0-9]+.x'
9-
7+
- "0.[0-9]+.x"
8+
- "1.[0-9]+.x"
109

1110
name: CI Tests
1211

@@ -115,34 +114,24 @@ jobs:
115114
- name: Install sqlite (MacOS)
116115
if: runner.os == 'macOS' && matrix.backend == 'sqlite'
117116
run: |
118-
brew uninstall openssl@1.0.2t
119-
brew uninstall python@2.7.17
120-
brew untap local/openssl
121-
brew untap local/python2
122-
brew cask install xquartz
123117
brew update
124118
brew install sqlite
125119
echo "SQLITE_DATABASE_URL=/tmp/test.db" >> $GITHUB_ENV
126120
127121
- name: Install mysql (MacOS)
128122
if: runner.os == 'macOS' && matrix.backend == 'mysql'
129123
run: |
130-
brew uninstall openssl@1.0.2t
131-
brew uninstall python@2.7.17
132-
brew untap local/openssl
133-
brew untap local/python2
134-
brew cask install xquartz
135124
brew update
136-
brew install mysql
137-
brew services start mysql
138-
brew services stop mysql;sleep 3;brew services start mysql
125+
brew install mariadb
126+
mysql_install_db
127+
mysql.server start
139128
sleep 3
140-
macos_mysql_version="$(ls /usr/local/Cellar/mysql)"
141-
/usr/local/Cellar/mysql/${macos_mysql_version}/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'root'@'localhost';" -uroot
142-
echo "MYSQL_DATABASE_URL=mysql://root@localhost/diesel_test" >> $GITHUB_ENV
143-
echo "MYSQL_EXAMPLE_DATABASE_URL=mysql://root@localhost/diesel_example" >> $GITHUB_ENV
144-
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://root@localhost/diesel_unit_test" >> $GITHUB_ENV
145-
echo "MYSQLCLIENT_LIB_DIR=/usr/local/Cellar/mysql/${macos_mysql_version}/lib" >> $GITHUB_ENV
129+
mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'runner'@'localhost';" -urunner
130+
macos_mysql_version="$(ls /usr/local/Cellar/mariadb)"
131+
echo "MYSQL_DATABASE_URL=mysql://runner@localhost/diesel_test" >> $GITHUB_ENV
132+
echo "MYSQL_EXAMPLE_DATABASE_URL=mysql://runner@localhost/diesel_example" >> $GITHUB_ENV
133+
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://runner@localhost/diesel_unit_test" >> $GITHUB_ENV
134+
echo "MYSQLCLIENT_LIB_DIR=/usr/local/Cellar/mariadb/${macos_mysql_version}/lib" >> $GITHUB_ENV
146135
147136
- name: Install sqlite (Windows)
148137
if: runner.os == 'Windows' && matrix.backend == 'sqlite'
@@ -176,8 +165,8 @@ jobs:
176165
if: runner.os == 'Windows' && matrix.backend == 'mysql'
177166
shell: cmd
178167
run: |
179-
choco install mysql
180-
"C:\tools\mysql\current\bin\mysql" -e "create database diesel_test; create database diesel_unit_test; grant all on `diesel_%`.* to 'root'@'localhost';" -uroot
168+
choco install mysql
169+
"C:\tools\mysql\current\bin\mysql" -e "create database diesel_test; create database diesel_unit_test; grant all on `diesel_%`.* to 'root'@'localhost';" -uroot
181170
182171
- name: Set variables for mysql (Windows)
183172
if: runner.os == 'Windows' && matrix.backend == 'mysql'
@@ -307,9 +296,9 @@ jobs:
307296
- uses: actions/checkout@v2
308297
- uses: actions-rs/toolchain@v1
309298
with:
310-
toolchain: nightly-2020-05-01
311-
profile: minimal
312-
override: true
299+
toolchain: nightly-2020-05-01
300+
profile: minimal
301+
override: true
313302
- name: Cache cargo registry
314303
uses: actions/cache@v2
315304
with:
@@ -336,10 +325,10 @@ jobs:
336325
- uses: actions/checkout@v2
337326
- uses: actions-rs/toolchain@v1
338327
with:
339-
toolchain: 1.40.0
340-
profile: minimal
341-
components: clippy, rustfmt
342-
override: true
328+
toolchain: 1.40.0
329+
profile: minimal
330+
components: clippy, rustfmt
331+
override: true
343332
- name: Cache cargo registry
344333
uses: actions/cache@v2
345334
with:
@@ -357,6 +346,7 @@ jobs:
357346
uses: actions-rs/cargo@v1
358347
with:
359348
command: clippy
349+
args: --all
360350

361351
- name: Check formating
362352
uses: actions-rs/cargo@v1
@@ -371,9 +361,9 @@ jobs:
371361
- uses: actions/checkout@v2
372362
- uses: actions-rs/toolchain@v1
373363
with:
374-
toolchain: stable
375-
profile: minimal
376-
override: true
364+
toolchain: stable
365+
profile: minimal
366+
override: true
377367
- name: Cache cargo registry
378368
uses: actions/cache@v2
379369
with:
@@ -393,15 +383,15 @@ jobs:
393383
args: --manifest-path diesel_cli/Cargo.toml --no-default-features --features "sqlite-bundled"
394384

395385
minimal_rust_version:
396-
name: Check Minimal supported rust version (1.40.0)
386+
name: Check Minimal supported rust version (1.48.0)
397387
runs-on: ubuntu-latest
398388
steps:
399389
- uses: actions/checkout@v2
400390
- uses: actions-rs/toolchain@v1
401391
with:
402-
toolchain: 1.40.0
403-
profile: minimal
404-
override: true
392+
toolchain: 1.48.0
393+
profile: minimal
394+
override: true
405395
- name: Cache cargo registry
406396
uses: actions/cache@v2
407397
with:
@@ -417,7 +407,7 @@ jobs:
417407
run: |
418408
RUSTC_BOOTSTRAP=1 cargo update -Z minimal-versions
419409
420-
- name: Check building with rust 1.40.0
410+
- name: Check building with rust 1.48.0
421411
uses: actions-rs/cargo@v1
422412
with:
423413
command: check

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions-rs/cargo@v1
4040
with:
4141
command: doc
42-
args: --manifest-path diesel/Cargo.toml --features "postgres sqlite mysql extras" --workspace
42+
args: --manifest-path diesel/Cargo.toml --features "postgres sqlite mysql extras" --workspace --exclude=diesel_compile_tests
4343

4444
- name: Publish documentation
4545
if: success()

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
target
22
Cargo.lock
33
!diesel_cli/Cargo.lock
4-
.env
4+
.env

0 commit comments

Comments
 (0)