Commit graph

13 commits

Author SHA1 Message Date
Mirek Klimos
b4f6596b06
Improve max_lifetime handling (#3065)
* Check max lifetime in return_to_pool, not on acquire

* Improve checks in backgrand maintenance task

* add tests

* adjust test to fix
2024-03-04 16:39:59 -08:00
Yuri Astrakhan
a824e8468c
Cleanup format arguments (#2650)
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
```
2023-07-31 13:27:04 -07: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
a2eceec33b
chore: replace dotenv with dotenvy (#2003)
* chore: replace `dotenv` with `dotenvy`

The former appears to be unmaintained and the latter is a drop-in replacement.

* chore: fix all warnings
2022-07-28 14:33:44 -07:00
Austin Bonander
3d4861fd7c
pool: fix panic when using callbacks (#1915)
* pool: fix panic when using callbacks

add regression test

* pool: fix panic when using callbacks

add regression test

added missing typedef `MssqlPoolOptions`
2022-06-21 15:17:48 -07:00
Austin Bonander
f02ff94e9c
refactor: pool fixes and breaking changes (#1901)
* Fixed leak of `Arc<SharedPool>` in `DecrementSizeGuard::cancel()`
* Renamed `PoolOptions::connect_timeout` to `acquire_timeout` for clarity.
* Fixed `/* SQLx ping */` showing up in Postgres query logs
* Made `.close()` a regular function that returns a `Future`
* Deleted deprecated method `PoolConnection::release()`
* Document why connection might be dropped if `Pool::acquire()` is cancelled
* Added connection metadata to pool lifecycle callbacks
* Improved guarantees for `min_connections`
* Fixed `num_idle()` to not spin forever at high load
* Improved documentation across the `pool` module
2022-06-16 12:56:28 -07:00
Ophir LOJKINE
20d61f4271
query_as: don't stop stream after decoding error (#1887)
* query_as: don't stop stream after decoding error

Fixes https://github.com/launchbadge/sqlx/issues/1884

When a single row cannot be converted to the target type of query_as,
it should not prevent the library user from accessing the other rows

Otherwise, the user cannot access all query results in query_as.

* use union in tests to maximize db compatibility
2022-06-01 19:18:18 -07:00
Austin Bonander
0ed524d65c fix(pool): always ping connection on release to see if it's still viable
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-02-27 00:56:08 -08:00
Raphaël Thériault
ced09e0545
Support using both nullability and type overrides (#549)
* Make it possible to use both nullability and type overrides

* Fix override parsing lookahead logic

* Update column override tests

* Support nullability overrides with wildcard type overrides

* Fix tests

* Update query! overrides docs

* Remove last bits of macro_result!

* rustfmt
2020-07-27 00:43:35 -07:00
Ryan Leckey
9befdc81bf test: add a regression test for the bugs discovered with #527 2020-07-17 04:56:58 -07:00
Ryan Leckey
793f247604 refactor: PoolOptions::new() takes no parameters and the final .connect method takes the URI 2020-07-14 06:07:29 -07:00
Ryan Leckey
0b2844bf39 feat(any): implement ColumnIndex<AnyRow> for &str to enable FromRow for the Any driver
closes #464
2020-07-02 23:28:53 -07:00
Ryan Leckey
a7117dd71b feat(any): introduce the Any database driver which enables choosing the database driver at runtime 2020-06-27 04:07:40 -07:00