Commit Graph

1969 Commits

Author SHA1 Message Date
Daniel Beckwith
d901694ec6 Add target context to Postgres notice logs (#1606)
Adds a `target` field to the Postgres notice logs and filters based on that target, just like how the query logs do it.
2022-01-04 15:37:37 -08:00
Andrew Whitehead
dec0ed1a4d drop worker shared state in shutdown (#1608)
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
2022-01-04 15:37:16 -08:00
Paolo Barbolini
bcb2d8e604 Remove unused dependencies (#1605) 2022-01-03 16:56:01 -08:00
Austin Bonander
8e46e17ce0 docs: fix install instructions for sqlx-cli 2022-01-03 13:32:58 -08:00
Austin Bonander
fdbfc5dfc3 Prepare 0.5.10 release (#1603)
* fix(cli): change new `rustls` and `native-tls` features to use correct runtime feature

* chore: upgrade SQLx crates to 0.5.10, upgrade all dependencies to latest versions

chore(cli): upgraded `clap` to `3.0.0-rc.9`

* fix(tests/sqlite): ignore `issue_1467()` as spuriously failing

I'm well aware of the principle that a spuriously failing test is a failing test, but even though I have it outputting the seed used with a reproducible PRNG, I can't reproduce the failures locally, so 🤷.

* chore: add CHANGELOG entry for 0.5.10
v0.5.10
2021-12-29 17:25:49 -08:00
SonicZentropy
aa40f5fe5d [CLI] Adds feature enabling Rustls usage rather than OpenSSL (#1584)
* Adds feature enabling Rustls usage rather than OpenSSL

* Update sqlx-cli/Cargo.toml

Removes extraneous openssl feature that slipped through

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

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2021-12-29 15:49:49 -08:00
Austin Bonander
63ca2ccc6c refactor(sqlite): make background thread responsible for all FFI calls (#1551) 2021-12-29 15:23:02 -08:00
liushuyu
b3091b0322 feat(postgres): add an option to specify extra options (#1539)
* feat(postgres): add an option to specify extra options ...

... this allow you to specify stuff like search path and statement
timeouts etc.

* feat(postgres): set options through setting run-time parameters

* feat(postgres): use flat command-list instead of hashmap

* feat(postgres): make the options taking parameters with `Display` trait
2021-12-29 13:10:18 -08:00
Charles Samborski
32f1273565 Fix support for Postgres array of custom types (#1483)
This commit fixes the array decoder to support custom types. The core of the issue was that the array decoder did not use the type info retrieved from the database. It means that it only supported native types.

This commit fixes the issue by using the element type info fetched from the database. A new internal helper method is added to the `PgType` struct: it returns the type info for the inner array element, if available.

Closes #1477
2021-12-29 13:05:15 -08:00
Pieter
dee514704f Postgres: Array enum encoding (#1511)
* Postgres: Add test for array enum

* Allow produces() to override type_info() as per doc

* run cargo fmt
2021-12-29 13:04:42 -08:00
Douman
04109d9323 Reimport Either used in Executor (#1562)
* Reimport Either used in Executor

* Re-import sqlx-core

* Update src/lib.rs

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

* Apply fmt

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2021-12-29 13:01:16 -08:00
Rob Gilson
f79d321b78 fix(postgres): Match ~/.pgpass password after URL parsing and fix user and database ordering (#1566)
* fix(postgres): Fixes pgpass so it applies after parsing and matches usernames & databases correctly

* chore: Updated unit test

* refactor: Previous semantics of PgConnectOptions::default()

* refactor: formatting
2021-12-29 13:00:49 -08:00
Paolo Barbolini
fca866d0bc Update itoa and dirs (#1601) 2021-12-29 11:56:58 -08:00
05storm26
beb2100f29 Make the database kind queryable from AnyConnectionKind and AnyConnection (#1592) 2021-12-28 17:19:26 -08:00
parazyd
d258e8c681 core/sqlite: Add special case for sqlcipher key pragma when connecting. (#1587)
* core/sqlite: Add special case for sqlcipher key pragma when connecting.

* core/sqlite: Move std::fmt::Write import to module level.
2021-12-27 15:33:06 -08:00
Kunjan Dalal
566b666df6 Added another ORM option which is build on SQLx (#1591) 2021-12-27 14:09:20 -08:00
Thomas Kintscher
f0d0f2f2e9 Append to existing RUSTFLAGS, instead of overwriting. (#1582)
* Append to existing RUSTFLAGS, instead of overwriting.

* Assemble RUSTFLAGS correctly.

Co-authored-by: Thomas Kintscher <thomas@flowciety.de>
2021-12-20 19:12:58 -08:00
Paolo Barbolini
ce572bcee4 Update rsa crate to 0.5 (#1572)
* Update rsa crate to 0.5

* Don't do pem decoding ourselves
2021-12-20 17:58:37 -08:00
Josh Triplett
2e6ab7c3de Make whoami optional, and only pull it in for postgres (#1571)
sqlx-core uses whoami to provide the fallback for postgres username. If
not building postgres support, omit the dependency on whoami.
2021-12-20 17:54:58 -08:00
Paolo Barbolini
f2b3cc8dc3 ci: test on Postgres 14 (#1557) 2021-11-29 12:58:19 -08:00
Jonas Platte
12d9f54c7d Rewrite Postgres array type handling (#1385)
… to reduce boilerplate and allow custom types.
2021-11-22 17:17:00 -08:00
nitnelave
5aef7d7801 Add a get_kind method to Pool (#1228) 2021-11-22 17:00:00 -08:00
David Yamnitsky
8299687878 bump libsqlite3-sys to 0.23.1 (#1535) 2021-11-12 14:37:19 -08:00
Akira Hayakawa
a304161b28 Copy API improvement (#1536) (#1537)
* expose PgCopyIn

* downgrade Pool<Posgres> copy_in_raw/out_row to take &self
2021-11-12 14:15:15 -08:00
Austin Bonander
c8db803dca fix(sqlx-cli/readme): mention openssl-vendored 2021-11-09 18:02:32 -08:00
Austin Bonander
fc056315db fix(readme): mention examples 2021-11-09 17:55:55 -08:00
Austin Bonander
3604c6b9a0 fix(readme): mention offline feature
closes #1490
2021-11-09 17:35:37 -08:00
Austin Bonander
35c5e325aa fix(readme): show runtime features in quickstart
closes #1492
2021-11-09 17:24:09 -08:00
Austin Bonander
51954fed8c fix(readme): link to dotenv crate
closes #1405
2021-11-09 17:16:00 -08:00
Zbigniew Żołnierowicz
ce801b9330 Include a reference to the shape of the migration files in the migrate macro documentation (#1498) 2021-11-08 19:02:01 -08:00
Kirill Mironov
df2d5c7a1b Encode/Decode impl for Cow<'_, str> (#1343)
* Encode/Decode impl for Cow<'_, str>

resolves #1214

* --wip-- [skip ci]

* Add Cow decode/encode to other databases and fix build
2021-11-08 18:58:24 -08:00
yuyawk
626dd0db38 fix panic when converting negative chrono::Duration into PgInterval (#1475)
* fix PgInterval convert failure for negative chrono::Duration

* add unit tests for PgInterval

* Fix: remove redundancy because nanosecond overflow implies microsecond overflow
2021-11-08 18:47:57 -08:00
yuyawk
cdb40b1f8e derive Clone, Copy for AnyKind (#1474) 2021-11-08 18:45:19 -08:00
Austin Bonander
b419bf5298 docs: revise Pool docs in a couple places (#1526) 2021-11-04 18:52:55 -07:00
Russ Weas
069cfca0f3 Update FAQ to include building on docs.rs (#1497)
Thanks to @jplatte in the sqlx Discord for providing this solution.
2021-11-03 12:29:23 -07:00
meh
62b57f021f fix(postgres): allow rust_decimal::Decimal in PgRange (#1523)
* fix(postgres): allow rust_decimal::Decimal in PgRange

* test(postgres): add tests for BigDecimal and Decimal in ranges
2021-11-03 12:28:39 -07:00
Daniel Imfeld
1efbbcaffa Reduce indexmap version to 1.6.2 (#1501)
deno_core currently uses `=1.6.2` for indexmap, and Cargo refuses to resolve a version with sqlx's requirement of 1.7.0.

004d07dccd/core/Cargo.toml (L18)
2021-11-02 18:22:49 -07:00
Akira Hayakawa
f1851e7832 Add persistent setter (#1503) (#1508) 2021-11-02 18:08:15 -07:00
Lucille Blumire
4ada6ac7e1 Add support for serialized threading mode to sqlite (#1514)
* Add support for serialized threading mode

* Typos

* Fix build
2021-11-02 18:07:56 -07:00
Austin Bonander
d25ab07f21 fix(test): fix mismatched type error in MySQL type tests (#1517)
* fix new warning about trailing semicolon in expression macros

* fix(test): fix mismatched type error in MySQL type tests
2021-10-26 13:45:46 -07:00
Yerkebulan Tulibergenov
466d3f317d Update README.md (#1479) 2021-10-20 16:40:34 -07:00
Austin Bonander
9abe9b3ac5 prepare 0.5.9 hotfix release (#1469) 2021-10-01 15:52:52 -07:00
Austin Bonander
1b5dd6514b preparing 0.5.8 release (#1466)
* preparing 0.5.8 release

* fix warnings before release
v0.5.8
2021-10-01 14:45:25 -07:00
Erik
efde5c507f Add reverting instructions to README (#1468)
Instructions on reverting migrations are missing from the README. Here are some that others may find helpful.
2021-10-01 13:44:48 -07:00
Billy Chan
8561891474 [SQLite] encoding & decoding NaiveTime with correct format (#1459)
* Fix SQLite encoding format

* Update SQLite decoding format

* Update sqlx-core/src/sqlite/types/chrono.rs

* fixup: add `#[rustfmt::skip]`

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2021-09-30 19:45:48 -07:00
Austin Bonander
51e45ce3ab Revert "feat: allow log level customization (#1371)" (#1465)
This reverts commit 719d80038b.
2021-09-30 18:58:42 -07:00
Andrew Whitehead
ba3e373b7e Shut down statement worker in Sqlite Connection::close (#1453)
* add explicit shutdown of sqlite statement worker in Connection::close()

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>

* test sqlite database close method

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>

* await worker shutdown after dropping SqliteConnection

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>

* restore explicit drop

Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
2021-09-30 18:14:30 -07:00
Paolo Barbolini
6e1c7a999a Update postgres 14 test to 14rc1 (#1454) 2021-09-24 11:33:36 -07:00
Paolo Barbolini
c2e04a1f3c Upgrade hmac to 0.11 (#1443) 2021-09-23 12:05:31 -07:00
Austin Bonander
8b30f3059b Fix a panic in the worker thread when dropping the connection while SqliteRows still exist (#1450)
* chore(sqlite): add repro for #1419

* fix(sqlite): hold a reference to the connection in `SqliteRow`

fixes #1419
2021-09-22 16:55:22 -07:00