Commit graph

991 commits

Author SHA1 Message Date
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
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
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
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
2021-10-01 14:45:25 -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
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
Kohei Suzuki
593364f801
fix(mysql): handle multiple waiting results correctly (#1439)
* test(mysql): add test case for pending rows and dropped transaction

* fix(mysql): handle multiple waiting results correctly
2021-09-22 13:39:56 -07:00
Ghass Mo
a5997a2813
Support custom initial options for sqlite (#1295)
* Support custom initial options for sqlite

Apply suggestions from code review

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

Apply suggestions from code review

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

Use order-preserving map to set pragmas for an initial sqlite statement

 Use Cow<'static, str> instead of String

Co-authored-by: Austin Bonander <austin@launchbadge.com>
2021-09-13 13:48:24 -07:00
Austin Bonander
2307f432eb
fix: run cargo fmt 2021-09-13 13:14:24 -07:00
Montana Low
ec510b37e7
Finish support for Postgres COPY (#1345)
* feat(postgres): WIP implement `COPY FROM/TO STDIN`

Signed-off-by: Austin Bonander <austin@launchbadge.com>

* feat(postgres): WIP implement `COPY FROM/TO STDIN`

Signed-off-by: Austin Bonander <austin@launchbadge.com>

* test and complete support for postgres copy

Co-authored-by: Austin Bonander <austin@launchbadge.com>
2021-09-13 13:03:38 -07:00
David Marcin
687fbf9909
Support the immutable option on SQLite connections (#1289)
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2021-09-10 15:47:30 -07:00
Paolo Barbolini
092f811f62
Fix CIDR[] not being compatible with Vec<IpNetwork> (#1433) 2021-09-10 15:43:04 -07:00
Paolo Barbolini
efd08cc4b3
Reduce futures-util features (#1427)
* Reduce futures-util features

* Remove unused futures crate from sqlx-macros
2021-09-08 12:36:05 -07:00
Elise
719d80038b
feat: allow log level customization (#1371) 2021-08-31 17:51:48 -07:00
Jonas Platte
335eed4545
Add executor trait "aliases" (#1412) 2021-08-31 17:36:27 -07:00
Jonas Platte
d94c081468
Add more debugging info to unresolved type declaration panic (#1416) 2021-08-31 17:35:10 -07:00
Simon Paitrault
135d16a34f
Getting current Handle in Drop (#1395)
Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
2021-08-30 14:11:49 -07:00
Austin Bonander
3749e0ea37
chore: prepare 0.5.7 (hotfix) release (#1394) 2021-08-20 17:14:42 -07:00
Austin Bonander
0e8ffb564b
fix(postgres): avoid recursively spawning tasks in PgListener::drop() (#1393)
refactor(pool): deprecate `PoolConnection::release()`, provide renamed alts
2021-08-20 16:44:46 -07:00
Austin Bonander
207e6db2ce
chore: bump versions of sqlx-* in dependencies 2021-08-17 12:49:02 -07:00
Austin Bonander
6bb1c716bd
preparing 0.5.6 release (#1382)
* fix(pool): reenable connection reaper

* fix warnings

* chore: bump published crates to 0.5.6

* chore: update CHANGELOG.md for 0.5.6
2021-08-17 12:44:24 -07:00
Altan Özlü
774880d17c
cockroachdb fix for macro (#1386) 2021-08-17 12:20:08 -07:00
Atkins
dd27aa0587
Fix bug for PostgreSQL if the statement has type holes (#1363)
* fix: wait until ready after executing other helper queries while pg quering is executing

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* fix: use tls parameter for testing target

Signed-off-by: Atkins Chang <atkinschang@gmail.com>
2021-08-16 16:50:11 -07:00
Austin Bonander
71388a7ef2
sqlite: fix a couple segfaults (#1351)
* sqlite: use Arc instead of Copy-able StatementHandle

This guarantees that StatementHandle is never used after calling
`sqlite3_finalize`. Now `sqlite3_finalize` is only called when
StatementHandle is dropped.

(cherry picked from commit 5eebc05dc3)

* sqlite: use Weak poiter to StatementHandle in the worker

Otherwise some tests fail to close connection.

(cherry picked from commit 5461eeeee3)

* Fix segfault due to race condition in sqlite (#1300)

(cherry picked from commit bb62cf767e)

* fix(sqlite): run `sqlite3_reset()` in `StatementWorker`

this avoids possible race conditions without using a mutex

* fix(sqlite): have `StatementWorker` keep a strong ref to `ConnectionHandle`

this should prevent the database handle from being finalized before all statement handles
have been finalized

* fix(sqlite/test): make `concurrent_resets_dont_segfault` runtime-agnostic

Co-authored-by: link2xt <link2xt@testrun.org>
Co-authored-by: Adam Cigánek <adam.ciganek@gmail.com>
2021-08-16 14:39:45 -07:00
Atkins
55c603e9e7
build(deps): bump git2 from 0.13.19 to 0.13.20 (#1362)
Signed-off-by: Atkins Chang <atkinschang@gmail.com>
2021-08-07 01:48:10 -07:00
Atkins
9f7205e80f
Fix GitHub Actions and integration test (#1346)
* fix test suite

* rustfmt

* need Row

* test: fix integration test scripts and update the upstream supported databases

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): update supported databases

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): use `pg_isready` instead of `sleep` to avoid error cause by database not ready

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* feat(core): add `trait PgConnectionInfo` for connection parameter status from server

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* test(postgres): fix integration test for postgres

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* test(mysql): fix integration tests

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* ci(actions): test database against the oldest and newest supported versions

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

* docs(core): document `trait PgConnectionInfo`

Signed-off-by: Atkins Chang <atkinschang@gmail.com>

Co-authored-by: Montana Low <montanalow@gmail.com>
2021-07-28 14:00:34 -07:00
Daniel Faust
f0d0dce8e2
Use postgres as maintenance db unless maintaining postgres itself (#1339)
Fixes #1283.
2021-07-23 16:39:25 -07:00
Luca Palmieri
34db44bffd
Mark the original DatabaseError as source. (#1197) 2021-07-23 16:31:49 -07:00
Austin Bonander
a8544fd503
fix(pg_money): handle negative values correctly in PgMoney::from_decimal() (#1334)
closes #1321
2021-07-21 16:29:20 -07:00
Austin Bonander
531740550f
fix(pool): reimplement pool internals with futures-intrusive (#1320) 2021-07-21 16:28:44 -07:00
marshoepial
cb3ff28721
Keep track of column typing in SQLite EXPLAIN parsing (#1323)
* NewRowid, Column opcodes, better pointer handling

* Implement tracking of column typing on sqlite explain parser

* fmt for sqlite column typing for explain parsing

Co-authored-by: marshoepial <marshoepial@gmail.com>
2021-07-21 16:27:47 -07:00
Austin Bonander
8bcac0394f
fix(mysql): implement type traits for chrono::DateTime<Local> (#1335)
closes #1222
2021-07-21 16:27:00 -07:00
nomick
be189bd11e
Support MACADDR in Postgres (#1329) 2021-07-19 16:55:53 -07:00
Akhil Velagapudi
0abbcc510f
Update crc 1.8.1 -> 2.0.0 (#1256) 2021-07-16 15:25:32 -07:00
Ryan Leckey
694a2ac478 release: v0.5.5 2021-05-24 09:34:34 -07:00
Ryan Leckey
5d9c292132 release: v0.5.4 2021-05-22 16:38:54 -07:00
Eamon Caton
b391d4878e Revert webpki version bump to keep compatability with tokio-rustls feature 2021-05-22 11:03:01 -07:00
Ryan Leckey
13f7c7124a release: v0.5.3 2021-05-21 17:27:15 -07:00
Ryan Leckey
2d38332137 fix: bring back accidentally removed methods on the Migrate trait as deprecated 2021-05-21 17:16:22 -07:00
Nathan Roach
db09cb61e5 Adding Any support for Local chrono datetime for MySQL 2021-05-21 16:46:41 -07:00
Guy Lapid
18acba2358 Added any types for binary blobs and chrono NaiveDateTime 2021-05-21 16:46:26 -07:00
Rafael Epplée
0acb0e5eff
Add docs for rename_all attribute for Type derive macro (#1212)
* add missing closing bracket in doctest

* document rename_all attribute for Type derive
2021-05-21 16:12:16 -07:00
Austin Bonander
8f1d8c7e2f
more pool fixes (#1211)
* a task that is marked woken but didn't actually wake before being cancelled will instead wake the next task in the queue

* a task that wakes but doesn't get a connection will put itself back in the queue instead of waiting until it times out with no way to be woken

* the idle reaper now won't run if there are tasks waiting for a connection, and also uses
the proper `SharedPool::release()` to return validated connections to the pool so waiting tasks get woken

closes #622, #1210

(hopefully for good this time)

Signed-off-by: Austin Bonander <austin@launchbadge.com>
2021-05-17 19:24:40 -07:00
Feike Steenbergen
78a94240e6
Skip empty and commented pgpass entries (#1216)
While running an application a lot of warnings were printed about my
pgpass file, like:

	Malformed line in pgpass file

This was due to the fact that my pgpass file contains whitespace and
comments to organize it in a better way.

This commit ensures we will ignore empty lines and lines that (barring
whitespace) start with a comment. This is in line with how PostgreSQL
treats these entries in the pgpass file:

- https://www.postgresql.org/docs/current/libpq-pgpass.html
- function passwordFromFile in src/interfaces/libpq/fe-connect.c
2021-05-10 16:18:13 -07:00
link2xt
405474b575
sqlite: add SqliteConnectOptions::shared_cache() (#1177)
This makes it possible to open database in shared cache mode without
having to construct `sqlite://` URL with `?cache=shared` flag.
2021-04-27 18:35:45 -07:00
Josh Triplett
b5928f6e7f Export SqliteAutoVacuum so it can be used 2021-04-27 12:35:58 -07:00
Josh Triplett
d4a7217a56 Support setting sqlite page_size
The page size setting only takes effect if set before doing anything
else to the database.
2021-04-27 12:35:23 -07:00
link2xt
fda55fe3b3 sqlite: export SqliteLockingMode
This makes it possible to `use sqlx::sqlite::SqliteLockingMode`.
2021-04-16 18:25:07 -07:00
Ryan Leckey
f7775f7fde release: 0.5.2 2021-04-15 18:40:46 -07:00
Jonas Platte
73d35e73a6 Remove Self: Type bounds in Encode / Decode implementations 2021-04-15 18:27:13 -07:00
Jonas Platte
81ae756e86 Fix warnings 2021-04-15 18:27:13 -07:00
Ryan Leckey
9e8e334697
chore: add std_rng to rand 2021-04-09 15:48:19 -07:00
Ryan Leckey
633a662752 chore: update dependencies 2021-04-09 00:31:07 -07:00
Alexander Krotov
78656eb469 fix(sqlite): reset the statement when fetch_many() stream is dropped
Unlike `Executor.fetch_optional()`, `Executor.fetch_many()` does not
have a single exit.  The stream can be dropped at any time.  To catch
this event, we create a `StatementResetter` structure inside the stream
loop and reset the statement when it is dropped.

A test case `it_resets_prepared_statement_after_fetch_many` is
similar to `it_resets_prepared_statement_after_fetch_one` which tests
`Executor.fetch_optional()`.
2021-04-09 00:23:17 -07:00
link2xt
5cf1af2d19 fix(sqlite): do not ignore API misuse errors from sqlite3_finalize 2021-04-09 00:21:52 -07:00
link2xt
f488f53916 fix(sqlite): do not cast pointers to i32
64-bit pointers can't be casted to i32 correctly.

It does not seem to cause problems on amd64 as long as both pointers
reside in the same page, but it's not correct generally.
2021-04-09 00:21:12 -07:00
argv-minus-one
2123d9de2e Make the bounds on Connection::transaction less strict.
The provided callback doesn't need to be `'static`. It should be enough that it doesn't borrow anything from the `Connection` itself, even if it does borrow data from elsewhere.
2021-04-09 00:13:51 -07:00
Ryan Leckey
fd828fed14 Merge remote-tracking branch 'demurgos/domain-type-description' 2021-04-08 23:59:25 -07:00
Diggory Blake
a3b73f8e08 Remove all listeners before returning a connection to the pool 2021-04-08 23:54:10 -07:00
Diggory Blake
01bef75cb9 Fix bug when a read on a BufStream is cancelled. 2021-04-08 23:53:45 -07:00
Josh Triplett
c96bcd9f6b Support the sqlite auto_vacuum pragma 2021-04-08 23:52:34 -07:00
Josh Triplett
62e58f5b1c Support the sqlite locking_mode pragma
This allows applications that never use a sqlite database concurrently
to avoid using shared memory for the write-ahead log.
2021-04-08 23:52:34 -07:00
Evgeny Nosov
e4dd1c3a1d Ignore reversing migrations in migrate! macro 2021-04-08 23:50:39 -07:00
Evgeny Nosov
8b866bb23d Fix migrate! macro 2021-04-08 23:50:39 -07:00
Evgeny Nosov
85ff651ba1 Add ignore_missing parameter 2021-04-08 23:50:39 -07:00
Evgeny Nosov
8950332ca3 Rewrite migration algorithm in order to apply also unapplied migrations 2021-04-08 23:50:39 -07:00
Tom Dohrmann
7463cdaf45 rename test to tests
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
2021-04-08 23:47:35 -07:00
Tom Dohrmann
47253d5d20 move pgpass functions into seperate submodule 2021-04-08 23:47:35 -07:00
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
Charles Samborski
93b90be9f7 fix(postgres): Add support for domain types description
Fix commit updates the `postgres::connection::describe` module to add full support for domain types. Domain types were previously confused with their category which caused invalid oid resolution.

Fixes launchbadge/sqlx#110
2021-03-16 20:23:03 +01: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
cbe820760f
release: 0.5.1 2021-02-04 09:16:11 -08:00
Ryan Leckey
efccd6c9b8
chore: update sqlx-rt to 0.3 2021-02-04 09:15:00 -08:00
Ryan Leckey
94d0baeb52
release: 0.5 2021-02-04 06:32:50 -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
Ryan Leckey
565d0a91a3
release: v0.4.2 2020-12-19 01:07:50 -08:00
Ryan Leckey
2d3b9e4909
fix: rollback (another) update to rustls 2020-12-19 00:37:45 -08:00
Ryan Leckey
7bbf89c301
fix: rollback a couple package updates (forgot to check tokio) 2020-12-19 00:34:10 -08:00
Ryan Leckey
c410f88bcd
chore: update several dependencies 2020-12-19 00:26:06 -08:00
Ryan Leckey
e9e1dcf78e
style: rustfmt 2020-12-19 00:08:29 -08:00
Ryan Leckey
00d3211f03
add runtime-async-std-native-tls to docs.rs feature in sqlx-core 2020-12-18 23:30:29 -08:00
Ryan Leckey
405553cc43
Merge branch 'slumber-another-fix-for-decimals' of https://github.com/slumber/sqlx into slumber-slumber-another-fix-for-decimals 2020-12-18 23:23:06 -08:00
Mike Cronce
376ea3f596 sqlx-core/src/mysql/types/str.rs: + COLLATE_UTF8MB4_GENERAL_CI 2020-12-19 07:17:28 +00:00
Hamza
d1417dc2ec Ensure tests pass 2020-12-19 07:17:12 +00:00
Hamza
8a55ae2d32 Fix transaction wrapper 2020-12-19 07:17:12 +00:00
Federico Rampazzo
b9e57de005 Rename mixedCase to camelCase, CamelCase to PascalCase, aligning with serde 2020-12-19 07:14:09 +00:00
Federico Rampazzo
aa0adaa434 Updated rename-all docs 2020-12-19 07:14:09 +00:00
Marcin Kaźmierczak
e584618041 sqlite synchronous setting 2020-12-19 06:03:50 +00:00
Ryan Leckey
4ee1727ba6
fix: tweak bstr and git2 Encode impls 2020-12-18 21:56:29 -08:00
Eric Semeniuc
389f9b5f41
fix macro 2020-12-18 21:33:52 -08:00