SQLx 0.9.0 Released! #4271
Pinned
abonander
started this conversation in
Announcements
Replies: 2 comments
-
|
wow, what a great job done! thanks a lot! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Congratulations and thanks for the great job! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This release announcement was too big to fit in one Discord message, and not everyone checks Discord anyway, so I've decided to try posting it here instead. Please feel free to post any questions or feedback here as well.
For details, see the CHANGELOG entry: https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md#090---2026-05-06
(Note: I accidentally published this release from my pre-squash release branch instead of
main, but I tagged the release commit onmain. The only difference is an update to an example in the README.)Important Announcements
New Github Organization
Shortly after this release is published, the SQLx repository will be transferred to a new GitHub organization:
https://github.com/transact-rs/
This is because SQLx has not been owned or maintained by LaunchBadge, LLC. for a few years now, and has since been
informally transferred to the collective ownership of its principal authors. Moving the repository to a new
organization makes this change more clear, and also allows for potentially inviting outside collaborators.
Cargo.lockRemoved from TrackingThe
Cargo.lockhas been removed from tracking in Git. CI should now always test with the latest versions ofall dependencies by default, alongside our pass that checks with
cargo generate-lockfile -Z minimal-versions.This should eliminate the need for any PRs that update dependencies to also update
Cargo.lockorcontend with an endless stream of merge conflicts against it.
N.B.
cargo install --locked sqlx-cliwill no longer work. However,cargo install sqlx-clihas alwaysused the latest dependencies by default, ignoring the lockfile, so most users should not be affected. For users
requiring reproducible builds, consider maintaining your own lockfile instead; historically, we only ran
cargo updatesporadically, so relying on SQLx's lockfile offered few guarantees anyway.
See the manual page for
cargo installfor details.Release Highlights (see CHANGELOG for full release notes)
This release adds support for the
smolandasync-global-executorruntimes as a successor to the deprecatedasync-stdcrate.It adds support for a new
sqlx.tomlconfig file which makes it easier to implement multiple-database or multi-tenant setups, allows for global type overrides to make custom types and third-party crates easier to use, enables extension loading for SQLite at compile-time, and is extensible to support so many other planned use-cases, too many to list here. There are links to the new example projects demonstrating this feature in the CHANGELOG.Additionally, this release replaces the
&strparameter of thequery*()family of functions with a generic parameter implementing the newSqlSafeStrtrait, which signals a query string that is safe from SQL injections. By default,SqlSafeStris only implemented for&'static strwhich, barring niche cases likeString::leak(), should only be constant string values. Other string types may now be passed wrapped inAssertSqlSafe(..)which is designed to be easy to spot during code review. This finally allows passing an ownedString, which should make it possible to return a pre-builtQueryfrom a function asQuery<'static, DB>.Direct calls to
Executor, which have been broken by the switch toSqlStr, should be replaced withsqlx::raw_sql("<SQL>").execute(...)which was introduced back in 0.7.4.libsqlite3-sysis now specified using a version range which should make it much more friendly to link SQLx with other crates that depend on it, likerusqlite. The maximum of the range may now be increased in any backwards-compatible release. The minimum of the range may only be increased in major releases. If you havelibsqlite3-sysin your dependencies, Cargo should choose a compatible version automatically. If otherwise unconstrained, Cargo should choose the latest version supported.New non-default features have been added, corresponding to conditionally compiled SQLite APIs:
sqlite-deserializeenablingSqliteConnection::serialize()andSqliteConnection::deserialize()sqlite-load-extensionenablingSqliteConnectOptions::extension()and::extension_with_entrypoint()sqlite-unlock-notifyenables internal use ofsqlite3_unlock_notify()This is mainly to allow linking a pre-built SQLite binary that has omitted these features.
Also included should be the final fix for the pesky bug with the MySQL driver complaining about various collations not being compatible with strings. It turned out to be a misinterpretation of the protocol docs (which are quite hit-or-miss). We now treat all string data as compatible with
String, etc., unless it uses thebinarycollation (ID 63). We also no longer passCOLLATE utf8_general_ciduring startup, letting the server choose the appropriate default collation. For those interested, see the comment insqlx-mysql/src/collation.rs.Beta Was this translation helpful? Give feedback.
All reactions