Tom Dohrmann
88ee528f24
prefer PGPASSFILE over default paths
2021-04-08 23:47:35 -07:00
Tom Dohrmann
ea7cc78445
move tests into submodule
2021-04-08 23:47:35 -07:00
Tom Dohrmann
4c28cd5c50
fix test
2021-04-08 23:47:35 -07:00
Tom Dohrmann
ac4a9c3c1d
run cargo fmt
2021-04-08 23:47:35 -07:00
Tom Dohrmann
9ccf030248
add support for pgpass files
2021-04-08 23:47:35 -07:00
Austin Bonander
5295ff10a5
fix: pool internals improvements
...
* fix `DecrementSizeGuard::drop()` only waking one `Waiter` regardless of whether that waiter was already woken
* fix connect-backoff loop giving up the size guard
* don't cut in line to open a new connection
* have tasks waiting on `acquire()` wake periodically to check if there's a connection in the queue
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-04-06 09:04:20 -07:00
crajcan
469c4ac130
Correct Postgres' Length Limit for Bind Parameters ( #1141 )
...
* Bump limit for postgres' bind parameters
* Fix lingering fmt error
2021-03-29 19:39:27 -07:00
Rich Murphey
edcc91c9f2
replace deprecated compare_and_swap() with compare_exchange() ( #1080 )
2021-03-03 08:50:12 -08:00
Nathan Roach
d5f9f08c62
Fixing NaiveTime not including SQLite
2021-02-27 01:24:25 -08:00
Nathan Roach
4b5f41eebe
Fixing format, removing duplicate NaiveDate
2021-02-27 01:24:25 -08:00
Nathan Roach
9d6c5defd4
Adding derivation of any types for chrono types present in all of the featured sql types at compile time
2021-02-27 01:24:25 -08:00
Jonas Platte
e8f4eebdbe
Make re-exports from other crates show up as such
...
… in `types` and sub-modules.
2021-02-27 01:22:22 -08:00
mareq
111265b5ab
doc: Add information on the required structure of the migration scripts
2021-02-27 01:06:17 -08:00
Austin Bonander
0ed524d65c
fix(pool): always ping connection on release to see if it's still viable
...
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-02-27 00:56:08 -08:00
Austin Bonander
1a9e0d9a52
ban Ord::{min, max} with Clippy as it's too easy to misread
...
It is *much* too easy to misread `x.min(y)` as "`x` should be *at least* `y`" when in fact it means the *exact* opposite, and same with `x.max(y)`. This has bitten us in the gluteus maximus a number of times both in SQLx and in private projects.
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-02-05 13:30:35 -08:00
Ryan Leckey
2fd26b5504
sqlite: remove support for u64
...
see https://github.com/launchbadge/sqlx/pull/919#discussion_r557106441
2021-02-04 06:17:17 -08:00
wuaoxiang
31abe22e34
fix(sqlite): GROUP BY in query! cause infinite loop at compile time
2021-01-31 16:58:48 -08:00
Jonas Platte
6fea00304e
Remove any::AnyType
...
It was not actually used in a meaningful way.
2021-01-31 16:56:37 -08:00
Jonas Platte
1b217cfac4
Make impl Acquire for &'_ Pool<DB> more general
2021-01-31 16:54:22 -08:00
Jonas Platte
77238108cf
Require Acquire::Connection to be Send
2021-01-31 16:54:22 -08:00
Ryan Leckey
df393128f8
style: rustfmt
2021-01-20 22:29:05 -08:00
Austin Bonander
89305873b0
fix(postgres): patch nullable inference in Postgres using EXPLAIN
...
BREAKING CHANGE: some columns in `query!()` et. al. output will change from `T` to `Option<T>`
breakage should be minimal in practice as
these columns will need to have been manually
overridden anyway to avoid runtime errors
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-01-20 22:27:44 -08:00
Austin Bonander
5e452d9e86
fix(sqlite): remove errant println!() in sqlite/explain.rs
2021-01-20 22:26:43 -08:00
Austin Bonander
7c32928ebc
feat(macros): implement query_scalar!() and variants
...
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-01-20 22:23:04 -08:00
Ryan Leckey
b0c430ed18
feat(sqlite): track nullable through left joins
2021-01-20 22:22:26 -08:00
Sho Nakatani
0c0dd6936a
feat: Adds Debug, Clone auto-derive to SqliteArguments
2021-01-20 22:15:48 -08:00
William Hammond
25858fc42a
Improves error handling in the case of missing type
2021-01-20 22:10:03 -08:00
Ryan Leckey
e03c31adcd
Merge branch 'feature/inline-certificates' of https://github.com/alex-berger/sqlx into alex-berger-feature/inline-certificates
2021-01-20 22:08:26 -08:00
Florian Hübsch
68cf2f9cdb
Add constraint method to DatabaseError trait
...
Override `constraint` method for `PgDatabaseError`.
2021-01-20 22:00:44 -08:00
Ryan Leckey
d5e0f1b92b
refactor: rename DbOutcome to DbQueryResult
2021-01-20 21:57:26 -08:00
Jonas Platte
c5d43db312
Upgrade async runtime dependencies
...
Co-authored-by: Josh Toft <joshtoft@gmail.com>
Co-authored-by: Philip A Reimer <antreimer@gmail.com>
2021-01-20 21:50:45 -08:00
Ryan Leckey
de4a7decfb
fix(sqlite): i64 -> u64 in type docs
2021-01-20 21:50:45 -08:00
dignifiedquire
1d87b6cc8d
feat: implement unsigned int support for sqlite
2021-01-20 21:50:45 -08:00
Takeru Ohta
a6aef7817b
fix to read just 20 bytes for AuthSwitchRequest data
2021-01-20 21:50:44 -08:00
Jonas Platte
08a76f45ae
Rename DbDone to DbOutcome
2021-01-12 14:45:01 +01:00
Jonas Platte
a1d562f04b
Remove the Done trait
2021-01-12 14:37:44 +01:00
Jonas Platte
e2f7aa2eca
Restore support for sqlx(rename) on types, with a deprecation warning
2021-01-12 03:39:10 -08:00
Jonas Platte
fd8b2b7f8a
Rename sqlx(rename) attribute to sqlx(type_name)
2021-01-12 03:39:10 -08:00
Jonas Platte
74835bfe58
Allow chaining map / try_map on queries
...
To support `.map()` / `.try_map()` on `query!()` (and `query_as!()`).
2021-01-05 23:50:27 -08:00
Jonas Platte
9eca6413fe
Remove TryMapRow and MapRow
...
These traits were a workaround for a bug in rustc that an earlier
revision of the API triggered, but the API has since been changed.
2021-01-05 23:50:23 -08:00
Chloe Ross
2890d154a3
doc: use the fancy new intra-crate doc links everywhere
2021-01-04 18:39:03 -08:00
Austin Bonander
ef6c73c985
doc: add tables describing the right method to call on query!() et al
...
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-01-04 12:03:42 -08:00
up9cloud
e7eaed6220
remove unnecessary Fut
2021-01-04 09:31:47 -08:00
Austin Bonander
93ba3d59e7
fix(logging): make query logging obey level setting for sqlx::query target
...
Signed-off-by: Austin Bonander <austin@launchbadge.com>
2020-12-29 15:28:06 -08:00
Kirill Bulatov
24c85d20d6
Add a way to disable query logging programmatically
2020-12-29 11:30:34 -08:00
Jakob Truelsen
9146929575
Do not attempt to reconnect on every Io error.
...
Io errors can describe a lot of things, when connecting to a database in general only
ECONNREFUSED can be hoped to be resolved by waiting. Other errors will require
user intervention
2020-12-25 19:36:54 -08:00
Jakob Truelsen
46f9f44d41
Do not call connect it a bussy loop on connection refused.
...
If the connection to the database is refused, it is not helpfull to hammer it with connection
attempts, instead we should wait a bit before connecting again. Here we start waiting 10ms,
doubling the wait time for every attempt before setteling out at 2s
2020-12-25 19:36:54 -08:00
Brandon
b8839c6d90
Convert to intra-crate links
2020-12-23 18:49:39 -08:00
Brandon
cbc1deb363
Fix broken link in Transaction docs
2020-12-23 18:49:39 -08:00
Jakob Truelsen
c7cf104a8f
Handle dropping wait_for_conn
...
If wait_for_conn is dropped before completing, release will call
wake on a waker that noone is listining on. This leads to a state where
waiting will gro indefinitly while all connections are idle.
To fix this we turn waiting into a queue of unique Weak pointers.
This way if wait_for_conn is dropped the pointer in waiting cannot
be upgraded, we can use this as a signal that we shoud wake the
next one instead.
2020-12-22 20:13:40 -08:00