2765 Commits

Author SHA1 Message Date
Austin Bonander
0baa295e81 fix: change minimal-versions check to use direct-minimal-versions 2026-02-04 14:52:26 -08:00
Austin Bonander
e1e99e17dc fix: run cargo fmt 2026-02-04 14:52:26 -08:00
Austin Bonander
cd8e35546e WIP refactor: replace sharding with single connection set (6) 2026-02-04 14:52:26 -08:00
Austin Bonander
824e27b506 WIP refactor: replace sharding with single connection set (5) 2026-02-04 14:52:26 -08:00
Austin Bonander
54e842376e feat: add tracing-flame to benches/any-pool 2026-02-04 14:52:26 -08:00
Austin Bonander
cf102b0679 WIP refactor: simpler acquire strategy 2026-02-04 14:52:26 -08:00
Austin Bonander
a7e2ef43eb WIP refactor: replace sharding with single connection set 2026-02-04 14:52:26 -08:00
Austin Bonander
b2048af416 fix: debug timeouts in benchmark 2026-02-04 14:52:26 -08:00
Austin Bonander
b571d7f5b5 fix: bugs in sharded pool 2026-02-04 14:52:26 -08:00
Austin Bonander
15722db74a chore: Cargo.lock after rebase 2026-02-04 14:52:26 -08:00
Austin Bonander
9a8a4f96c2 WIP feat: integrate sharding into pool 2026-02-04 14:52:26 -08:00
Austin Bonander
d28f723cfe feat: create sharding structure for pool 2026-02-04 14:52:26 -08:00
Austin Bonander
fbc097cd5d fix errors after rebase 2026-02-04 14:52:26 -08:00
Austin Bonander
cd1744d205 fix: errors after rebasing 2026-02-04 14:52:26 -08:00
Austin Bonander
608b81fbe4 fix(pool): tweaks and fixes 2026-02-04 14:52:26 -08:00
Austin Bonander
954913908a fix(pool): use .fuse() 2026-02-04 14:52:26 -08:00
Austin Bonander
e6f81e2cb4 fix(pool): use the correct method in try_min_connections 2026-02-04 14:52:26 -08:00
Austin Bonander
ea0a42a4f6 fix(pool): don't stop emptying idle queue in .close() 2026-02-04 14:52:26 -08:00
Austin Bonander
7b06b20216 fix: tests 2026-02-04 14:52:26 -08:00
Austin Bonander
f435424f91 fix: upgrade ease-off 2026-02-04 14:52:26 -08:00
Austin Bonander
54cfdfcd16 chore: delete defunct use of futures-intrusive 2026-02-04 14:52:26 -08:00
Austin Bonander
278f8e4b4a fix: compilation error, warnings 2026-02-04 14:52:26 -08:00
Austin Bonander
76445988d9 feat(pool): add more info to impl Debug for PoolConnection 2026-02-04 14:52:26 -08:00
Austin Bonander
a76a1800e9 fix(pool): add timeout to return_to_pool() 2026-02-04 14:52:26 -08:00
Austin Bonander
e95bb03e95 refactor(pool): use a unique ID per connection 2026-02-04 14:52:26 -08:00
Austin Bonander
c6f4b9fe29 fix(pool): spawn task for before_acquire 2026-02-04 14:52:26 -08:00
Austin Bonander
3d6764f592 WIP pool changes 2026-02-04 14:52:26 -08:00
Austin Bonander
7e44afea49 breaking(pool): use usize for all connection counts 2026-02-04 14:52:26 -08:00
Austin Bonander
bd4b1a9a7d feat: create Pool::acquire() benchmark 2026-02-04 14:52:26 -08:00
Joey de Waal
8189f897ce
Add on unimplemented diagnostic to SqlStr (#4153)
* add diagnostic to `SqlStr`

* Update note
2026-02-02 07:13:52 -08:00
tison
1dd526a2ed
Bump whoami to v2 (#4143)
* Bump whoami to v2

Signed-off-by: tison <wander4096@gmail.com>

* Update sqlx-postgres/src/options/mod.rs

---------

Signed-off-by: tison <wander4096@gmail.com>
2026-01-17 19:02:10 -08:00
chrxn1c
93bafbefd6
feat: add self-extractor for JSON type (#4123) 2026-01-17 12:40:53 -08:00
M Bakhtiyar Ali
452da1acf5
Bump bit-vec to v0.8 (#4094) 2025-12-30 13:53:59 -08:00
Austin Bonander
a2a219f175
fix CI: replace removed macOS runner, deprecated use of Command::cargo_bin() (#4134)
* fix(ci): update macOS intel runner version

* fix(cli/tests): replace use of deprecated `Command::cargo_bin()`
2025-12-24 21:40:53 -08:00
Joey de Waal
e8384f2a00
fix spelling (#4069) 2025-10-28 05:18:47 -07:00
Andreas Molitor
e4afbd4ca1
chore: update hashlink to v0.11.0 (#4072)
Co-authored-by: amolitor <andreas.molitor@andrena.de>
2025-10-28 04:46:25 -07:00
Austin Bonander
2a1eedd299
fix(CHANGELOG): correct link to #4015 2025-10-28 04:44:02 -07:00
Kevin R
a802da0e67
Fix typo in migration example from 'uesrs' to 'users' (#4068) 2025-10-22 19:40:50 +02:00
Austin Bonander
946b6d4d16 fix: break dev-dependency cycle because of rust-lang/cargo#15622 2025-10-14 19:08:15 -07:00
Austin Bonander
1b2b19fe8e
chore: update CHANGELOG for 0.9.0-alpha-1 (#4057) 2025-10-14 18:47:11 -07:00
Austin Bonander
388c424f48
fix(macros): smarter .env loading, caching, and invalidation (#4053)
* fix(macros): smarter `.env` loading, caching, and invalidation

* feat(mysql): test `.env` loading in CI

* feat(postgres): test `.env` loading in CI

* feat(macros): allow `DATABASE_URL` to be empty

* fix(examples/postgres): make `cargo-sqlx` executable

* fix(examples/postgres): `cargo sqlx` invocation

* feat(examples/postgres): check offline prepare on more examples

* fix(examples/postgres): the name of this step

* fix(cli): don't suppress error from `dotenv()`

* fix(ci/examples/postgres): don't use heredoc in this step

* fix(ci/examples/postgres): multi-tenant

* fix(ci/examples/sqlite): test `.env` loading

* chore: add CHANGELOG entry
2025-10-14 17:31:12 -07:00
David Uebler
064d649abd
native tls handshake: build TlsConnector in blocking threadpool (#4027)
* build TlsConnector in blocking threadpool

The openssl TlsConnector synchronously loads certificates from files.
Loading these files can block for tens of milliseconds.

* Update sqlx-core/src/net/tls/tls_native_tls.rs

---------

Co-authored-by: David Übler <david.uebler@puzzleyou.de>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2025-09-23 07:23:01 -07:00
Dosenpfand
c52e129e83
fix(sqlite) Migrate revert with no-transaction (#4024)
* Fix migration reverts for no-TX SQLite

* Add regression test

---------

Co-authored-by: Markus Gasser <markus.gasser@frauscher.com>
2025-09-14 17:43:39 -07:00
iamjpotts
81526898d4
refactor(core): Remove lifetime parameter from Arguments trait (#3960)
* refactor(core): Remove lifetime parameter from Arguments trait

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

* refactor(core): Also relax lifetime of argument passed to Query::bind and Query::try_bind

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

---------

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2025-09-13 21:47:45 -07:00
iamjpotts
54a0492ee2
refactor(any): Remove lifetime parameter from AnyArguments (#3958)
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2025-09-12 16:11:39 -07:00
Alejandro González
1f4b5f28f3
feat(sqlite): no_tx migration support (#4015)
* chore(sqlx-postgres): fix typo in `migrate.rs` comment

* feat(sqlite): support `no_tx` migrations

SQLite includes several SQL statements that are useful during migrations but
must be executed outside of a transaction to take effect, such as `PRAGMA
foreign_keys = ON|OFF` or `VACUUM`. Additionally, advanced migrations may want
more precise control over how statements are grouped into transactions or
savepoints to achieve the desired atomicity for different parts of the
migration.

While SQLx already supports marking migrations to run outside explicit
transactions through a `-- no-transaction` comment, this feature is currently
only available for `PgConnection`'s `Migrate` implementation, leaving SQLite and
MySQL without this capability. Although it's possible to work around this
limitation by implementing custom migration logic instead of executing
`Migrator#run`, this comes at a cost of significantly reduced developer
ergonomics: code that relies on the default migration logic, such as
`#[sqlx::test]` or `cargo sqlx database setup`, won't support these migrations.

These changes extend `SqliteConnection`'s `Migrate` implementation to support
`no_tx` migrations in the same way as PostgreSQL, addressing this feature gap. I
also considered implementing the same functionality for MySQL, but since I
haven't found a practical use case for it yet, and every
non-transaction-friendly statement I could think about in MySQL triggers
implicit commits anyway, I determined it wasn't necessary at this time and could
be considered an overreach.

* test(sqlite): add test for `no_tx` migrations

* chore(sqlx-sqlite): bring back useful comment

* chore(sqlx-sqlite): unify SQL dialect in annotation comments
2025-09-08 14:55:58 -07:00
Austin Bonander
66526d9c56
refactor: tweaks after #3791 (#4022)
* restore fallback to `async-io` for `connect_tcp()` when `runtime-tokio` feature is enabled
* `smol` and `async-global-executor` both use `async-task`, so `JoinHandle` impls can be consolidated
* no need for duplicate `yield_now()` impls
* delete `impl Socket for ()`
2025-09-08 14:28:58 -07:00
Paul Xu
500cd18f19
Add Migrator::with_migrations() constructor (#4020)
* Add the helper function with_migrations() to Migrator.

* cargo fmt

* cargo fmt

* cargo fmt

* Improve comments.
2025-09-08 14:01:23 -07:00
martin-kolarik
6b828e698f
Smol+async global executor 1.80 dev (#3791)
* Sqlx-core: rename async_io dependency for async-std

* Sqlx-core: simplify TimeoutError

* Sqlx-core: code for async-global-executor

* Sqlx: integrate async-global-executor feature

* Note to unsafe

* Step up MSRV as async-global-executor needs it

* Sqlx-core: fix of unix socket build

* Unsafe fixes, smol executor added

* Workflow fix

* Changes outside sqlx_rt

* Cleanup conditional rt compilation

* Warning

* Add executors to test matrix

* Fix of skipping code sqlite due to mismatch in cargo feature names

* Smol executor isolated

* Fix, reduce number of tests, remove async_std

* Fix of test_block_on, regression

* Format fixes

* async-global-executor added

* async-std changed to 1.13

* litemap, zerofrom requires rustc 1.81

* Fix of missing _sqlite in cargo.toml

* Clippy lints

* Clean up

* Remove features combinations

* Fixes after merge

* Fix of compiling connect_tcp_address with both tokio + other executor selected

* Try to fix CI -Z minimal-versions check

Try to fix CI -Z minimal-versions check
2025-09-08 11:17:55 -07:00
Thom Wright
482c9427a9
PostgreSQL SASL – run SHA256 in a blocking executor (#4006)
* Yield while salting password for PG SASL

To prevent spenting too much time doing synchronous work on the
event loop, we yield every few iterations of the hmac-sha256.

* Remove unused bench
2025-09-05 18:02:39 -07:00