2609 Commits

Author SHA1 Message Date
Austin Bonander
45c0b85b4c feat: teach sqlx-cli about migrate.table-name 2025-01-22 14:24:18 -08:00
Austin Bonander
1ff6a8a950 feat: teach sqlx-cli about migrate.migrations-dir 2025-01-15 10:31:03 -08:00
Austin Bonander
367f2cca98 feat: teach sqlx-cli about migrate.defaults 2025-01-06 16:14:17 -08:00
Austin Bonander
e951d8e128 chore: delete unused source file sqlx-cli/src/migration.rs 2025-01-06 16:14:17 -08:00
Austin Bonander
ba7740d8e5 feat: teach macros about migrate.ignored-chars 2025-01-06 16:14:17 -08:00
Austin Bonander
9d1bc64ced feat: teach macros about migrate.table-name, migrations-dir 2025-01-06 16:14:17 -08:00
Austin Bonander
65ef27f70c feat: make sqlx-cli aware of database-url-var 2025-01-06 16:14:17 -08:00
Austin Bonander
13f6ef0ab0 feat: make macros aware of macros.preferred-crates 2025-01-06 16:14:17 -08:00
Austin Bonander
8604b51ae3 refactor(sqlx.toml): make all keys kebab-case, create macros.preferred-crates 2025-01-06 16:14:16 -08:00
Austin Bonander
5cb3de38b9 feat(macros): implement type_override and column_override from sqlx.toml 2025-01-06 16:14:16 -08:00
Austin Bonander
bf90a477a1 refactor: add origin information to Column 2025-01-06 16:14:16 -08:00
Austin Bonander
e775d2a3eb refactor: make Config always compiled
simplifies usage while still making parsing optional for less generated code
2025-01-06 16:14:16 -08:00
Austin Bonander
9f34fc8dd2 chore: test ignored_chars with U+FEFF (ZWNBSP/BOM)
https://en.wikipedia.org/wiki/Byte_order_mark
2025-01-06 16:14:16 -08:00
Austin Bonander
062a06fc78 feat: add support for ignored_chars config to sqlx_core::migrate 2025-01-06 16:14:16 -08:00
Austin Bonander
afa3a930d2 feat: create sqlx.toml format 2025-01-06 16:14:14 -08:00
Paolo Barbolini
6b337668de
fix(cli): running tests on 32bit platforms (#3666) 2025-01-06 16:00:18 -08:00
Frank Elsinga
9d74aeae52
chore: issue forms with reason-listings (#3476)
* feat: added a draft of an issue form

* fixed a validation issue

* finished up the templates

* used austins phrasing

* Applied comments from the code review

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

* Applyed more suggestions from code review

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

* Broke the environment up into multiple fields

* boiled the FR-fields down to a description and an  breaking change field

* fixed an unique id issue

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2025-01-03 21:24:04 -08:00
Austin Bonander
28cfdbb40c
Release/0.8.3 (#3663)
* chore: create 0.8.3 release

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

cc #3595

* fix: move `#[allow]` from previous commit to the `if` block
v0.8.3
2025-01-03 20:28:57 -08:00
joeydewaal
dfd0ac5974
feat: add Transaction type aliases (#3658) 2025-01-03 00:26:09 -08:00
Rinat Shigapov
4590b9c3ee
close listener connection on TimedOut and BrokenPipe errors (#3648)
* 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 (#3623)
* 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) (#3629)
* 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 (#3553)
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 #2246
2024-11-27 19:00:13 -08:00
Ilya Bizyaev
35c78f5175
Support building with rustls but native certificates (#3551)
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 (#3577)
For database-specific types.
2024-11-27 14:49:08 -08:00
Austin Bonander
35f3ec1944
fix(mysql): percent-decode database name (#3612)
Duplicates the fix to Postgres in #3593 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 (#3418)
* 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 (#3560)
* 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 (#3585)
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 (#3558)
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 (#3593) 2024-11-27 13:48:34 -08:00
James H.
a7f2928a1b
feat(postgres): point (#3583)
* 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 (#3596) 2024-11-26 11:01:33 -08:00
Henri Sivonen
4fac945d5a
Remove default-features = false from url (#3601)
Fixes #3589.
2024-11-26 11:01:18 -08:00
Andrew Eggleston
8dfd3e0bc6
Fix mistake in sqlx::test fixtures docs (#3604)
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 (#3605) 2024-11-26 10:59:47 -08:00
Pmarquez
d4ae6ffd88
Implement AnyQueryResult for Sqlite and MySQL (#3608)
* 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 (#3580) 2024-10-28 16:39:43 -07:00
Quentin Gliech
709226c19d
Implement Acquire for PgListener (#3550)
* 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[] (#3566)
* 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 (#3579) 2024-10-28 14:59:18 -07:00
Dennis Schubert
028084bce3
Demote .pgpass file warning to a debug message. (#3548)
Fixes #3531
2024-10-06 15:21:56 -07:00
Trevor
cadf152e99
fix: remove sqlformat (#3545)
* 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 (#3528) 2024-10-02 15:32:30 -07:00
joeydewaal
72512f7311
Support PgHstore by default in macros (#3514)
* Support PgHstore in macros

* Change tests

* Remove unused import
2024-10-02 11:56:13 -07:00