1996 Commits

Author SHA1 Message Date
liushuyu
dfd9cf59f1
fix(postgres): fix option passing logic (#1731)
Co-authored-by: Austin Bonander <austin@launchbadge.com>

Co-authored-by: Austin Bonander <austin@launchbadge.com>
2022-03-01 21:29:38 -08:00
Paolo Barbolini
5b85a034da
Update heck to 0.4 (#1725) 2022-02-28 15:51:50 -08:00
Andre B. Reis
99d3220d88
Impl PgHasArrayType for serde_json::{Value,RawValue} (#1722)
* Implement PgHasArrayType for JSON types in the serde_json crate

* Remove redundant Type impls for arrays and Vecs of JsonValue

* Relax an implicit Sized bound to support JsonRawValue
2022-02-23 12:57:48 -08:00
Malhar Vora
cc35809708
Address #1718 (#1719)
Fix broken link
2022-02-22 12:16:43 -08:00
Austin Bonander
eaf41fd092
prepare 0.5.11 release (#1715) v0.5.11 2022-02-18 13:49:06 -08:00
Bastian
dd39e79f8a
Support for lquery (#1710)
* initial lquery version

* share code between ltree/lquery

* more lquery functions

* fix rebase issues

* add version comment

* Update sqlx-core/src/postgres/types/lquery.rs

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

Co-authored-by: Bastian Schubert <bastian.schubert@crosscard.com>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2022-02-17 15:06:35 -08:00
05storm26
8bccd53346
Allow converting AnyConnectOptions to a specific ConnectOptions (#1610) 2022-02-17 14:57:48 -08:00
stoically
45854a4246
docs: Acquire examples and alternative (#1687) 2022-02-17 14:55:38 -08:00
Matthias Hörmann
fd4d219c66
fix and extend postgres transaction example (#1636) 2022-02-16 19:05:31 -08:00
Andrew Wheeler(Genusis)
183e620381
Implement From for AnyConnection (#1652)
* Implemented From for AnyConnection to cover the 4 Database type connections to AnyConnection

* formatting
2022-02-16 18:59:32 -08:00
Fredrik Park
e7a50d3501
Document Offline mode with feature flags (#1665)
I ran into this and found the solution inside of this issue https://github.com/launchbadge/sqlx/issues/1593
Fixes #1593
2022-02-15 21:14:04 -08:00
k-jun
c90d2714ff
docs(macros): remove sentences banning usage of as _ (#1619)
* docs(macros): remove sentents banning `as _`

* fix(macros): comment

* Update src/macros.rs

* Update src/macros.rs

Co-authored-by: keijun-kumagai <keijun.kumagai@dena.com>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2022-02-15 21:13:39 -08:00
Arttu Liimola
160f345f4f
Fix Option for Any driver. (#1661)
With macro impl_encode_for_option Null values are not added, when creating arguments for the actual driver selected at runtime.
2022-02-15 21:12:02 -08:00
Bastian
6674e8ba96
Basic support for ltree (#1696)
* support ltree

* add default and push to PgLTree

* add more derived for ltree

* fix copy/paste

* Update sqlx-core/src/error.rs

Co-authored-by: Paolo Barbolini <paolo@paolo565.org>

* PR fixes

* ltree with name instead of OID

* custom ltree errors

* add pop ot PgLTree

* do not hide ltree behind feature flag

* bytes() instead of chars()

* apply extend_display suggestion

* add more functions to PgLTree

* fix IntoIter

* resolve PR annotation

* add tests

* remove code from arguments

* fix array

* fix setup isse

* fix(postgres): disable `ltree` tests on Postgres 9.6

Co-authored-by: Bastian Schubert <bastian.schubert@crosscard.com>
Co-authored-by: Paolo Barbolini <paolo@paolo565.org>
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2022-02-15 20:40:03 -08:00
LovecraftianHorror
8f41f5b77a
refactor: Keep parsed sqlx-data.json in a cache instead of reparsing (#1684) 2022-02-15 20:17:47 -08:00
LovecraftianHorror
5f7e25b81d
Make a note about sqlx macros opt level (#1685)
* docs: Add a snippet about opt levels for `sqlx-macros`

* docs: Fix does -> do
2022-02-15 20:14:41 -08:00
Marcin Puc
313cc69988
Simplify cargo-sqlx cmdline definition (#1626)
* Simplify cargo-sqlx cmdline definition

* Add note about the parser definition for cargo-sqlx

* Fix formatting
2022-02-15 20:13:42 -08:00
Marco Napetti
2849468e57
Avoid panicking if packet empty (#1667)
I'm having panics on those index accesses, an empty packet is probably a symptom of other problems, but it would be cool if the application doesn't panics like it does.
2022-02-15 20:11:38 -08:00
Liam
7fb54d3d7b
Add checksum mismtaches to sqlx-cli migrate info (#1680)
This fixes #870
2022-02-15 20:11:06 -08:00
Adam Cigánek
347374b94b
SQLite unlock notification (#1658)
* sqlite: add test for concurrent table access (failing)

* sqlite: implement unlock notification
2022-02-15 20:10:36 -08:00
Austin Bonander
7fd324d337
fix(ci): pin MySQL version in the correct place 2022-02-11 12:55:23 -08:00
Austin Bonander
5466826d91
fix(ci): pin MySQL 8 version to 8.0.27
Fixes the build failures until 8.0.29 is released.
2022-02-11 12:31:42 -08:00
VersBinarii
fd2d26e12d
Fix power calculation when encoding the BigDecimal into NUMERIC (#1692)
* Show failing test

0.002 will be encoded as 0.02

* The power calculation should depend on the offset

of the digits
2022-02-11 12:28:07 -08:00
p9s
f3ac717977
Update macros.rs (#1657)
typo fix
2022-02-07 20:02:14 -08:00
Austin Bonander
2182925e92
faq: "obvious" -> "ideal" 2022-01-20 14:47:59 -08:00
Austin Bonander
cd65058ebc
faq: add answer for errors when using RusTLS 2022-01-20 14:42:50 -08:00
Austin Bonander
dbdedcd31d
docs(faq): state SQLx's position on MSRV 2022-01-10 15:36:16 -08:00
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