NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #3796 most downloaded on crates.io
Command-line utility for SQLx, the Rust SQL toolkit.
Last release 4 months ago
21 May 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 28 of 28 stable releases
5 versions withdrawn
withdrawn after publishing
6 years old
38 releases · first in 2020
One column per quarter.
chore: update rand , crypto crates
refactor: un-track Cargo.lock
chore: prepare release 0.9.0
chore: update rand, crypto crates
chore: update rand, crypto crates (2)
chore: revert -Z direct-minimal-versions
For context: #4173 (comment)
chore: fix new clippy warnings
fix: compiler errors in tests/sqlite
fix: compiler errors in tests/postgres
fix: errors in axum-social-with-tests
fix: errors in Postgres examples, update examples/x.py
fix(sqlite): don't panic if call_with_result didn't set an error message
chore: update CHANGELOG for 0.9.0
chore: upgrade etcetera to 0.11.0
chore: document release PR changes
chore: document Executor methods not for general use
chore: update copyright
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.lock Removed from TrackingThe Cargo.lock has been removed from tracking in Git. CI should now always test with the latest versions of
all 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.lock or
contend with an endless stream of merge conflicts against it.
N.B. cargo install --locked sqlx-cli will no longer work. However, cargo install sqlx-cli has always
used 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 update
sporadically, so relying on SQLx's lockfile offered few guarantees anyway.
See the manual page for cargo install for details.
As per our MSRV policy, the supported Rust version for this release cycle is 1.94.0.
sqlx.toml format [[@abonander]]
sqlx-cli now support per-crate configuration files (sqlx.toml)DATABASE_URL for a crate (for multi-database workspaces)_sqlx_migrations table (for multiple crates using the same database)sqlx-toml to use.
sqlx-cli has it enabled by default, but sqlx does not.sqlx::_config module in documentation.DATABASE_URL renaming and global type overrides: [Link]_sqlx_migrations renaming and multiple schemas: [Link]chrono when time is enabled (e.g. when using tower-sessions-sqlx-store): [Link]
bigdecimal when rust_decimal is enabled is also shown, but problems with chrono/time are more common.Migrate traitsqlx::migrate::resolve_blocking() is now #[doc(hidden)] and thus SemVer-exempt.tracing logs from SQLx will need to update the spelling.PgAdvisoryLockGuard [[@bonsairobo]]Migrator::set_ignore_missing and set_locking now return &mut Self instead of &Self
which may break code in rare circumstances.query!() macros for certain queries in Postgres.RawSql lifetime issues [[@abonander]]
DB type parameter to all methods of RawSqlDecode, Encode and Type for Box, Arc, Cow and Rc [[@joeydewaal]]
impl Decode for Cow now always decodes Cow::Owned, lifetime is unlinkedquery*() functions now take impl SqlSafeStr
which is only implemented for &'static str and AssertSqlSafe.
For all others, wrap in AssertSqlSafe(<query>).Query<'static, DB>.SqlSafeStr trait is deliberately similar to std::panic::UnwindSafe,
serving as a speedbump to warn users about naïvely building queries with format!()
while allowing a workaround for advanced usage that is easy to spot on code review.PgConnectOptions::options() are now automatically escaped.
Manual escaping of options is no longer necessary and may cause incorrect behavior.runtime-tokio-native-tls)TransactionManager trait in sqlx.
#[doc(hidden)],
but it will break SeaORM if not proactively fixed.str [[@abonander]]
Vec<u8> will be inferred to be String
(this should ultimately fix more code than it breaks).SET NAMES utf8mb4 COLLATE utf8_general_ci is no longer sent by default; instead, SET NAMES utf8mb4 is sent to
allow the server to select the appropriate default collation (since this is version- and configuration-dependent).MySqlConnectOptions::charset() and ::collation() now imply ::set_names(true) because they don't do anything otherwise.charset doesn't change what's sent in the Protocol::HandshakeResponse41 packet as that normally only
matters for error messages before SET NAMES is sent.
The default collation if set_names = false is utf8mb4_general_ci.RawSql::fetch_optional() now returns sqlx::Result<Option<DB::Row>>
instead of sqlx::Result<DB::Row>. Whoops.libsqlite3-sys versioning, feature flags, safety changes [[@abonander]]
libsqlite3-sys version is now specified using a range.
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 have libsqlite3-sys in your dependencies, Cargo should choose a compatible version automatically.
If otherwise unconstrained, Cargo should choose the latest version supported.sqlx-toml feature) is now unsafe.sqlite-deserialize enabling SqliteConnection::serialize() and SqliteConnection::deserialize()sqlite-load-extension enabling SqliteConnectOptions::extension() and ::extension_with_entrypoint()sqlite-unlock-notify enables internal use of sqlite3_unlock_notify()SqliteValue and SqliteValueRef changes:
sqlite3_value* interface reserves the right to be stateful.
Without protection, any call could theoretically invalidate values previously returned, leading to dangling pointers.SqliteValue is now !Sync and SqliteValueRef is !Send to prevent data races from concurrent accesses.
SqliteValue in Mutex, or convert the SqliteValueRef to an owned value.SqliteValue and any derived SqliteValueRefs now internally track if that value has been used to decode a
borrowed &[u8] or &str and errors if it's used to decode any other type.SqliteValue/SqliteValueRef.SqliteValue for details.PgLTree::from to From<Vec<PgLTreeLabel>> implementation [[@JerryQ17]]SqliteArguments [[@iamjpotts]].pgpass file handling did not process backslash-escapes in the password part.
Now it does, which may change what password is sent to the server.#[derive(sqlx::Type)] automatically generate impl PgHasArrayType by default for newtype structs [[@papaj-na-wrotkach]]
#[sqlx(no_pg_array)] where conflicts occur.offline optional to allow building without serde [[@CathalMullan]]mysql-rsa feature
or an error will be generated at runtime. RSA encryption is only used for plaintext (non-TLS) connections.AnyTypeInfo [[@abonander]]Arc<str> and Arc<[u8]> (and Rc equivalents) [[@joeydewaal]]runtime-smol and runtime-async-global-executor features to replace usages of the deprecated async-std crate.no_tx migration support [[@AlexTMjugador]]Migrator::with_migrations() constructor [[@xb284524239]]sqlx.toml, update SQLite extension example [[@supleed2]]Json::into_inner() [[@chrxn1c]]SqlStr [[@joeydewaal]]PgNotification struct clone [[@michaelvanstraten]]OnceCell/Lazy with std OnceLock/LazyLock [[@paolobarbolini]]Debug implementations across PgRow, MySqlRow and SqliteRow [[@davidcornu]]QueryLogger back [[@joeydewaal]].bind() in README.md [[@sobolevn]]randetcetera to 0.11.0libsqlite3-sys version range to <0.38.0futures and futures-util [[@paolobarbolini]]Pool.close: close all connections before returning [[@jpmelos]]ROLLBACK transaction when dropped during BEGIN. [[@kevincox]].env loading, caching, and invalidation [[@abonander]]
Command::cargo_bin() [[@abonander]]SASLprep [[@var4yn]]from_utf8_unchecked with from_utf8 in SQLite column name handling [[@barry3406]]StdSocket::poll_ready() [[@abonander]]Nothing published for this version
0.8.6 release
0.8.6 release (#3870)
9 pull requests were merged this release cycle.
tempfile dependency [[@paolobarbolini]]fix(cli): correctly handle .env files again
fix(cli): correctly handle .env files again
feat(ci): add functionality tests for sqlx-cli (MySQL)
feat(ci): add functionality tests for sqlx-cli (Postgres)
feat(ci): add functionality tests for sqlx-cli (SQLite)
chore: prepare 0.8.5 release
feat(ci): run test-attr tests twice to catch #3825
fix: correct bugs in MySQL implementation of #[sqlx::test]
Hotfix release to address two new issues:
sqlx-cli@0.8.4 broke .env default resolution mechanismsqlx@0.8.4 broke test fixture setupThe 0.8.4 release will be yanked as of publishing this one.
sqlx-cli now accepts --no-dotenv in subcommand arguments.sqlx-cli to CI.#[sqlx::test] twice in CI to cover cleanup.50 pull requests were merged this release cycle.
50 pull requests were merged this release cycle.
push_values is passed an empty set of tuples [[@chanmaoganda]]#[track_caller] to Row::get() [[@karambarakat]]futures-core / futures-util APIs with std variants [[@paolobarbolini]]SQLITE_OPEN_URI on in-memory sqlite [[@LecrisUT]]PgCopyIn [[@joeydewaal]]CARGO_MANIFEST_DIR [[@joeydewaal]]limit: 0 for all Execute messages
CertificateInput::from infer any PEM-encoded document
PGSSLKEY not being parsed correctly when containing a PEM-encoded private key.PgConnectOptions
PGHOSTADDR now can be used to override PGHOST.fix: prevent dead-branch warning from Clippy in query macros
chore: create 0.8.3 release
fix: prevent dead-branch warning from Clippy in query macros
cc #3595
#[allow] from previous commit to the if block41 pull requests were merged this release cycle.
Uuid and uuid::fmt::Hyphenated [[@abonander]].pgpass file warning to a debug message. [[@denschub]]PgListener::try_recv [[@swlynch99]]UNION ALL instead of UNION in nullable check [[@Suficio]]no-transaction flag in down migrations [[@manifest]]sqlformat [[@tbar4]]query_as [[@xuehaonan27]]INTERVAL[] [[@Ddystopia]]EXPLAIN in nullability check for QuestDB [[@Suficio]]doc(FAQ): add example for MSRV
doc(FAQ): add example for MSRV
10 pull requests were merged this release cycle.
This release addresses a few regressions that have occurred, and refines SQLx's MSRV policy (see the FAQ).
Cargo.toml files in examples [[@carschandler]]#[sqlx(no_pg_array)] being forbidden on #[derive(Type)] structs.PgListener, PgStream::recv() [[@abonander]]
unknown message: "\\0" errorchore: prepare release 0.8.1
chore: prepare release 0.8.1
16 pull requests were merged this release cycle.
This release contains a fix for RUSTSEC-2024-0363.
Postgres users are advised to upgrade ASAP as a possible exploit has been demonstrated: https://github.com/launchbadge/sqlx/issues/3440#issuecomment-2307956901
MySQL and SQLite do not appear to be exploitable, but upgrading is recommended nonetheless.
MySqlConnectOptions::no_engine_substitution() [[@kolinfluence]]
MySqlConnectOptions::no_engine_subsitution() (oops) in favor of the correctly spelled version.spec_error module [[@abonander]]
libsqlite3-sys=0.30.1 to support sqlite 3.46 [[@CommanderStorm]]ring (the existing implementation),
and aws-lc-rs which has optional FIPS certification.runtime-tokio-rustls, runtime-async-std-rustls, tls-rustls)
enable the ring provider of RusTLS to match the existing behavior so this should not be a breaking change.tls-rustls-aws-lc-rs feature to use the aws-lc-rs provider.
runtime-tokio-rustls or runtime-async-std-rustls,
this will necessitate switching to the appropriate non-legacy runtime feature:
runtime-tokio or runtime-async-stdsqlx::Type [[@alu]]node12 in SQLx action [[@hamirmahal]]v0.18.1 to avoid yanked v0.14.3 [[@CommanderStorm]]chore: bump version to 0.8.0
chore: bump version to 0.8.0
70 pull requests were merged this release cycle.
#2697 was merged the same day as release 0.7.4 and so was missed by the automatic CHANGELOG generation.
#[sqlx::test] usages are applied in the correct order now.MigrateError.-- no-transaction to the beginning.Migrationi64 as intermediate when decoding [[@abonander]]
#[derive(sqlx::Type)] in Postgres [[@abonander]]
#[sqlx(no_pg_array)] where conflicts occur.PgTypeInfo::with_name() infers types that start with _ to be arrays of the un-prefixed type. Wrap type names in quotes to bypass this behavior.FromRow, return Error::ColumnDecode for TryFrom errors [[@abonander]]
#[sqlx(try_from = "T")] now return Error::ColumnDecode instead of Error::ColumnNotFound.#[sqlx(default)] on an individual field or the struct itself would have previously suppressed the error.
This doesn't seem like good behavior as it could result in some potentially very difficult bugs.
From and apply the default explicitly.#[sqlx(rename)] and #[sqlx(rename_all)] to match the expected behavior (rename wins).ConnectOptions::to_url_lossy() to match what parsing expects.MySqlTime, audit mysql::types for panics [[@abonander]]NonZero* scalar types [[@AlphaKeks]]Send trait bound from argument binding [[@bobozaur]]libsqlite3-sys are not considered breaking changes as per our semver guarantees.MySqlConnection to reduce sizes of futures [[@stepantubanov]]sqlx migrate add ... [[@CommanderStorm]]ConnectionHandleRaw type [[@abonander]]docker compose instead of docker-compose [[@abonander]]path ownership problems when using sqlx_macros_unstable [[@lily-mosquitoes]]sqlx_postgres::any [[@Zarathustra2]]migrate error message. (#3275) [[@nk9]]persistent query setting when preparing queries with the Any driver [[@etorreborre]]select_input_type!() being unhygenic [[@CommanderStorm]]M or C Notice fields are not UTF-8 [[@YgorSouza]]json-feature should activate sqlx-postgres?/json as well [[@CommanderStorm]]clock and std features of workspace.dependencies.chrono.fix: deprecation in postgres::chrono
fix: deprecation in postgres::types::chrono
38 pull requests were merged this release cycle.
This is officially the last release of the 0.7.x release cycle.
As of this release, development of 0.8.0 has begun on main and only high-priority bugfixes may be backported.
to_url_lossy to connect options [[@lily-mosquitoes]]query! for cargo-free systems [[@kshramt]]raw_sql API [[@abonander]]
query*() and query!().query*() functions.execute_many() and fetch_many() on interfaces that use prepared statements.
raw_sql API retains this functionality because it explicitly does not use prepared statements.
Raw or text-mode query interfaces generally allow multiple statements in one query string, and this is
supported by all current databases. Due to their nature, however, one cannot use bind parameters with them.create_new instead of atomic-file-write [[@mattfbacon]]PgConnectOptions [[@Fyko]]#[sqlx::test] [[@ciffelia]]sqlx::migrate::Migrator.migrate!().38 pull requests were merged this release cycle.
38 pull requests were merged this release cycle.
fixtures_path in sqlx::test args [[@ripa1995]]fn PgConnectOptions::get_host(&self) [[@boris-lok]]FromRow for the unit type [[@nanoqsh]]MySqlConnectOptions::get_database() [[@shiftrightonce]]Text adapter [[@abonander]]BOOLEAN and the query macros [[@abonander]]NUMERIC support [[@abonander]]libsqlite3-sys to 0.27.0
libsqlite3-sys is considered semver-exempt;
see the release notes for 0.7.0 below for details.rust_decimal::Decimal for high-precision values [[@abonander]]sqlx migrate add help text [[@cryeprecision]]try_stream!() [[@abonander]]cargo build [[@nyurik]]AtomicUsize for thread IDs [[@abonander]]chore: prepare 0.7.2 release
chore: prepare 0.7.2 release (#2782)
23 pull requests were merged this release cycle.
FromRow derive [[@95ulisse]]Type, Decode, and Encode for Box<str> and Box<[u8]> [[@grant0417]]remove_dir_all crate from sqlx-cli, fixes RUSTSEC-2023-0018 [[@aldur]]min_connections [[@hakoerber]][[#2603]]: docs(changelog): be more verbose about offline mode breaking change [[@mrl5]]
This release mainly addresses issues reported with the 0.7.0 release.
16 pull requests were merged this release cycle.
PgHasArrayType with #[derive(sqlx::Type)] [[@abonander]]
#[derive(sqlx::Type)] with #[sqlx(transparent)]
regarding PgHasArrayType not being implemented, add #[sqlx(no_pg_array)] to fix.Clone for PoolOptions manually (#2548) [[@alilleybrinker]]tls-native-tls in the documentation. [[@denschub]]Many revisions were made to query analysis in the SQLite driver; these are all potentially breaking changes as they can change the output of sqlx::que…
At least 70 pull requests were merged this release cycle! (The exact count is muddied with pull requests for alpha releases and such.) And we gained 43 new contributors! Thank you to everyone who helped make this release a reality.
Many revisions were made to query analysis in the SQLite driver; these are all potentially breaking changes
as they can change the output of sqlx::query!() et al. We'd like to thank [[@tyrelr]] for their numerous PRs to
this area.
The MSSQL driver has been removed as it was not nearly at the same maturity level as the other drivers. As previously announced, we have plans to introduce a fully featured replacement as a premium offering, alongside drivers for other proprietary databases, with the goal to support full-time development on SQLx.
If interested, please email your inquiry to sqlx@launchbadge.com.
The offline mode for the queries has been changed to use a separate file per query!() invocation,
which is intended to reduce the number of conflicts when merging branches in a project that both modified queries.
This means that CLI flag --merged is no longer supported. See [#2363] for details and make sure that your
sqlx-cli version is in sync with the sqlx version in your project.
The type ascription override syntax for the query macros has been deprecated,
as parse support for it has been removed in syn 2.0, which we'll be upgrading to in the next breaking release.
This can be replaced with type overrides using casting syntax (as).
See [#2483] for details.
mssql feature and associated database driver has been deleted from the source tree. It will return as part of our planned SQLx Pro offering as a from-scratch rewrite with extra features (such as TLS) and type integrations that were previously missing.runtime-actix-* features have been deleted. They were previously changed to be aliases of their runtime-tokio-* counterparts for backwards compatibility reasons, but their continued existence is misleading as SQLx has no special knowledge of Actix anymore.
runtime-actix-* feature with its runtime-tokio-* equivalent.git2 feature has been removed. This was a requested integration from a while ago that over time made less and less sense to be part of SQLx itself. We have to be careful with the crates we add to our public API as each one introduces yet another semver hazard. The expected replacement is to make #[derive(sqlx::Type)] useful enough that users can write wrapper types for whatever they want to use without SQLx needing to be specifically aware of it.Executor impls for Transaction and PoolConnection have been deleted because they cannot exist in the new crate architecture without rewriting the Executor trait entirely.
impl Executor is expected, as they both dereference to the inner connection type which will still implement it:
&mut transaction -> &mut *transaction&mut connection -> &mut *connectionMigrator are now #[doc(hidden)] and semver-exempt; they weren't meant to be public.offline feature has been removed from the sqlx facade crate and is enabled unconditionally as most users are expected to have enabled it anyway and disabling it doesn't seem to appreciably affect compile times.decimal feature has been renamed to rust_decimal to match the crate it actually provides integrations for.AnyDriver and AnyConnection now require either sqlx::any::install_drivers() or sqlx::any::install_default_drivers() to be called at some point during the process' lifetime before the first connection is made, as the set of possible drivers is now determined at runtime. This was determined to be the least painful way to provide knowledge of database drivers to Any without them being hardcoded.AnyEncode trait has been removed.libsqlite3-sys to be semver-exempt,
and we reserve the right to upgrade it as necessary. If you are using libsqlite3-sys directly or a crate that
links it such as rusqlite, you should pin the versions of both crates to avoid breakages from cargo update:[dependencies]
sqlx = { version = "=0.7.0", features = ["sqlite"] }
rusqlite = "=0.29.0"
time: Assume UTC when decoding a DATETIME column in sqlite [[@nstinus]]OffsetDateTime to be the first type used when deserializing a timestamp type.try_from when deriving FromRow [[@95ulisse]]PRAGMA optimize; on close of a connection [[@miles170]]Connection::shrink_buffers, PoolConnection::close [[@abonander]]sqlx_macros_unstable in config.toml [[@df51d]]AsMut for advisory lock types (#2520) [[@alilleybrinker]]tracing [[@CosmicHorrorDev]]let else statements in favor of macro [[@OverHash]]dirs with home & etcetera [[@utkarshgupta137]]ConnectOptions types impl FromStr [[@abonander]]search_path [[@95ulisse]]sqlx::test [[@kenkoooo]]try_acquire [[@abonander]]tracked_path [[@df51d]]PrepareOk fails to decode [[@stepantubanov]]Nothing published for this version
Nothing published for this version
Nothing published for this version
This is a hotfix to address the breakage caused by transitive dependencies upgrading to syn = "2".
This is a hotfix to address the breakage caused by transitive dependencies upgrading to syn = "2".
We set default-features = false for our dependency on syn = "1" to be good crates.io citizens,
but failed to enable the features we actually used, which went undetected because we transitively depended on
syn with the default features enabled through other crates,
and so they were also on for us because features are additive.
When those other dependencies upgraded to syn = "2" it was no longer enabling those features for us,
and so compilation broke for projects that don't also depend on syn = "1", transitively or otherwise.
There is no PR for this fix as there was no longer a dedicated development branch for 0.6,
but discussion can be found in issue #2418.
As of this release, the 0.7 release is in alpha and so development is no longer occurring against 0.6.
This fix will be forward-ported to 0.7.
NOTE: this is a breaking change and has been postponed to 0.7.0.
25 pull requests were merged this release cycle.
try_from attribute for FromRow derive [[@zzhengzhuo]]
IpAddr support in Postgres [[@rakshith-ravi]]prepare [[@cycraig]]#[sqlx(flatten)] for FromRow derive [[@RustyYato]]#[test] from #[sqlx::test] [[@alexander-jackson]]FromRow docs [[@zlidner]]sqlite3_exec [[@madadam]]prepare race condition in workspaces [[@cycraig]]\
target/ that cargo sqlx prepare depends on.
If you use offline mode in your workflow, please rerun cargo install sqlx-cli to upgrade.[33 pull requests][0.6.1-prs] were merged this release cycle.
33 pull requests were merged this release cycle.
FromRow trait [[@Erik1000]]std::net::IpAddr [[@meh]]
INET value in Postgres is a prefix and not a full address
(/32 for IPv4, /128 for IPv6).time crate [[@johnbcodes]]QueryBuilder::separated() [[@sbeckeriv]]sqlx::types::Json [[@jayy-lmao]]Clone for PoolOptions [[@Thomasdezeeuw]]push_tuples for QueryBuilder [[@0xdeafbeef]]#[sqlx(flatten)] attribute in FromRow [[@TheoOiry]]query_builder::Separated::push_bind_unseparated() [[@0xdeafbeef]]#[sqlx::test] for general use
QueryBuilder improvements [[@abonander]]
QueryAs instead of Query.query_as!() and FromRow [[@abonander]]dotenv with dotenvy [[@abonander]]cargo sqlx prepare --merged [[@LovecraftianHorror]]Any database driver [[@raviqqe]]CARGO_TARGET_DIR when compiling queries [[@sedrik]]BYTEA decode [[@e00E]]S or V notice fields are not UTF-8 [[@abonander]]rust-cache action for CI [[@abonander]]PgListener [[@crepererum]]master to main in docs [[@crepererum]]
This release marks the end of the 0.5.x series of releases and contains a number of breaking changes, mainly to do with backwards-incompatible depende…
This release marks the end of the 0.5.x series of releases and contains a number of breaking changes, mainly to do with backwards-incompatible dependency upgrades.
As we foresee many more of these in the future, we surveyed the community on how to handle this; the consensus appears to be "just release breaking changes more often."
As such, we expect the 0.6.x release series to be a shorter one.
39 pull requests(!) (not counting "prepare 0.5.12 release", of course) were merged this release cycle.
server_version_num from trait to inherent impl [[@AtkinsChang]]ipnetwork to 0.19 [[@paolobarbolini]]time to 0.3 [[@paolobarbolini]]rustls to 0.20 [[@paolobarbolini]]
webpki is no longer exposed in the API.bigdecimal to 0.3 [[@e00E]]Oid everywhere instead of u32 [[@paolobarbolini]]
Type, Decode, Encode impls for u32 for Postgres as it was misleading.
Postgres doesn't support unsigned ints without using an extension. These impls were decoding Postgres OIDs
as bare u32s without any context (and trying to bind a u32 to a query would produce an OID value in SQL).
This changes that to use a newtype instead, for clarity.ConnectOptions types cloneable [[@05storm26]]chrono::DateTime<FixedOffset> timezone fix [[@05storm26]]
DateTime<FixedOffset> will be stored in SQLite with the correct timezone instead of always in UTC.
This was flagged as a "potentially breaking change" since it changes how dates are sent to SQLite.git2 to 0.14 [[@joshtriplett]]PgLTree::push() infallible and take PgLTreeLabel directly [[@sebpuetz]]REAL [[@pruthvikar]]
REAL column to f64 instead of f32 as SQLite uses only 64-bit floats.sqlx::query!() with SQLite.uuid crate to v1 [[@paolobarbolini]]PoolOptions::connect_timeout to acquire_timeout for clarity.PoolOptions::after_connect, before_acquire, after_releasePool::close() slightly
.awaiting is only necessary if you want to ensure a graceful shutdown.PoolConnection::release() which was previously deprecated in favor of PoolConnection::detach()..close().PgHasArrayType for #[sqlx(transparent)] types [[@carols10cents]]
PgValueRef [[@mfreeborn]]--connect-timeout [[@abonander]]
i16 to Any driver [[@EthanYuan]]ConnectOptions and PoolOptions on Pool and database name on PgConnectOptions [[@Nukesor]]sqlx-macros [[@LovecraftianHorror]]crc to 3.0 [[@djc]]Usage to the same level as Install [[@tobymurray]][] from host string before passing to TcpStream [[@smonv]]
serde_json in macros [[@mfreeborn]]field is never read warnings on Postgres test [[@walf443]]unused result must be used warnings [[@walf443]]sqlx migrate info [[@mdtusz]]This is a hotfix that reverts [#1748] as that was an accidental breaking change: the generated PgHasArrayType impl conflicts with manual impls of the…
This is a hotfix that reverts [#1748] as that was an accidental breaking change:
the generated PgHasArrayType impl conflicts with manual impls of the trait.
This change will have to wait for 0.6.0.
[27 pull requests][0.5.12-prs] were merged this release cycle.
27 pull requests were merged this release cycle.
PgHasArrayType for serde_json::{Value, RawValue} [[@abreis]]Clone for MySqlArguments and MssqlArguments [[@0xdeafbeef]]PgHasArrayType for #[sqlx(transparent)] types [[@carols10cents]]Type for Cow<str> for MySQL, MSSQL and SQLite [[@ipetkov]]--source to migration subcommands [[@pedromfedricci]]extra_float_digits settable [[@abonander]]
None for Postgres or third-party database servers that don't support the option.PgListener preventing Pool::close() from resolving.NUMERIC[] using decimal feature [[@tm-drtina]]FromStr, Copy, PartialEq, Eq impls for options enums [[@andrewwhitehead]]heck to 0.4 [[@paolobarbolini]]regex [[@Dylan-DPC]]libsqlite3-sys [[@espindola]]query!() docs [[@vbmade2000]]DATABASE_URL to command spawned in prepare [[@LovecraftianHorror]]TSTZRANGE [[@mgrachev]]QueryAs to query_as() in docs [[@mgrachev]]query!() macros [[@tyrelr]].pgpass files [[@SebastienGllmt]]PoolConnection: don't leak connection permit if drop task fails to run [[@abonander]][20 pull requests][0.5.11-prs] were merged this release cycle.
20 pull requests were merged this release cycle.
AnyConnectOptions to a specific ConnectOptions [[@05storm26]]From for AnyConnection [[@genusistimelord]]SQLITE_LOCKED [[@madadam]]sqlx migrate info [[@ifn3]]opt-level for sqlx-macros [[@LovecraftianHorror]]Acquire examples and alternative [[@stoically]]ltree [[@cemoktra]]lquery [[@cemoktra]]NOTICE logs [[@dbeckwith]]sqlx-data.json instead of reparsing [[@LovecraftianHorror]]as _ [[@k-jun]]cargo-sqlx command-line definition [[@tranzystorek-io]]Option<T> for Any driver [[@ArGGu]]BigDecimal into NUMERIC [[@VersBinarii]]Additionally, we have introduced two mitigations for the issue of the cyclic dependency on ahash:
indexmap from 1.7.0 back to 1.6.2 so users can pin it to that
version as recommended in aHash#95.
preserve_order feature of
serde_json which gives users another place to break the cycle by simply not enabling that feature.
sqlx-data.json, however. If this is an issue for you but
the dependency cycle isn't, you can re-enable the preserve_order feature:[dependencies]
serde_json = { version = "1", features = ["preserve_order"] }
[A whopping 31 pull requests][0.5.10-prs] were merged this release cycle!
A whopping 31 pull requests were merged this release cycle!
According to this changelog, we saw 18 new contributors! However, some of these folks may have missed getting mentioned in previous entries since we only listed highlights. To avoid anyone feeling left out, I put in the effort this time and tried to list every single one here.
Pool::any_kind() [[@nitnelave]]Encode/Decode impl for Cow<'_, str> [[@Drevoed]]Clone, Copy for AnyKind [[@yuyawk]]migrate!() docs [[@zbigniewzolnierowicz]].persistent(bool) to QueryAs, QueryScalar [[@akiradeveloper]]rust_decimal::Decimal in PgRange [[@meh]]PGOPTIONS and adding custom configuration options in PgConnectOptions [[@liushuyu]]either::Either used by Executor::fetch_many() [[@DoumanAsh]]native-tls for sqlx-cli [[@SonicZentropy]]AnyConnection::kind() [[@05storm26]]runtime-async-std-native-tls as the default runtime in README.md [[@yerke]]Pool docs in a couple places [[@abonander]]libsqlite-sys to 0.23.1 [[@nitsky]]whoami dep optional, only pull it in for Postgres [[@joshtriplett]]rsa crate to 0.5 [[@paolobarbolini]]itoa and dirs [[@paolobarbolini]]chrono::Duration to PgInterval [[@yuyawk]]indexmap version requirement to 1.6.2 [[@dimfeld]]PgCopyIn [[@akiradeveloper]]~/.pgpass password after URL parsing and fix user and database ordering [[@D1plo1d]]cargo sqlx prepare: Append to existing RUSTFLAGS instead of overwriting [[@tkintscher]]PRAGMA key on a new connection before anything else. [[@parazyd]]
A hotfix release to address the issue of the sqlx crate itself still depending on older versions of sqlx-core and sqlx-macros.
A hotfix release to address the issue of the sqlx crate itself still depending on older versions of sqlx-core and
sqlx-macros.
No other changes from 0.5.8.
[A total of 24 pull requests][0.5.8-prs] were merged this release cycle! Some highlights:
A total of 24 pull requests were merged this release cycle! Some highlights:
immutable option on SQLite connections [[@djmarcin]]PRAGMAs and overriding those set by SQLx.COPY FROM/TO[[@montanalow], [@abonander]][[#1392]] use resolve_path when getting path for include_str!() [[@abonander]]
A large bugfix release, including but not limited to:
A large bugfix release, including but not limited to:
MACADDR type for Postgres [[@nomick]]PortalSuspended for array of composite types in Postgres [[@AtkinsChang]]sqlx::Pool internals using futures-intrusive [[@abonander]]
sqlx build-script to create a build.rs to watch migrations/ for changes.RUSTFLAGS=--cfg sqlx_macros_unstable to tell the compiler
to watch migrations/ for changes instead of using a build script.sqlx::migrate!() for details.INSERT/UPDATE/DELETE ... RETURNING ... in SQLite.A total of 25 pull requests were merged this release cycle!
[[#1242]] Fix infinite loop at compile time when using query macros [[@toshokan]]
[[#1235]] Fix compilation with rustls from an eager update to webpki [[@ETCaton]]
[[#1211]] Even more tweaks and fixes to the Pool internals [[@abonander]]
[#1211] Even more tweaks and fixes to the Pool internals [[@abonander]]
[#1213] Add support for bytes and chrono::NaiveDateTime to Any [[@guylapid]]
[#1224] Add support for chrono::DateTime<Local> to Any with MySQL [[@NatPRoach]]
[#1216] Skip empty lines and comments in pgpass files [[@feikesteenbergen]]
[#1218] Add support for PgMoney to the compile-time type-checking [[@iamsiddhant05]]
[[#1149]] Tweak and optimize Pool internals [[@abonander]]
[#1149] Tweak and optimize Pool internals [[@abonander]]
[#1132] Remove 'static bound on Connection::transaction [[@argv-minus-one]]
[#1128] Fix -y flag for sqlx db reset -y [[@qqwa]]
[#1099] [#1097] Truncate buffer when BufStream is dropped [[@Diggsey]]
[#1170] Remove Self: Type bounds in Encode / Decode implementations for arrays [[@jplatte]]
Enables working around the lack of support for user-defined array types:
#[derive(sqlx::Encode)]
struct Foos<'a>(&'a [Foo]);
impl sqlx::Type<sqlx::Postgres> for Foos<'_> {
fn type_info() -> PgTypeInfo {
PgTypeInfo::with_name("_foo")
}
}
query_as!(
Whatever,
"<QUERY with $1 of type foo[]>",
Foos(&foo_vec) as _,
)
[#1141] Use u16::MAX instead of i16::MAX for a check against the largest number of parameters in a query [[@crajcan]]
[#1112] Add support for DOMAIN types [[@demurgos]]
[#1100] Explicitly UNLISTEN before returning connections to the pool in PgListener [[@Diggsey]]
- Update sqlx-rt to 0.3.
[[#983]] [[#1022]] Upgrade async runtime dependencies [[@seryl], [@ant32], [@jplatte], [@robjtede]]
[#983] [#1022] Upgrade async runtime dependencies [[@seryl], [@ant32], [@jplatte], [@robjtede]]
[[#854]] Allow chaining map and try_map [[@jplatte]]
Additionally enables calling these combinators with the macros:
let ones: Vec<i32> = query!("SELECT 1 as foo")
.map(|row| row.foo)
.fetch_all(&mut conn).await?;
[#940] Rename the #[sqlx(rename)] attribute used to specify the type name on the database
side to #[sqlx(type_name)] [[@jplatte]].
[#976] Rename the DbDone types to DbQueryResult. [[@jplatte]]
[#976] Remove the Done trait. The .rows_affected() method is now available as an inherent
method on PgQueryResult, MySqlQueryResult and so on. [[@jplatte]]
[#1007] Remove any::AnyType (and replace with directly implementing Type<Any>) [[@jplatte]]
[#919] For SQLite, add support for unsigned integers [[@dignifiedquire]]
https://github.com/launchbadge/sqlx/issues/47
Support Tokio through an optional runtime-tokio feature.
Support SQL transactions. You may now use the begin() function on Pool or Connection to
start a new SQL transaction. This returns sqlx::Transaction which will ROLLBACK on Drop
or can be explicitly COMMIT using commit().
Support TLS connections.
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →