Commit graph

2386 commits

Author SHA1 Message Date
Daniel
0d0dddf1d0
Constrain cyclic associated types (#2702)
Add bounds such that cyclic associated types are equal to themselves.
```
<T as Connection>::Database as Database>::Connection == T
<T as ConnectOptions>::Connection as Connection>::Options == T
<T as Row>::Database as Database>::Row == T
<T as Column>::Database as Database>::Column == T
<T as Value>::Database as Database>::Value == T
```
2024-03-14 12:37:28 -07:00
nitn3lav
9ba488c831
Generic Associated Types in Database, replacing HasValueRef, HasArguments, HasStatement (#2973)
* HasValueRef, HasArguments, HasStatement -> Database GATs

replace the associated types from the generic traits
`HasValueRef<'r>`, `HasArguments<'q>` and `HasStatement<'q>`
with generic associated types in `Database`

* fixup after rebase

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2024-03-14 12:35:52 -07:00
Jesse Wang
936744dfd6
Fix describe on PostgreSQL views with rules (#2736)
* fix postgres describe on multiple explains

* inline the first explain using smallvec

* fix: regenerate `Cargo.lock`

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2024-03-14 12:05:44 -07:00
Luiz Carvalho
4c6830210b chore: remove deprecation notice for ascription 2024-03-14 12:03:40 -07:00
Luiz Carvalho
8f926e590c refac: rebase syn 2 changes 2024-03-14 12:03:40 -07:00
Guilherme Favero Ferreira
c5357f18e5 bump bigdecimal version 2024-03-11 23:57:07 -07:00
Luiz Carvalho
f316b0d435 fix(macros): only enable chrono when time is disabled 2024-03-11 22:38:47 -07:00
Austin Bonander
30db1f8ffc chore: bump version to 0.8.0-alpha.0 2024-03-11 22:38:24 -07:00
Austin Bonander
635dba5b26 fix: deprecation in postgres::types::chrono 2024-03-11 22:01:04 -07:00
Austin Bonander
a2b89d70a7 fix: deprecation warnings in sqlite::types::chrono, document DATETIME behavior 2024-03-11 22:01:04 -07:00
Austin Bonander
248d6170a7 chore: prepare 0.7.4 release 2024-03-11 22:01:04 -07:00
Austin Bonander
d005111494 fix: better I/O errors when migrate!() cannot read a file 2024-03-06 22:20:59 -08:00
Austin Bonander
24be262165 fix: restore Migrator to the public API 2024-03-06 22:20:59 -08:00
Joe
bbfd0d711a
fix: AnyRow not support PgType::Varchar (#2976) 2024-03-05 19:47:15 -08:00
Lílian
b29eab0439
feat: add to_url_lossy to connect options (#2902)
* feat: add get_url to connect options

Add a get_url to connect options and implement it for all needed types;
include get_filename for sqlite. These changes make it easier to test
sqlx.

* refactor: use expect with message

* refactor: change method name to `to_url_lossy`

* fix: remove unused imports
2024-03-05 19:46:49 -08:00
Austin Bonander
34860b7f99 fix(ci): just cfg-out the whole tests/sqlite/sqlcipher.rs 2024-03-05 18:33:56 -08:00
Austin Bonander
791a7f5417 doc(pg): document behavior of bigdecimal and rust_decimal with out-of-range values
also add a regression test
2024-03-05 18:33:56 -08:00
Austin Bonander
e5c18b354e fix: gate sqlcipher testing behind cfg to make development less annoying 2024-03-05 18:33:56 -08:00
Léo Gaspard
dfb60141bd fix: do not panic when binding a large BigDecimal 2024-03-05 18:33:56 -08:00
Rafael Guerreiro
e8fc35a5a4 Remove sha1 because it's not being used in postgres 2024-03-05 18:10:33 -08:00
Carter
664dbdf54b docs: update example for PgConnectOptions 2024-03-04 21:36:07 -08:00
Austin Bonander
c78425b3ac fix(ci): disable mariadb_verylatest pass for RusTLS
see: #3091
2024-03-04 21:09:49 -08:00
Austin Bonander
c32809af91 fix(migrate): improve error message when parsing version from filename
supercedes #2906
2024-03-04 21:09:49 -08:00
Mirek Klimos
b4f6596b06
Improve max_lifetime handling (#3065)
* Check max lifetime in return_to_pool, not on acquire

* Improve checks in backgrand maintenance task

* add tests

* adjust test to fix
2024-03-04 16:39:59 -08:00
darkecho731
27a49914ad
feat(mysql): allow to connect with mysql driver without default behavor (#3037)
* feat(mysql): provide options to disable default connection settings after connecting

* style(mysql): remove unecessary newlines and run rustfmt

* feat(mysql): allow to pass a custom timezone to the database after connecting
docs(mysql): improve docs for options set_names and no_engine_substitution
2024-02-24 19:30:50 -08:00
ciffelia
8c43b8c7bc
Change the name of "inner" function generated by #[sqlx::test] (#3072) 2024-02-24 17:02:25 -08:00
Matt Fellenz
b615d2a826
Use create_new instead of atomic-file-write (#2914)
* Use `create_new` instead of `atomic-file-write`

This provides the same functionality but without temporary files, platform-specific code, fragility of `O_TMPFILE` support, and an extra dependency.

* Properly handle acceptable failure cases

* Consider `PermissionDenied` as acceptable

Apparently this can occur on Windows.

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2024-02-24 01:49:51 -08:00
Vraj Shah
02f196b4ac
fix: link to correct version in first-migration message (#2900)
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2024-02-18 20:20:29 -08:00
Austin Bonander
ca518b7185
feat: add raw_sql API (#3007)
This is meant to be much easier to discover than the current approach of directly invoking `Executor` methods.

In addition, I'm improving documentation for the `query*()` functions across the board.
2024-02-18 15:38:23 -08:00
Mirek Klimos
dd900e50b6
Optimize SASL auth in sqlx-postgres (#3050)
* Optimize SASL auth in sqlx-postgres

* fix formatting
2024-02-16 16:32:31 -08:00
zoomiti
a1e4984c6c
fix: spans in sqlite tracing (#2876) (#3056) 2024-02-15 22:27:22 -08:00
Mirek Klimos
4c057a0628
Set TCP_NODELAY option on TCP sockets (#3055) 2024-02-15 22:26:52 -08:00
iamjpotts
d7cbf940c3
feat(logging): Add numeric elapsed time field elapsed_secs as f64 (#3004)
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-02-12 13:51:55 -08:00
Ian Gilfillan
84d576004c
Update docs to reflect support for MariaDB data types (#3026) 2024-01-30 13:24:19 -08:00
iamjpotts
978bd50a57
chore: Ignore .sqlx folder created by running ci steps locally (#3008)
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-01-30 13:23:58 -08:00
Paweł Urbanek
0299959ca6
Add default implementation for PgMoney (#3018) 2024-01-30 13:23:45 -08:00
iamjpotts
235604fbce
chore(dev-deps): Upgrade env_logger from 0.9 to 0.11 (#3009)
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-01-25 23:30:25 -08:00
iamjpotts
3946cc82db
chore(deps): Upgrade criterion to 0.5.1 (#3010)
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-01-25 23:30:14 -08:00
Dorje Gilfillan
0e998ceccc
Added support to IpAddr with MySQL/MariaDB. (#3011)
* Added support for IpAddr with MySQL/MariaDB

* Added IpAddr to mysql/types documentation
2024-01-25 23:30:02 -08:00
Paweł Urbanek
af31d5059d
Add default implementation for PgInterval (#3013) 2024-01-25 23:29:51 -08:00
iamjpotts
5890afe95b
chore(deps): Replace unmaintained tempdir crate with tempfile (#3006)
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
2024-01-22 20:16:06 -08:00
Luiz Carvalho
a7862ae416
feat: expose connect options fields (#2891)
Exposes some of the main fields for PgConnectOptions
and MySqlConnectOptions. Exposed fields include: host,
port, socket, ssl mode, application name, and charset.
2024-01-20 18:21:34 -08:00
Lars Schumacher
29dcd44a6a
fix(mysql): Close prepared statement if persistence is disabled (#2905)
* close prepared statement if persistence or statement cache are disabled

* add tests
2024-01-20 18:20:04 -08:00
Thomas de Zeeuw
31e541ac7a
Fix handling of deferred constraints for PostgreSQL (#2913) 2024-01-20 02:36:06 -08:00
Ian Gilfillan
9d2c52178d
Update README to clarify MariaDB support (#3001) 2024-01-19 19:46:10 -08:00
Austin Bonander
fd53e95ff9
doc(FAQ): add entry explaining prepared statements (#2997) 2024-01-17 19:16:02 -08:00
takenoko-gohan
609fcc33e3
Update ahash to 0.8.7 (#2996) 2024-01-17 19:15:51 -08:00
kshramt
b4269b7c86
Support query! for cargo-free systems (#2927)
Co-authored-by: kshramt <kshramt@example.com>
2024-01-17 19:15:22 -08:00
Dawson
2cc3e0f90b
Minor fixes (#2955)
* doc link fix
variable declaration moved for better readability

* migration version abstraction
2024-01-16 13:49:25 -08:00
Austin Bonander
cdcb2f0f2b
Merge pull request #2989 from joshtriplett/sqlx-core-no-dotenvy
sqlx-core: Remove dotenvy dependency
2024-01-16 13:48:25 -08:00