Commit graph

890 commits

Author SHA1 Message Date
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