From 834cbb29627c6cd152b21305d320839e93222aa2 Mon Sep 17 00:00:00 2001 From: Akulij Date: Thu, 3 Apr 2025 02:28:01 +0900 Subject: [PATCH] enable r2d2 feature in diesel --- Cargo.lock | 21 +++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index f6c929a..8b74286 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -263,6 +263,7 @@ dependencies = [ "diesel_derives", "itoa", "pq-sys", + "r2d2", ] [[package]] @@ -1304,6 +1305,17 @@ version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +[[package]] +name = "r2d2" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" +dependencies = [ + "log", + "parking_lot", + "scheduled-thread-pool", +] + [[package]] name = "rand" version = "0.9.0" @@ -1459,6 +1471,15 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "scheduled-thread-pool" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" +dependencies = [ + "parking_lot", +] + [[package]] name = "scoped-futures" version = "0.1.4" diff --git a/Cargo.toml b/Cargo.toml index 0ae83d5..098b540 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -diesel = { version = "2.2.8", features = ["postgres"] } +diesel = { version = "2.2.8", features = ["postgres", "r2d2"] } diesel-async = { version = "0.5.2", features = ["postgres"] } dotenvy = "0.15.7" envconfig = "0.11.0"