Jonas Platte
cd44b5eb43
De-duplicate mysql & postgres TLS code
2020-11-12 07:32:21 -08:00
Jonas Platte
a161bcba05
Rename cargo features in preparation for rustls support
2020-11-12 07:32:21 -08:00
Jakob Truelsen
9d71a7f372
Allow configuring the log level of query logging
2020-11-12 07:06:34 -08:00
Julius de Bruijn
a0007b4e98
Fixing BigDecimal conversion for PostgreSQL
...
Now working properly with numbers, such as `0.01` and `0.012`.
2020-11-04 17:09:01 -08:00
Daniel Stöckel
144dcceb44
fix(postgres): prefer parsing non-localized notice severity field
...
In order to support PostgreSQL <= 9.5, the b'S' field of an error/notice
message was parsed. However, this field can be localized and thus parsing
can fail for instances that use a non-english locale. In version > 9.5,
the b'V' field, that is guaranteed to be in english, was added. However,
even for these versions parsing would fail as the b'S' field was also
parsed. This patch prefers b'V' over b'S' if it exists and uses a default
severity in case b'V' is not present and b'S' could not be parsed.
Fixes #734
2020-10-19 00:03:06 -07:00
Dana Marcuse
d97014f620
feat: correctly handle percent-encoded socket as host for postgres URI
2020-10-18 01:19:11 -07:00
Dana Marcuse
7b1b8c12ba
feat: handle hostaddr postgres URI param and add more tests
2020-10-18 01:19:11 -07:00
Joshua Nelson
20d65a8248
Remove hashbrown dependency
...
Hashbrown is now the hashmap used in the standard library, so no need to
pull in an external dependency. This switches to using `AHashMap`
directly.
2020-10-17 02:44:09 -07:00
Kramer Hampton
d0ccb4d0b2
feat: parse additional parameters: user, password, port, dbname. Also
...
add additional documentation and an example connection string using
parameters.
2020-10-13 09:56:48 -07:00
Ryan Leckey
67099d993c
Merge remote-tracking branch 'frigus02/pg-percent-decode' into master
2020-08-19 18:03:31 -07:00
Stuart Hinson
1ab815cc9b
WIP pg application_name
2020-08-19 17:56:51 -07:00
Jan Kuehle
106a6a8395
Support non-ASCII chars in postgres credentials
...
The `url` crate returns username and password portions of a URL as
percent encoded ASCII strings. In order to use them for the Postgres
connection, we need to decode them.
2020-08-13 15:50:07 +01:00
Chloe Ross
3885ae6ddf
fix: allow queries that select just void to pass through macros as () instead of struct { _1: () }
2020-07-31 04:14:48 -07:00
Jannik Obermann
67142259e4
Fix #580 + Add test
2020-07-31 04:14:32 -07:00
吴翱翔
96f4a43bb8
style: rustfmt
2020-07-29 07:39:31 -07:00
吴翱翔
c6fa9047b9
Remove rust_decimal unnecessary num-traits
2020-07-29 07:39:31 -07:00
Jonas Platte
960e71202b
Don't include postgres OIDs in query cache
2020-07-29 07:28:14 -07:00
Julius de Bruijn
0ed8e3f610
Add missing compatible implementation for Vec<BitVec>
2020-07-27 03:36:44 -07:00
Julius de Bruijn
1a59d3308a
Pg: Implementing BIT and VARBIT using BitVec
2020-07-27 03:36:44 -07:00
Ryan Leckey
7bc3133f70
feat: add an optional query logger (using log)
2020-07-26 23:55:36 -07:00
Ryan Leckey
c454e1ea35
style: remove unused import
2020-07-26 18:05:55 -07:00
Ryan Leckey
b61c0821ab
style: rustfmt
2020-07-24 08:07:44 -07:00
Ryan Leckey
08d2c79279
feat(postgres): expose PgTypeKind
2020-07-24 07:28:59 -07:00
Ryan Leckey
e575501a39
feat: add Executor::prepare, a hook into the automatic statement preparation life-cycle
2020-07-24 07:24:23 -07:00
Julius de Bruijn
e8a4c54ac7
Allow setting caching per-query
2020-07-24 07:24:23 -07:00
Julius de Bruijn
c9c11c8302
2-tier cache for Postgres
...
This solves a problem when needing to describe a query before executing
it, in cases where the query is more of a dynamic nature and binding its
parameters require the type info.
In this case, the first describe doesn't know the input parameters, so
the parameter type info is inferred from the database. In cases of
`varchar(10)[]` or `json` column types, the parameter type is inferred
to the column type. Now if we then try to use `text[]` or `jsonb` as the
types, the database has already stored different types for these
parameters for the statement, and will error out.
So we'll now only store the statement to the cache when it comes from an
actual execution of the query.
2020-07-24 07:24:23 -07:00
Julius de Bruijn
0c9bea4ab2
Fixing panics for disabled statement cache
2020-07-24 07:24:23 -07:00
Julius de Bruijn
bfa29e521b
Implement Debug for statements
2020-07-24 07:24:23 -07:00
Julius de Bruijn
590f97df4a
Caching describe
2020-07-24 07:24:23 -07:00
Ryan Leckey
e4dc040620
style: rustfmt
2020-07-20 23:53:36 -07:00
Ryan Leckey
ee4d9b5412
fix(postgres): use the element type info from the protocol if available for array element decoding
...
fixes #537
2020-07-20 23:53:18 -07:00
Ryan Leckey
49ffcf6f46
feat: add PgListener#try_recv to give users a chance to act on lost connection if desired
...
closes #447
2020-07-18 21:05:36 -07:00
Ryan Leckey
820618f396
test: fix some doctests under runtime-tokio
2020-07-18 03:27:05 -07:00
Ryan Leckey
cc736df4d6
fix(postgres): use Sync over Flush for terminating extended non-query commands; in addition, keep better track of the number of expected readyForQueries
2020-07-17 04:56:39 -07:00
Ryan Leckey
fa40e9e55f
implement support for postgres TIMETZ type
...
Co-authored-by: Julius de Bruijn <julius+github@nauk.io>
2020-07-17 03:22:40 -07:00
Ryan Leckey
e285f0858f
refactor: split up postgres chrono/time modules
2020-07-17 03:22:40 -07:00
Julius de Bruijn
99b7017d6c
Conversion from BigDecimal to PgMoney
2020-07-17 02:00:48 -07:00
Ryan Leckey
6949b84e8c
style: rustfmt
2020-07-15 02:31:57 -07:00
Ryan Leckey
9b956c0d2c
fix(postgres): support the VOID type, as ()
2020-07-15 02:16:08 -07:00
Ryan Leckey
dc5fc1b6c1
fix: do not enforce type equality if matching against the NULL type
2020-07-15 02:04:32 -07:00
Ryan Leckey
793f247604
refactor: PoolOptions::new() takes no parameters and the final .connect method takes the URI
2020-07-14 06:07:29 -07:00
Ryan Leckey
47d566f5b6
feat: support Done for Any
2020-07-14 04:41:27 -07:00
Ryan Leckey
00137d4a04
feat: add sqlx::Done and return from Executor::execute()
...
+ Done::rows_affected()
+ Done::last_insert_id()
2020-07-14 04:31:25 -07:00
Ryan Leckey
d10f299c55
test: tweak in-code examples for latest refactors
2020-07-12 04:30:10 -07:00
Ryan Leckey
ff4dd4c7e7
fix: add a couple missing cfgs for the migrate feature
2020-07-12 04:15:37 -07:00
Joe Grund
d58f20f77a
Update column.rs
...
Skip serialization of `relation_id` and `relation_attribute_no` so they do not appear in `sqlx-data.json`
2020-07-12 03:54:47 -07:00
Ryan Leckey
61e4a4f566
feat: finish v1 of both cli and embedded migrations
2020-07-12 03:43:55 -07:00
Ryan Leckey
b920aa1c55
feat: support user-defined array and pseudo types in postgres
2020-07-12 03:43:55 -07:00
Ryan Leckey
e765287dba
refactor: restructure relationship between Pool, Connection, and Options
...
* Pool::new -> Pool::connect
* Add Pool::connect_lazy
* Pool::builder -> PoolOptions::new
* PoolConnection no longer implements Connection
* Transaction no longer implements Connection
* Add ConnectOptions::connect
* Add Acquire - abstract between &Pool and &mut Connection within one function
* Remove Connect, move connect to Connection
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2020-07-12 03:43:55 -07:00
Julius de Bruijn
2e3e5187f9
Document better!
2020-07-09 12:32:19 -07:00