Commit graph

2487 commits

Author SHA1 Message Date
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
Josh Triplett
a5c1cd021c sqlx-core: Remove dotenvy dependency
sqlx-core doesn't use dotenvy. Removing it means that users who only
depend on sqlx with sqlite and default-feature = false don't need it.
2024-01-14 21:56:54 -08:00
Austin Bonander
982c014f54
Merge pull request #2919 from shengsheng/fix_doc
fix duplicate "`" in FromRow "default" attribute doc comment
2024-01-05 21:17:18 -08:00
Austin Bonander
7044a92858 fix: fix new warnings that cropped up 2024-01-05 19:05:16 -08:00
Austin Bonander
4c22994605 fix(core): export net::socket::WriteBuffer 2024-01-05 18:55:34 -08:00
Austin Bonander
9b0a09387c
Update README.md 2024-01-05 18:51:27 -08:00
Austin Bonander
ea4703ea64
Merge pull request #2932 from tsing/fix-copy-in
fix(postgres): avoid unnecessary flush in PgCopyIn::read_from
2024-01-05 18:36:08 -08:00
Austin Bonander
2d397a56ca
Merge pull request #2963 from tadghh/patch-2
Fixed ReadMe badge styling
2024-01-05 18:35:46 -08:00
Tadgh Henry
9c45eaa062
Fixed badge styling
whitespace is being interpreted by the a tag causing blue hyperlinks to show up between the badges.
2024-01-02 12:49:53 -06:00
Jesse Wang
91c6e6668b
fix(postgres): avoid unnecessary flush in PgCopyIn::read_from 2023-12-12 22:53:00 +13:00
Arthur
7becff70ba fix duplicate "`" in FromRow "default" attribute doc comment 2023-12-07 14:36:00 +08:00
Austin Bonander
929af41745
Merge pull request #2898 from Vrajs16/fix-docs
Fixed docs
2023-11-25 11:01:48 -08:00
Vraj Shah
e214a08ede Fixed docs 2023-11-25 10:11:00 -05:00
Austin Bonander
c55aba0dc1
Merge pull request #2895 from launchbadge/release/0.7.3
0.7.3 release
2023-11-22 18:23:16 -08:00
Austin Bonander
b4cce67b83 fix(changelog): correct release date for 0.7.3
also fix formatting for 0.6.3 cause it was bugging me
2023-11-22 18:11:58 -08:00
Austin Bonander
213ecd743c chore: upgrade libsqlite3-sys 2023-11-22 17:55:04 -08:00
Austin Bonander
31d402b469 chore: prepare 0.7.3 release 2023-11-22 17:43:46 -08:00
Austin Bonander
9fc9e7518e
feat: Text adapter (#2894) 2023-11-22 17:06:47 -08:00
Vraj Shah
62f82cc43a
Fixed force dropping bug (#2892) 2023-11-21 12:42:08 -08:00
Vraj Shah
fda415927a
Sqlx Cli: Added force flag to drop database for postgres (#2873)
* Updated ahash so it can compile on mac

* Updated MigrateDatabase Trait + related functions

* Postgres force drop database flag impl

* Update migrate.rs

* Reverted MigrateDatabase Trait

* Update migrate.rs

* Update migrate.rs

* Added force drop database fn impl

* Add Migrate Error

* Fixed changed function name
2023-11-21 11:11:08 -08:00
Austin Bonander
ed1b030e91
doc(sqlite): cover lack of NUMERIC support (#2890) 2023-11-20 20:14:20 -08:00
Ferenc Tamás
d3a28d461f
Do not require db url for prepare (#2882)
* feat(cli): do not require db url

* chore: remove unused import

* fix(cli): do not always pass DATABASE_URL

* fix(cli): check db when DATABASE_URL is provided
2023-11-20 20:11:23 -08:00
Austin Bonander
979a55da9d
feat: use specific message for slow query logs (#2880)
closes #2669
2023-11-15 20:08:09 -08:00
Roberto Ripamonti
16eeea8611
Add fixtures_path in sqlx::test args (#2545)
* feat: add fixtures_path

* test: add test for fixtures_path

* docs: expand test docs with fixtures_path

* test: add new test instead of co-opting and old one.

* feat: add explicit path operating mode for fixtures parameters and allow combining multiple fixtures parameters

* fix: require .sql extension for explicit path fixtures

* feat: add custom relative path style to fixtures argument

* fix: missing cfg feature

* docs: update

* fix: explicit fixtures styling checks for paths. Remove strict sql extension requirement for explicit path, they still need an extension. Add .sql extension to implicit fixtures style only if missing.

* style: cargo fmt

* docs: update documentation
2023-11-15 16:08:24 -08:00
Shift Right Once
9a6ebd0a74
Add a get_database method (#2871)
The Postgres implementation has this method. It is also
helpful for queries that require the current datbase name.
example:

```sql
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_name = ? &&
table_schema = ?;
```
2023-11-15 15:22:15 -08:00
Vraj Shah
6ecb5831f4
Update Faq - Bulk upsert with optional fields (#2865)
* Update Faq - Bulk upsert with optional fields

* Applied Suggestion + fixed typo
2023-11-07 20:05:11 -08:00
Austin Bonander
ea8e0ab9c4
fix(sqlite): use AtomicUsize for thread IDs (#2864) 2023-11-07 11:58:15 -08:00
Cameron Braid
b91e4de2a4
fix: Make rust_decimal and bigdecimal decoding more lenient (#2688)
fixes https://github.com/readysettech/readyset/issues/143

When using readyset as a caching proxy - readyset returns a decimal with the following type info `MySqlTypeInfo { type: Decimal, flags: ColumnFlags(0x0), char_set: 33, max_size: Some(1024) }`

Currently rust_decimal and bigdecimal expect an exact match for the type info `MySqlTypeInfo { type: NewDecimal, flags: ColumnFlags(BINARY), char_set: 63, max_size: None }`

Therefore the following error  occurs when readyset sends a valid decimal type

```
    error occurred while decoding column "price": mismatched types; Rust type `core::option::Option<rust_decimal::decimal::Decimal>` (as SQL type `DECIMAL`) is not compatible with SQL type `DECIMAL`
```

This patch makes the `Type<MySql> for Decimal` more lenient by matching `MySqlTypeInfo` that has ColumType::Decimal |  ColumnType::NewDecimal to be parsed by both rust_decimal and bigdecimal types
2023-11-07 11:05:21 -08:00
Jason Klein
ee73c847a7
Fixed (#2838)
fmt
2023-11-06 17:36:31 -08:00
Yuri Astrakhan
ee3b94d726
Prevent warnings running cargo build (#2856)
When none of the features is enabled (default features), prevent compiler warnings.
2023-11-06 12:47:47 -08:00
Austin Bonander
cd39cb2e29
Create pull_request_template.md 2023-11-03 18:03:10 -07:00
Brian Heineman
92523f3629
Update extra_float_digits default to 2 instead of 3 (#2832) 2023-11-03 17:23:53 -07:00
Rico
220bf93dc2
Fix comment in sqlx migrate add help (#2847)
The old description for the `sequential` flag read "If set, use *timestamp* versioning".
I guess this was a simple copy-paste error.
2023-11-03 17:23:36 -07:00
Austin Bonander
9dbd52c9b3
fix(core): avoid unnecessary wakeups in try_stream!() (#2850)
fixes #2834
2023-11-03 17:23:25 -07:00
Austin Bonander
82fadce729 doc: inline reexports from drivers 2023-11-01 18:32:29 -07:00
Boris.Lok
e1ac388173
Provide fn PgConnectOptions::get_host(&self) (#2752)
Co-authored-by: boris <boris.lok@cienet.com>
2023-10-23 16:48:41 -07:00
Nano
ba87bf7473
Add impl FromRow for the unit type (#2827) 2023-10-23 16:45:33 -07:00
Dirkjan Ochtman
068ea14665
chore: bump some sqlx-core dependencies (#2826)
* chore: update Cargo.lock

* chore: avoid deprecated chrono API

* chore: avoid deprecated rustls API

* chore: bump webpki-roots to 0.25

* chore: remove unused generic-array dependency
2023-10-23 15:19:55 -07:00
Anup Jadhav
49ccc7ca32
issue #2821 Update error handling logic when opening a TCP connection (#2822)
This commit updates the error handling logic in the `connect_tcp` function. Previously, the function would panic if the hostname did not resolve to at least one address.

The updated logic attempts to establish a TCP connection for each address that the hostname resolves to. If it fails to connect to any of the addresses, it will return the last encountered error. If the hostname doesn't resolve to any addresses, the function returns a custom error message stating "Hostname did not resolve to any addresses".
2023-10-19 14:55:45 -07:00
qwerty2501
00b077ab14
Is tests/x.py maintained? And I tried fix it. (#2754)
* chore:Added ipaddr extension library to gitignore

* fix:In a Linux environment, shared libraries in the current directory are not loaded, so add the current directory to the LD_LIBRARY_PATH environment variable.

* fix: Since confrict primary key when running multiple sqlite tests, removed specific primary key in insert.

* chore: Since avoid git modified targeting, copy the db file to new test db file.

* fix: Since docker mysql 5.7 using yaSSL(It only supports TLSv1.1), avoid running when using rustls.
2023-10-19 14:54:01 -07:00
Nemo157
080d57af3a
Customize the macro error message based on offline status (#2769) 2023-10-17 16:25:09 -07:00
Gregor Giesen
54c5d6bc3c
derive FromRow: sqlx(default) for all fields (#2801)
* derive FromRow: sqlx(default) for all fields

* error in test_struct_default fixed

* derive FromRow: struct level sqlx(default) requires and uses Default implementation

* Update sqlx-core/src/from_row.rs

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

* Update sqlx-core/src/from_row.rs

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

* satify cargo fmt

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-10-17 16:13:40 -07:00
失魂魚
a7d2703d64
Add additional info regarding using Transaction and PoolConnection as Executor (#2713)
Copy-paste from https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md#070---2023-06-30
2023-10-17 16:11:56 -07:00
Peter Hamilton
ab0d10d935
Make PgListener recover from UnexpectedEof (#2684)
This is often encountered when the host the db is on is restarted.
For example, a reboot of AWS Aurora causes this. If we don't handle this
properly the PgListeners are stuck in an erroring state, even when the DB
is back online. By catching it here, we will reconnect when it is
(eventually) back online.
2023-10-17 16:10:53 -07:00
Uttarayan Mondal
b85b72355e
[fix] Urlencode when passing filenames to sqlite3 (#2655) 2023-10-17 11:44:25 -07:00
Matt Fellenz
b16fbebf2f
Don't use separate temp dir for query jsons (2) (#2803)
* Don't use temp dir for query jsons

Fixes #2663

* Return early when exclusive create fails

* Use atomic-file-write for writing query data
2023-10-17 11:41:30 -07:00
Conrad Ludgate
f93bbe87be
postgres begin cancel safe (#2819) 2023-10-16 19:20:48 -07:00
Austin Bonander
58cb18a47a
fix: correct decoding of rust_decimal::Decimal for high-precision values (#2820)
also fixes handling of feature flags
2023-10-16 14:03:28 -07:00
hgranthorner
540baf7df5
feat(citext): support postgres citext (#2478)
* feat(citext): implement citext for postgres

* feat(citext): add citext -> String conversion test

* feat(citext): fix ltree -> citree

* feat(citext): add citext to the setup.sql

* chore: address nits to #2478

* Rename `PgCitext` to `PgCiText`
* Document when use of `PgCiText` is warranted
* Document potentially surprising `PartialEq` behavior
* Test that the macros consider `CITEXT` to be compatible with `String` and friends

* doc: add `PgCiText` to `postgres::types` listing

* chore: restore missing trailing line break to `tests/postgres/setup.sql`

---------

Co-authored-by: Austin Bonander <austin@launchbadge.com>
2023-10-11 18:03:36 -07:00
hgranthorner
56945d7396
feat(citext): support postgres citext (#2478)
* feat(citext): implement citext for postgres

* feat(citext): add citext -> String conversion test

* feat(citext): fix ltree -> citree

* feat(citext): add citext to the setup.sql

* chore: address nits to #2478

* Rename `PgCitext` to `PgCiText`
* Document when use of `PgCiText` is warranted
* Document potentially surprising `PartialEq` behavior
* Test that the macros consider `CITEXT` to be compatible with `String` and friends

* doc: add `PgCiText` to `postgres::types` listing

* chore: restore missing trailing line break to `tests/postgres/setup.sql`

---------

Co-authored-by: Austin Bonander <austin@launchbadge.com>
2023-10-11 18:03:17 -07:00