Commit graph

107 commits

Author SHA1 Message Date
Austin Bonander
b4e7a2fe7d fix(ci): enable unit-tests for all relevant packages 2024-08-23 23:39:32 -07:00
Dirkjan Ochtman
a892ebc6e2
Upgrade to rustls 0.23 (#3399) 2024-08-04 16:39:13 -07:00
Austin Bonander
6651d2df72
Fix CI after Rust 1.80, remove dead feature references (#3381)
* fix(ci): update workflows/examples.yml

* Removed archived `actions-rs` actions
* Upgraded `Swatinem/rust-cache`, `actions/checkout`, `actions/download-artifact`, `actions/upload-artifact`

* chore: deprecate `AnyKind`

* fix: remove dead references to DB features in `sqlx-core`

This reactivates a couple of tests that had stopped working.

* chore(ci): move sqlx-cli checks to their own workflow

* fix(ci): remove remaining `uses: actions-rs/cargo`

* fix warnings

* chore: add titles to sqlx-cli jobs

* fix warnings (2)

* fix error in pool example

* fix warnings (3)

* fix query_builder test

* fix: don't run CLI tests on Windows

* chore: upgrade `rust-toolchain` to 1.80

* fix(postgres): fix missing Tokio specialization in `PgCopyIn`

Caught by the new `unexpected_cfgs` lint.

* fix new warnings
2024-07-26 23:15:32 -07:00
Hamir Mahal
7cfbb24ee3 fix: usage of node12 in SQLx action 2024-07-24 22:27:32 -07:00
Hamir Mahal
83a7d14e58
fix: comment not separated from other characters (#3328) 2024-07-15 20:00:41 -07:00
Joshua Potts
0546e0cfa9 ci: Add job to check that sqlx builds with its declared minimum dependencies
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-07-11 11:59:15 -07:00
Austin Bonander
f7301f67d1 fix(ci): don't run TLS tests when building without TLS (duh) 2024-06-13 13:11:36 -07:00
Austin Bonander
16ffaed73b fix(ci): stop testing on MySQL 5.7
MySQL 5.7 was EOL'd in October 2023.
2024-06-13 13:11:36 -07:00
Austin Bonander
79a5830437 fix: missing DATABASE_URL in CI
the changed steps weren't actually meant to run the tests yet
2024-06-13 13:11:36 -07:00
Austin Bonander
bae083cf79 fix: clippy warnings 2024-06-13 13:11:36 -07:00
Daniel Black
8b7f352be8
ci: syntax fix (#3267)
Correct:

Invalid workflow file: .github/workflows/sqlx.yml#L207
You have an error in your yaml syntax on line 207
2024-06-05 19:04:51 -07:00
Daniel Black
4d9f67b7b4
ci: MariaDB - add back 11.4 and add 11.5 (#3266)
* Revert "fix(ci): disable `mariadb_verylatest` pass for RusTLS"

This reverts commit c78425b3ac.

MariaDB 11.4.2 now includes the upstream fix for this.

Closes: 3091

* ci: mariadb 11.4 now GA/Stable
2024-06-05 18:18:58 -07:00
Austin Bonander
60d033eda2
fix(ci): pin Rust version, ditch unmaintained actions (#3234) 2024-05-14 23:57:31 -07:00
Austin Bonander
439ac858d1
add #3211 to create-issue links 2024-04-20 18:30:46 -07:00
Austin Bonander
0aae849657
fix(ci): use docker compose instead of docker-compose (#3167)
https://github.com/actions/runner-images/issues/9557
2024-04-02 16:15:09 -07:00
Austin Bonander
34860b7f99 fix(ci): just cfg-out the whole tests/sqlite/sqlcipher.rs 2024-03-05 18:33:56 -08:00
Austin Bonander
e5c18b354e fix: gate sqlcipher testing behind cfg to make development less annoying 2024-03-05 18:33:56 -08:00
Austin Bonander
c78425b3ac fix(ci): disable mariadb_verylatest pass for RusTLS
see: #3091
2024-03-04 21:09:49 -08:00
Austin Bonander
cd39cb2e29
Create pull_request_template.md 2023-11-03 18:03:10 -07:00
Daniel Black
a6a2af115e
Bump mariadb CI images + mysql unpin (#2739)
With MariaDB 10.3 EOL it seems prudent to include
the latest 10.11 LTS release in the CI tests.

To catch #1664 sort of issues prior to release, add
a container image test for mariadb that contains the
finished pre-release code changes (and container changes)
to ensure that compatibilty is maintianed. When
server code hits the branch associated with this tag
it is considered finished by its server developers and
has passes CI so no regressions are expected, but
it wouldn't hurt to have CI in other systems testing
it too.

Since MySQL has fixed the regression that caused #1664
this puts it back to their 8.0 release tag.

Append the :z tag to the docker compose volume mounts
so on selinux systems enough permissions occur for the
volume to be able to read the volume contents.
2023-09-11 19:19:28 -07:00
Yuri Astrakhan
a8a0579713
Treat warnings as errors on CI builds (#2651) 2023-07-31 13:29:07 -07:00
Ameer Ghani
84f21e99ef
cli: add --target-version CLI flags for migrate run/revert (#2538)
* cli: add --target-version CLI flags for migrate run/revert

* cli: fix broken test

* cli: test harness for `sqlx migrate` along with --target-version tests

* cli: Fail if version supplied to run/revert is too old/new

After some discussion with my coworkers, we thought about the behavior a bit more:

The behavior is now that for a run, if the provided version is too old, the CLI
will return with failure rather than being a no-op. This gives feedback to the
operator instead of being quiet.

It is still valid to up/downgrade to the latest version, this will still be a no-op
to allow for idempotency.
2023-07-31 12:49:53 -07:00
Joakim Malmberg
8cad54cc9f
Add postgres chat exmaple (#2577)
Co-authored-by: Stephen <webmaster@scd31.com>
2023-07-24 16:09:06 -07:00
Austin Bonander
dcb58b0e2c
0.7.0 release (#2575)
* WIP preparing 0.7.0 release

* fix: re-enable examples

* fix doctests in `sqlx-core`

* cherry-pick CHANGELOG entry for 0.6.3

* add actions workflow for examples

* fix(cli): close connection after running migrations

* fix examples

* fix(sqlite): fix parsing of URLs via `Any`

* fix(example): don't let Postgres `listen` example run forever

* fix Postgres `transaction` example
2023-07-03 14:37:37 -07:00
Craig Bester
c6b372fdf0 chore: test macros' offline mode in CI
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2023-03-01 19:17:21 -08:00
Thibs
c4130d45e3 Add client SSL authentication using key-file for Postgres, MySQL and MariaDB (#1850)
* use native-tls API

* Add client cert and key to MySQL connector

* Add client ssl tests for PostgreSQL

* Add client ssl tests for MariaDB and MySQL

* Adapt GA tests

* Fix RUSTFLAGS to run all tests

* Remove containers to free the DB port before running SSL auth tests

* Fix CI bad naming

* Use docker-compose down to remove also the network

* Fix main rebase

* Stop trying to stop service using docker-compose, simply use docker cmd

* Fix RUSTFLAGS for Postgres

* Name the Docker images for MariaDB and MySQL so we can stop them using their name

* Add the exception for mysql 5.7 not supporting compatible TLS version with RusTLS

* Rebase fixes

* Set correctly tls struct (fix merge)

* Handle Elliptic Curve variant for private key

* Fix tests suite

* Fix features in CI

* Add tests for Postgres 15 + rebase

* Python tests: fix exception for MySQL 5.7 + remove unneeded for loops

* CI: run SSL tests only when building with TLS support

---------

Co-authored-by: Barry Simons <linuxuser586@gmail.com>
2023-02-21 13:25:25 -08:00
Paolo Barbolini
171b00de2e Start testing on Postgres 15 and drop Postgres 10 (#2193)
* CHANGELOG: mention that users should upgrade CLI

* Drop postgres 10 start testing postgres 15

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-02-21 13:25:25 -08:00
Luiz Carvalho
c09532864d feat: better database errors (#2109)
* feat(core): create error kind enum

* feat(core): add error kind for postgres

* feat(core): add error kind for sqlite

* feat(core): add error kind for mysql

* test(postgres): add error tests

* test(sqlite): add error tests

* test(mysql): add error tests

* fix(tests): fix tests rebasing

* refac(errors): add `ErrorKind::Other` variant
2023-02-21 13:25:25 -08:00
Austin Bonander
b5312c3b6f Break drivers out into separate crates, clean up some technical debt (#2039)
* WIP rt refactors

* refactor: break drivers out into separate crates

also cleans up significant technical debt
2023-02-21 13:25:25 -08:00
Austin Bonander
6d0d7402c8
fix(actions): quote glob branch filter 2023-02-03 14:18:01 -08:00
Austin Bonander
9d0e596740
Run CI on *-dev branch
I believe this has to be on `main` to actually take effect.
2023-02-03 14:16:53 -08:00
Richard Bradfield
20877d83fd
Add extension support for SQLite (#2062)
* Add extension support for SQLite

While SQLite supports loading extensions at run-time via either the C
API or the SQL interface, they strongly recommend [1] only enabling the C
API so that SQL injections don't allow attackers to run arbitrary
extension code.

Here we take the most conservative approach, we enable only the C
function, and then only when the user requests extensions be loaded in
their `SqliteConnectOptions`, and disable it again once we're done
loading those requested modules. We don't add any support for loading
extensions via environment variables or connection strings.

Extensions in the options are stored as an IndexMap as the load order
can have side effects, they will be loaded in the order they are
supplied by the caller.

Extensions with custom entry points are supported, but a default API
is exposed as most users will interact with extensions using the
defaults.

[1]: https://sqlite.org/c3ref/enable_load_extension.html

* Add extension testing for SQlite

Extends x.py to download an appropriate shared object file for supported
operating systems, and uses wget to fetch one into the GitHub Actions
context for use by CI.

Overriding LD_LIBRARY_PATH for only this specific DB minimises the
impact on the rest of the suite.
2022-09-01 15:03:27 -07:00
Austin Bonander
956d8a823a
chore: add Discord link to issue templates 2022-08-15 18:07:50 -07:00
Austin Bonander
e04045cd66
fix: change extension of .github/ISSUE_TEMPLATE/config.yaml to .yml
YAML was a mistake, honestly.
2022-08-15 17:39:42 -07:00
Austin Bonander
ad594ce5cb
Add FAQ and discussions links 2022-08-15 17:36:53 -07:00
Austin Bonander
5245c9e627
Add issue templates (#2052) 2022-08-15 17:35:30 -07:00
Austin Bonander
054f61980a
feat: implement testing utilities (#2001) 2022-08-02 14:38:12 -07:00
Austin Bonander
60cc7c98fb
fix(actions): use rust-cache action (#1974)
I think the CI failures we've been seeing lately are due to bad incremental compilation artifacts being cached. The rust-cache action is smarter about what it actually caches.
2022-07-14 00:44:01 -07:00
Austin Bonander
bd40cc9a2f
fix(ci): fix workflow to run on main, not master 2022-06-23 17:23:40 -07:00
Bastian
6674e8ba96
Basic support for ltree (#1696)
* support ltree

* add default and push to PgLTree

* add more derived for ltree

* fix copy/paste

* Update sqlx-core/src/error.rs

Co-authored-by: Paolo Barbolini <paolo@paolo565.org>

* PR fixes

* ltree with name instead of OID

* custom ltree errors

* add pop ot PgLTree

* do not hide ltree behind feature flag

* bytes() instead of chars()

* apply extend_display suggestion

* add more functions to PgLTree

* fix IntoIter

* resolve PR annotation

* add tests

* remove code from arguments

* fix array

* fix setup isse

* fix(postgres): disable `ltree` tests on Postgres 9.6

Co-authored-by: Bastian Schubert <bastian.schubert@crosscard.com>
Co-authored-by: Paolo Barbolini <paolo@paolo565.org>
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2022-02-15 20:40:03 -08:00
Austin Bonander
7fd324d337
fix(ci): pin MySQL version in the correct place 2022-02-11 12:55:23 -08:00
Austin Bonander
5466826d91
fix(ci): pin MySQL 8 version to 8.0.27
Fixes the build failures until 8.0.29 is released.
2022-02-11 12:31:42 -08:00
Paolo Barbolini
f2b3cc8dc3
ci: test on Postgres 14 (#1557) 2021-11-29 12:58:19 -08:00
Atkins
9f7205e80f
Fix GitHub Actions and integration test (#1346)
* fix test suite

* rustfmt

* need Row

* test: fix integration test scripts and update the upstream supported databases

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): update supported databases

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): use `pg_isready` instead of `sleep` to avoid error cause by database not ready

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* feat(core): add `trait PgConnectionInfo` for connection parameter status from server

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* test(postgres): fix integration test for postgres

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* test(mysql): fix integration tests

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): test database against the oldest and newest supported versions

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* docs(core): document `trait PgConnectionInfo`

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

Co-authored-by: Montana Low <montanalow@gmail.com>
2021-07-28 14:00:34 -07:00
Alan D. Salewski
d17e7916ba gh actions: job 'mssql': use runtime feature name matrix for 'cargo build' step 2020-11-12 13:20:29 -08:00
Alan D. Salewski
d21dc1db11 gh actions: job 'mariadb': use runtime feature name matrix for 'cargo build' step 2020-11-12 13:20:29 -08:00
Alan D. Salewski
a61da5ee0d gh actions: job 'mysql': use runtime feature name matrix for 'cargo build' step 2020-11-12 13:20:29 -08:00
Alan D. Salewski
9ef2e066dc gh actions: job 'postgres': use runtime feature name matrix for 'cargo build' step 2020-11-12 13:20:29 -08:00
Alan D. Salewski
a9d0a842fb gh actions: use runtime feature name matrix for unit tests 2020-11-12 13:20:29 -08:00
Jonas Platte
a68872a35a Test rustls on CI 2020-11-12 07:32:59 -08:00