This commit updates the error handling logic in the `connect_tcp` function. Previously, the function would panic if the hostname did not resolve to at least one address.
The updated logic attempts to establish a TCP connection for each address that the hostname resolves to. If it fails to connect to any of the addresses, it will return the last encountered error. If the hostname doesn't resolve to any addresses, the function returns a custom error message stating "Hostname did not resolve to any addresses".
* chore:Added ipaddr extension library to gitignore
* fix:In a Linux environment, shared libraries in the current directory are not loaded, so add the current directory to the LD_LIBRARY_PATH environment variable.
* fix: Since confrict primary key when running multiple sqlite tests, removed specific primary key in insert.
* chore: Since avoid git modified targeting, copy the db file to new test db file.
* fix: Since docker mysql 5.7 using yaSSL(It only supports TLSv1.1), avoid running when using rustls.
This is often encountered when the host the db is on is restarted.
For example, a reboot of AWS Aurora causes this. If we don't handle this
properly the PgListeners are stuck in an erroring state, even when the DB
is back online. By catching it here, we will reconnect when it is
(eventually) back online.
* feat(citext): implement citext for postgres
* feat(citext): add citext -> String conversion test
* feat(citext): fix ltree -> citree
* feat(citext): add citext to the setup.sql
* chore: address nits to #2478
* Rename `PgCitext` to `PgCiText`
* Document when use of `PgCiText` is warranted
* Document potentially surprising `PartialEq` behavior
* Test that the macros consider `CITEXT` to be compatible with `String` and friends
* doc: add `PgCiText` to `postgres::types` listing
* chore: restore missing trailing line break to `tests/postgres/setup.sql`
---------
Co-authored-by: Austin Bonander <austin@launchbadge.com>
* feat(citext): implement citext for postgres
* feat(citext): add citext -> String conversion test
* feat(citext): fix ltree -> citree
* feat(citext): add citext to the setup.sql
* chore: address nits to #2478
* Rename `PgCitext` to `PgCiText`
* Document when use of `PgCiText` is warranted
* Document potentially surprising `PartialEq` behavior
* Test that the macros consider `CITEXT` to be compatible with `String` and friends
* doc: add `PgCiText` to `postgres::types` listing
* chore: restore missing trailing line break to `tests/postgres/setup.sql`
---------
Co-authored-by: Austin Bonander <austin@launchbadge.com>
* Update README.md
Quick helper on the async_std quickstart
* Move comment regard. `attributes` into code example
* doc(README): adjust wording of a comment
---------
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
On `PoolOptions::connect()`, we open at least `min_connections`
connections, or 1 if unset. Therefore, the expression needs to be
`max()`. (`min(1, x)` would mean we always open only a single
connection).
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.
* fix(postgres): sqlx prepare fails if shared_preload_libraries=pg_stat_statements
closes#2622
refs:
* https://serde.rs/enum-representations.html#untagged
* https://serde.rs/field-attrs.html#skip
* https://www.postgresql.org/docs/current/pgstatstatements.html
* https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-COMPUTE-QUERY-ID
* fix(postgres): regression of #1449
```
error: error occurred while decoding column 0: data did not match any variant of untagged enum Explain at line 3 column 1
Error: --> tests/postgres/macros.rs:103:15
|
103 | let row = sqlx::query!(r#"CALL forty_two(null)"#)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info)
error: could not compile `sqlx` (test "postgres-macros") due to previous error
```
* refactor(postgres): don't define unused fields in QueryPlan
* refactor(postgres): simplify query plan handling, add unit test
* chore: document why we load `pg_stat_statements` in tests
---------
Co-authored-by: mrl5 <31549762+mrl5@users.noreply.github.com>
Inlined format args make code more readable, and code more compact.
I ran this clippy command to fix most cases, and then cleaned up a few trailing commas and uncaught edge cases.
```
cargo clippy --bins --examples --benches --tests --lib --workspace --fix -- -A clippy::all -W clippy::uninlined_format_args
```
* 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.