Commit graph

2592 commits

Author SHA1 Message Date
Austin Bonander
28cfdbb40c
Release/0.8.3 ()
* chore: create 0.8.3 release

* fix: prevent dead-branch warning from Clippy in query macros

cc 

* fix: move `#[allow]` from previous commit to the `if` block
2025-01-03 20:28:57 -08:00
joeydewaal
dfd0ac5974
feat: add Transaction type aliases () 2025-01-03 00:26:09 -08:00
Rinat Shigapov
4590b9c3ee
close listener connection on TimedOut and BrokenPipe errors ()
* close listener connection on TimedOut and BrokerPipe errors

* use matches macro to generate jump table instead of chain of conditions
2024-12-24 17:00:40 -08:00
Jakub Łabor
fdd4663318 Add PgConnection::is_explain_available 2024-12-24 01:53:37 -08:00
Jakub Labor
20bccf8877 Dont use EXPLAIN in nullability check for QuestDB 2024-12-24 01:53:37 -08:00
Paolo Barbolini
7d148bd96b Bump hashbrown to v0.15 2024-12-24 01:52:20 -08:00
Paolo Barbolini
9f6ea96e03 Roll PostgreSQL 11..=15 tests to 13..=17 2024-12-19 19:12:16 -08:00
James H.
1678b19a46
feat: add geometry line ()
* feat: add geometry line

* fix: point vs line

* fix: try regular comparison for line

* fix: undo point comparison change

* fix: regular comparison for array lines

* fix: remove line array test
2024-12-12 12:52:30 -08:00
Paolo Barbolini
2b82ce3faa Bump hashlink to v0.10 2024-12-12 12:43:39 -08:00
joeydewaal
1f6ce33df4
chore: remove BoxFuture's (non-breaking) ()
* chore: reduce BoxFuture's when using recursion.

* remove BoxFuture's in WithSocket

* chore: better document previous changes
2024-12-12 12:43:22 -08:00
Philip Cristiano
42ce24dab8
Add support for Postgres lquery arrays ()
An lquery array can be used with the `?` operator for "Does ltree match
any lquery in array?"

Documentation: https://www.postgresql.org/docs/current/ltree.html#LTREE-OPS-FUNCS

Closes 
2024-11-27 19:00:13 -08:00
Ilya Bizyaev
35c78f5175
Support building with rustls but native certificates ()
This adds an alternative TLS configuration that relies on rustls-native-certs,
for users who cannot bundle the MPL-licensed webpki-roots.

The approach is copied from reqwest:

* https://github.com/seanmonstar/reqwest/blob/3ad6e02cd/Cargo.toml#L48
* https://github.com/seanmonstar/reqwest/blob/3ad6e02cd/src/async_impl/client.rs#L513

— except error handling is relaxed to accommodate for tls_config.root_cert_path.
2024-11-27 16:39:18 -08:00
Gabriel Lopes Veiga
3e140ba384
Derive Copy where possible ()
For database-specific types.
2024-11-27 14:49:08 -08:00
Austin Bonander
35f3ec1944
fix(mysql): percent-decode database name ()
Duplicates the fix to Postgres in  to the MySQL driver.

The SQLite driver already does this: e3ef8baf23/sqlx-sqlite/src/options/parse.rs (L29-L32)
2024-11-27 14:45:46 -08:00
Lo
94607b5a10
parse timezone parameter in mysql connection url ()
* feat(mysql): support configuring the timezone via url

* test: add test case for mysql with timezone

---------

Co-authored-by: lo <lo@los-MacBook-Pro.local>
2024-11-27 14:14:00 -08:00
Chris Hanks
4f10962743
Add PgListener::next_buffered(), to support batch processing of notifications ()
* Implement and test PgListener::try_recv_buffered().

* rustfmt

* Fix warnings.

* Fix test.

* Rename try_recv_buffered() -> next_buffered().
2024-11-27 13:56:01 -08:00
Sean Lynch
503a72c94f
Eagerly reconnect in PgListener::try_recv ()
When PgListener's underlying connection is closed, try_recv() will
return Ok(None) and reconnect on the next call. In this case, user code
is supposed to reload its state from the database (or otherwise handle
potentially missing messages). However, if the user code uses another
database connection to do so then there is a period between when the
state is reloaded and PgListener's connection is re-established where
notifications are lost without any indication that this has happened.

This commit changes PgListener to eagerly reconnect by default. At the
suggestion of @abonander on discord, I have also included an option to
switch back to the old behaviour in the case where someone was depending
on it.

Now, if the connection is closed then, by default, user code can do
whatever it needs to do in order to recover and any notifications
emitted in the meantime will be waiting for it when it is done.
2024-11-27 13:52:23 -08:00
XueHaonan
5c6623dee2
fix: fix example code of query_as ()
query_as.rs: 230 mismatched bracket.
query_as.rs: 230 move TIMESTAMP to TIMESTAMPTZ to match type time::OffsetDateTime.
query_as.rs: 241, 251, 260 move i64 to i32 to match postgres type `INT4`.
2024-11-27 13:51:52 -08:00
Benoit Ranque
e3ef8baf23
URL decode database name when parsing connection url () 2024-11-27 13:48:34 -08:00
James H.
a7f2928a1b
feat(postgres): point ()
* feat: point

* test: try if eq operator works for arrays of geometries

* fix: re-introduce comparison

* fix: test other geometry comparison

* test: geometry array equality check

* test: array match for geo arrays geo match for geo only

* fix: prepare geometric array type

* fix: update array comparison

* fix: try another method of geometric array comparison

* fix: one more geometry match tests

* fix: correct query syntax

* test: geometry test further
2024-11-27 13:35:42 -08:00
Paolo Barbolini
3e8952b0d4
Bump thiserror to v2.0.0 () 2024-11-26 11:01:33 -08:00
Henri Sivonen
4fac945d5a
Remove default-features = false from url ()
Fixes .
2024-11-26 11:01:18 -08:00
Andrew Eggleston
8dfd3e0bc6
Fix mistake in sqlx::test fixtures docs ()
Alternative option for the sqlx::test fixtures referenced the same fixture twice
2024-11-26 11:00:05 -08:00
Jakub Łabor
80314609ac
Use UNION ALL instead of UNION in nullable check () 2024-11-26 10:59:47 -08:00
Pmarquez
d4ae6ffd88
Implement AnyQueryResult for Sqlite and MySQL ()
* impl AnyQueryResult for Sqlite and MySQL

* fix MySQL AnyQueryResult

* fix MySQL AnyQueryResult

* fix manifest

* rewrite `use` and address implementation concerns
2024-11-26 10:59:20 -08:00
Austin Bonander
82d332f4b4
doc(mysql): document difference between Uuid and uuid::fmt::Hyphenated () 2024-10-28 16:39:43 -07:00
Quentin Gliech
709226c19d
Implement Acquire for PgListener ()
* Implement Acquire for PgListener

* Add a test which checks that PgListener implements Acquire

* Drop unnecessary call to `.acquire()`

* Rename test channel to avoid conflict with other tests
2024-10-28 15:00:06 -07:00
Oleksandr Babak
eac4b7aff7
Fix: Cannot query Postgres INTERVAL[] ()
* fix(sqlx-postgres): macro could not understand pg interval array type

* refactor(sqlx-postgres): move pg interval array types closer to other array types
2024-10-28 14:59:41 -07:00
Joris Willems
3fb00e1403
Reexport AnyTypeKind () 2024-10-28 14:59:18 -07:00
Dennis Schubert
028084bce3
Demote .pgpass file warning to a debug message. ()
Fixes 
2024-10-06 15:21:56 -07:00
Trevor
cadf152e99
fix: remove sqlformat ()
* removed sqlformat from sql-core/src/logger.rs causing ref error to FormatOptions

* removed sqlformat from sql-core/src/logger.rs causing ref error to FormatOptions

---------

Co-authored-by: tbarnes <tbarnes@tbserver.tbarnes-server.local>
2024-10-04 21:34:18 -07:00
Andrei Nesterov
19f40d87a6
Obey no-transaction flag in down migrations () 2024-10-02 15:32:30 -07:00
joeydewaal
72512f7311
Support PgHstore by default in macros ()
* Support PgHstore in macros

* Change tests

* Remove unused import
2024-10-02 11:56:13 -07:00
依云
5b8bb3b28b
Add a "sqlite-unbundled" feature that dynamically links to system libsqlite3.so library ()
* Add a "sqlite-unbundled" feature that dynamically links to system libsqlite3.so library

* update README abouot the newly-added `sqlite-unbundled` feature

* Update README.md to make it clear with bulleted list

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* more cfg feature updates

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* update documentation in sqlx-sqlx/src/lib.rs too

and also mention possible build time increasement.

* cargo fmt

* Add "sqlite-unbundled" feature to sqlx-cli

* Add sqlite-unbundled to gituhb actions tests

* cfg(feature = "sqlite") => cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))

* fix

* CI: make sqlite-unbundled tests workaround required-features

by duplicating the relevant test section

* use an internal "_sqlite" feature to do the conditional compilation

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2024-10-02 11:55:21 -07:00
joeydewaal
68da5aefea
Box Pgconnection fields ()
* Update PgConnection code

* rustfmt
2024-10-02 11:42:54 -07:00
Joey de Waal
81298b86b3 add regression test 2024-10-02 11:42:33 -07:00
Joey de Waal
e62bbd7ee9 Change test macro error message 2024-10-02 11:42:33 -07:00
Joey de Waal
ef039c5d67 recursively look for literal in test macro 2024-10-02 11:42:33 -07:00
vsuryamurthy
293c55ce89 Remove unused dependencies from sqlx-core, sqlx-cli and sqlx-postgres 2024-09-24 18:46:31 -07:00
Simon Brüggen
a496413cb6
doc(sqlite): show how to turn options into a pool ()
It took me 15 minutes of messing around and googling to find
`.connect_with()`.
2024-09-15 21:38:00 -07:00
Austin Bonander
2f5ba71c1e
chore(mysql): create test for passwordless auth () ()
This isn't a solution for , as that seems to be an issue with privileges on the user's side. However, in the process of figuring that out, I realized we never explicitly test password-less auth.
2024-09-14 11:51:22 -07:00
Austin Bonander
dc32f99c0f
doc(README): more prominent link for Discord 2024-09-13 11:49:56 -07:00
gridbox
daeb87bef1
Add sqlite commit and rollback hooks ()
* fix: Derive clone for SqliteOperation

* feat: Add sqlite commit and rollback hooks

---------

Co-authored-by: John Smith <asserta4@gmail.com>
2024-09-12 11:57:02 -07:00
Austin Bonander
419877d734
doc(sqlite): document behavior for zoned date-time types () 2024-09-08 21:53:10 -07:00
John Vandenberg
063953fe60
chore: Update async-std v1.13 in lock file () 2024-09-08 21:52:59 -07:00
Kurt Wolf
c597a225c5
feat: expose relation_id and relation_attribution_no on PgColumn ()
* expose relation_id and relation_attribution_no on PgColumn

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/column.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/column.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* fix

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2024-09-07 18:43:03 -07:00
Austin Bonander
10bec32770 doc(FAQ): add example for MSRV 2024-09-03 14:14:56 -07:00
Austin Bonander
c253e65819 chore: prepare 0.8.2 release 2024-09-03 14:14:56 -07:00
Austin Bonander
998344dcb7 doc(FAQ): refine MSRV policy 2024-09-03 14:14:56 -07:00
Austin Bonander
6cb6fce793 fix(mysql): "exclusive range pattern is experimental" error
closes 
2024-09-03 14:14:56 -07:00