pg.ddx.io pgdogdev/pgdog GitHub issues and pull requests
help / color / mirror / Atom feed[pgdogdev/pgdog] PR #2076: security: update outdated dependencies
4+ messages / 3 participants
[nested] [flat]
* [pgdogdev/pgdog] PR #2076: security: update outdated dependencies
@ 2026-11-19 19:10 "meskill (@meskill)" <noreply+meskill@github.com>
0 siblings, 0 replies; 4+ messages in thread
From: meskill (@meskill) @ 2026-11-19 19:10 UTC (permalink / raw)
To: pgdogdev/pgdog <noreply+pgdogdev-pgdog@github.com>
Update dependencies that triggers `cargo audit`
- for sqlx - update to 0.9 version with breaking changes that caused a lot of changes in rust integration tests
- for rand - update to 0.10 that changed some naming and caused imports changes, mostly for tests
- some additional dedup and moves of crates definitions to root package
inline patch 1: Cargo.lock, Cargo.toml, integration/rust/Cargo.toml and 67 more (+844/-1359 lines) download inline-1.patch
diff --git a/Cargo.lock b/Cargo.lock
index fcc3b4160..94bebb935 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8,17 +8,6 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
-[[package]]
-name = "ahash"
-version = "0.7.8"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9"
-dependencies = [
- "getrandom 0.2.17",
- "once_cell",
- "version_check",
-]
-
[[package]]
name = "ahash"
version = "0.8.12"
@@ -233,9 +222,9 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]]
name = "aws-config"
-version = "1.8.17"
+version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "517aa062d8bd9015ee23d6daa5e1c1372328412fdae4e6c4c1be9b69c6ad37a2"
+checksum = "939e256cfe0ed68e96d32f194339d88210d5c10685cff0787400158f852c6819"
dependencies = [
"aws-credential-types",
"aws-runtime",
@@ -253,8 +242,8 @@ dependencies = [
"bytes",
"fastrand",
"hex",
- "http 1.4.1",
- "sha1",
+ "http",
+ "sha1 0.10.6",
"time",
"tokio",
"tracing",
@@ -264,9 +253,9 @@ dependencies = [
[[package]]
name = "aws-credential-types"
-version = "1.2.14"
+version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8f20799b373a1be121fe3005fba0c2090af9411573878f224df44b42727fcaf7"
+checksum = "576e8da35751dc85409ec1cd15999f692c277a1fbe9336780fe6f15e49dd637d"
dependencies = [
"aws-smithy-async",
"aws-smithy-runtime-api",
@@ -276,11 +265,11 @@ dependencies = [
[[package]]
name = "aws-lc-fips-sys"
-version = "0.13.16"
+version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "37b00953a69b2cfb471d13d72538d2e66930832340b0f31deadd404b48c573c5"
+checksum = "b744eed18cd75d814effdf2aba2880f912abe0fe1c327b361341d31aba9a7005"
dependencies = [
- "bindgen",
+ "bindgen 0.73.2",
"cc",
"cmake",
"dunce",
@@ -291,9 +280,9 @@ dependencies = [
[[package]]
name = "aws-lc-rs"
-version = "1.17.0"
+version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00"
+checksum = "048006790404103c488e6c5616b3e7e702a71292aadda08e8f7698a9e0d2eb53"
dependencies = [
"aws-lc-fips-sys",
"aws-lc-sys",
@@ -303,21 +292,22 @@ dependencies = [
[[package]]
name = "aws-lc-sys"
-version = "0.41.0"
+version = "0.47.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4"
+checksum = "8bfbe32ac36b3c428696ce315464181bc4029d689fd58e3f2a4e58c252242f52"
dependencies = [
"cc",
"cmake",
"dunce",
"fs_extra",
+ "pkg-config",
]
[[package]]
name = "aws-runtime"
-version = "1.7.4"
+version = "1.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "77ed8e8c52d2dc2390ad9f15647fe663f71e9780b4262c190fbb823a32721566"
+checksum = "9a0cc2144962cc5e358467b16e3d82981b1d424a7c3d34602be0036103814a1a"
dependencies = [
"aws-credential-types",
"aws-sigv4",
@@ -330,8 +320,8 @@ dependencies = [
"bytes",
"bytes-utils",
"fastrand",
- "http 1.4.1",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"percent-encoding",
"pin-project-lite",
"tracing",
@@ -340,10 +330,11 @@ dependencies = [
[[package]]
name = "aws-sdk-rds"
-version = "1.133.0"
+version = "1.157.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "771b66b9bb389122e755ade08ea15fa490ce0813a92b43fe828dc65b6284cdec"
+checksum = "2276c69dc4955211a9d04d5189ea205fa5071e186a07dff1d6514048e992b77e"
dependencies = [
+ "arc-swap",
"aws-credential-types",
"aws-runtime",
"aws-sigv4",
@@ -354,12 +345,12 @@ dependencies = [
"aws-smithy-query",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
+ "aws-smithy-schema",
"aws-smithy-types",
"aws-smithy-xml",
"aws-types",
"fastrand",
- "http 0.2.12",
- "http 1.4.1",
+ "http",
"regex-lite",
"tracing",
"url",
@@ -367,10 +358,11 @@ dependencies = [
[[package]]
name = "aws-sdk-sso"
-version = "1.99.0"
+version = "1.117.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "9f4055e6099b2ec264abdc0d9bbfffce306c1601809275c861594779a0b04b45"
+checksum = "5316813498fa9c403877007934ae448aa44b18136f58051f8fa3c5b79b44bdc6"
dependencies = [
+ "arc-swap",
"aws-credential-types",
"aws-runtime",
"aws-smithy-async",
@@ -379,22 +371,23 @@ dependencies = [
"aws-smithy-observability",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
+ "aws-smithy-schema",
"aws-smithy-types",
"aws-types",
"bytes",
"fastrand",
- "http 0.2.12",
- "http 1.4.1",
+ "http",
"regex-lite",
"tracing",
]
[[package]]
name = "aws-sdk-ssooidc"
-version = "1.101.0"
+version = "1.119.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "02f009ba0284c5d696425fd7b4dcc5b189f5726f4041b7a5794daecb3a68d598"
+checksum = "31db35e5662787b786daba15f431e4393c7ea512b70fa112bd048d1f3ecf877a"
dependencies = [
+ "arc-swap",
"aws-credential-types",
"aws-runtime",
"aws-smithy-async",
@@ -403,22 +396,23 @@ dependencies = [
"aws-smithy-observability",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
+ "aws-smithy-schema",
"aws-smithy-types",
"aws-types",
"bytes",
"fastrand",
- "http 0.2.12",
- "http 1.4.1",
+ "http",
"regex-lite",
"tracing",
]
[[package]]
name = "aws-sdk-sts"
-version = "1.104.0"
+version = "1.122.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6aa6622798e19e6a76b690562085dd4771c736cd48343464a53ab4ae2f2c9f84"
+checksum = "a10491638d9e560db90c484dbc77d73b8ad202780cdc9b9e92180603acb07ada"
dependencies = [
+ "arc-swap",
"aws-credential-types",
"aws-runtime",
"aws-smithy-async",
@@ -428,21 +422,21 @@ dependencies = [
"aws-smithy-query",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
+ "aws-smithy-schema",
"aws-smithy-types",
"aws-smithy-xml",
"aws-types",
"fastrand",
- "http 0.2.12",
- "http 1.4.1",
+ "http",
"regex-lite",
"tracing",
]
[[package]]
name = "aws-sigv4"
-version = "1.4.4"
+version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b7083fb918b38474ac65ffbf8a69fc8792d36879f4ac5f1667b43aec61efe9a5"
+checksum = "9d3d48355cb86b15ccbb38b8bc6b87500c824ee4ed8cbc10a961b435242b5e16"
dependencies = [
"aws-credential-types",
"aws-smithy-http",
@@ -451,20 +445,19 @@ dependencies = [
"bytes",
"form_urlencoded",
"hex",
- "hmac 0.13.0",
- "http 0.2.12",
- "http 1.4.1",
+ "hmac",
+ "http",
"percent-encoding",
- "sha2 0.11.0",
+ "sha2",
"time",
"tracing",
]
[[package]]
name = "aws-smithy-async"
-version = "1.2.14"
+version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2ffcaf626bdda484571968400c326a244598634dc75fd451325a54ad1a59acfc"
+checksum = "de681a9df7ff79823b759ee17061076ec049cd61a8fa28ece4293d89c9f6964e"
dependencies = [
"futures-util",
"pin-project-lite",
@@ -473,9 +466,9 @@ dependencies = [
[[package]]
name = "aws-smithy-http"
-version = "0.63.6"
+version = "0.64.2"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ba1ab2dc1c2c3749ead27180d333c42f11be8b0e934058fb4b2258ee8dbe5231"
+checksum = "ba8960956e0ee0ca3f3161e62913a61bc65a7ef638ca3ef1d4c7159f8443e398"
dependencies = [
"aws-smithy-runtime-api",
"aws-smithy-types",
@@ -483,26 +476,25 @@ dependencies = [
"bytes-utils",
"futures-core",
"futures-util",
- "http 1.4.1",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"http-body-util",
"percent-encoding",
"pin-project-lite",
- "pin-utils",
"tracing",
]
[[package]]
name = "aws-smithy-http-client"
-version = "1.1.12"
+version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6a2f165a7feee6f263028b899d0a181987f4fa7179a6411a32a439fba7c5f769"
+checksum = "aeca69f65362f7375891008ea525fd440ad6db1836458ac188c87b126804114e"
dependencies = [
"aws-smithy-async",
"aws-smithy-runtime-api",
"aws-smithy-types",
"h2",
- "http 1.4.1",
+ "http",
"hyper",
"hyper-rustls",
"hyper-util",
@@ -518,9 +510,9 @@ dependencies = [
[[package]]
name = "aws-smithy-json"
-version = "0.62.6"
+version = "0.65.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "517089205f18ab4adc5a3e02888cb139bbbbb2e168eac9f396216925d1fbeaf5"
+checksum = "9f6835fb38bc6fc8c91e584b0366eb4ff595e5c485134dbf4f0bdeaa18856666"
dependencies = [
"aws-smithy-runtime-api",
"aws-smithy-schema",
@@ -529,28 +521,31 @@ dependencies = [
[[package]]
name = "aws-smithy-observability"
-version = "0.2.6"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a06c2315d173edbf1920da8ba3a7189695827002e4c0fc961973ab1c54abca9c"
+checksum = "8e86338c869539a581bf161247762a6e87f92c5c075060057b5ed6d06632ed0c"
dependencies = [
"aws-smithy-runtime-api",
]
[[package]]
name = "aws-smithy-query"
-version = "0.60.15"
+version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1a56d79744fb3edb5d722ef79d86081e121d3b9422cb209eb03aea6aa4f21ebd"
+checksum = "165f6265342a313ad6f7a1ac17a0cdba30c522039d3f41d8d6871ce8a2b34ecd"
dependencies = [
+ "aws-smithy-runtime-api",
+ "aws-smithy-schema",
"aws-smithy-types",
+ "aws-smithy-xml",
"urlencoding",
]
[[package]]
name = "aws-smithy-runtime"
-version = "1.11.3"
+version = "1.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b8e6f5caf6fea86f8c2206541ab5857cfcda9013426cdbe8fa0098b9e2d32182"
+checksum = "79cef0c41e8ca40f74f68ed8ee4d1ddbde12bb847b95ef9b3c025681ddfae58a"
dependencies = [
"aws-smithy-async",
"aws-smithy-http",
@@ -561,29 +556,25 @@ dependencies = [
"aws-smithy-types",
"bytes",
"fastrand",
- "http 0.2.12",
- "http 1.4.1",
- "http-body 0.4.6",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"http-body-util",
"pin-project-lite",
- "pin-utils",
"tokio",
"tracing",
]
[[package]]
name = "aws-smithy-runtime-api"
-version = "1.12.1"
+version = "1.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "dc117c179ecf39a62a0a3f49f600e9ac26a7ad7dd172177999f83933af776c32"
+checksum = "06788004dea79018413f381891da6dcca23196acd79c4d51b767fbdacc76eae4"
dependencies = [
"aws-smithy-async",
"aws-smithy-runtime-api-macros",
"aws-smithy-types",
"bytes",
- "http 0.2.12",
- "http 1.4.1",
+ "http",
"pin-project-lite",
"tokio",
"tracing",
@@ -592,9 +583,9 @@ dependencies = [
[[package]]
name = "aws-smithy-runtime-api-macros"
-version = "1.0.0"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8d7396fd9500589e62e460e987ecb671bad374934e55ec3b5f498cc7a8a8a7b7"
+checksum = "ce237f890a2283c9b328955c3b0918d2d5bf66a1cb6ceccd36a0047246fbc6e6"
dependencies = [
"proc-macro2",
"quote",
@@ -603,33 +594,30 @@ dependencies = [
[[package]]
name = "aws-smithy-schema"
-version = "0.1.0"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7442cb268338f0eb8278140a107c046756aa01093d8ef5e99628d34ae09c94f5"
+checksum = "bec8dae1015a6d959a5faf86fbdf77486cfe19e4ccb6ee009d8a46efc45028a4"
dependencies = [
"aws-smithy-runtime-api",
"aws-smithy-types",
- "http 1.4.1",
+ "http",
]
[[package]]
name = "aws-smithy-types"
-version = "1.4.8"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "056b66dbce2f81cc0c1e2b05bb402eb58f8a3530479d650efadd5bbae9a4050b"
+checksum = "55752025c39c0e094962fd73f1c57014b191f678612e517f219468e575af9822"
dependencies = [
"base64-simd",
"bytes",
"bytes-utils",
- "http 0.2.12",
- "http 1.4.1",
- "http-body 0.4.6",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"http-body-util",
"itoa",
"num-integer",
"pin-project-lite",
- "pin-utils",
"ryu",
"serde",
"time",
@@ -637,18 +625,21 @@ dependencies = [
[[package]]
name = "aws-smithy-xml"
-version = "0.60.15"
+version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0ce02add1aa3677d022f8adf81dcbe3046a95f17a1b1e8979c145cd21d3d22b3"
+checksum = "a6581618a2fd006159016d1c36881d94d61b4a017f4a8d631310875e18252413"
dependencies = [
+ "aws-smithy-runtime-api",
+ "aws-smithy-schema",
+ "aws-smithy-types",
"xmlparser",
]
[[package]]
name = "aws-types"
-version = "1.3.16"
+version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d16bf10b03a3c01e6b3b7d47cd964e873ffe9e7d4e80fad16bd4c077cb068531"
+checksum = "6ba0d970d3947bb064d2ae1d823efa186c1dbde88f88afa8f6549946e5d8deee"
dependencies = [
"aws-credential-types",
"aws-smithy-async",
@@ -738,12 +729,6 @@ dependencies = [
"vsimd",
]
-[[package]]
-name = "base64ct"
-version = "1.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-
[[package]]
name = "bigdecimal"
version = "0.4.10"
@@ -777,6 +762,25 @@ dependencies = [
"syn 2.0.118",
]
+[[package]]
+name = "bindgen"
+version = "0.73.2"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "787ef8ef523575546b106a58213d6e6b06198a05c2f757258c68a74273670cfa"
+dependencies = [
+ "bitflags 2.11.1",
+ "cexpr",
+ "clang-sys",
+ "log",
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "rustc-hash",
+ "shlex 2.0.1",
+ "syn 3.0.10",
+]
+
[[package]]
name = "bit-vec"
version = "0.8.0"
@@ -798,18 +802,6 @@ dependencies = [
"serde_core",
]
-[[package]]
-name = "bitvec"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
-dependencies = [
- "funty",
- "radium",
- "tap",
- "wyz",
-]
-
[[package]]
name = "block-buffer"
version = "0.10.4"
@@ -844,7 +836,7 @@ version = "3.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "6dee98b0db6a962de883bf5d20362dee4d7ca0d12fe39a7c6c73c844e1cd7c1f"
dependencies = [
- "darling 0.23.0",
+ "darling",
"ident_case",
"prettyplease",
"proc-macro2",
@@ -902,28 +894,6 @@ version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
-[[package]]
-name = "bytecheck"
-version = "0.6.12"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2"
-dependencies = [
- "bytecheck_derive",
- "ptr_meta",
- "simdutf8",
-]
-
-[[package]]
-name = "bytecheck_derive"
-version = "0.6.12"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
[[package]]
name = "byteorder"
version = "1.5.0"
@@ -981,9 +951,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chacha20"
-version = "0.10.0"
+version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601"
+checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"
dependencies = [
"cfg-if",
"cpufeatures 0.3.0",
@@ -1077,9 +1047,9 @@ dependencies = [
[[package]]
name = "cmov"
-version = "0.5.3"
+version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "3f88a43d011fc4a6876cb7344703e297c71dda42494fee094d5f7c76bf13f746"
+checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
[[package]]
name = "colorchoice"
@@ -1123,27 +1093,12 @@ version = "0.4.32"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "cc14f565cf027a105f7a44ccf9e5b424348421a1d8952a8fc9d499d313107789"
-[[package]]
-name = "concurrent-queue"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
-dependencies = [
- "crossbeam-utils",
-]
-
[[package]]
name = "condtype"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af"
-[[package]]
-name = "const-oid"
-version = "0.9.6"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
-
[[package]]
name = "const-oid"
version = "0.10.2"
@@ -1253,9 +1208,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
-version = "0.9.18"
+version = "0.9.21"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
+checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
dependencies = [
"crossbeam-utils",
]
@@ -1305,9 +1260,9 @@ dependencies = [
[[package]]
name = "ctutils"
-version = "0.4.2"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e"
+checksum = "261af4dc7a06ea8a527a8717d8cbba3417530d6ea14e1edb3de6b67806be474f"
dependencies = [
"cmov",
]
@@ -1318,38 +1273,14 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "7ecad1ab94b1336be6cff409436ad9ceedb0afd52a85d54132189c2c3babb049"
-[[package]]
-name = "darling"
-version = "0.20.11"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
-dependencies = [
- "darling_core 0.20.11",
- "darling_macro 0.20.11",
-]
-
[[package]]
name = "darling"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d"
dependencies = [
- "darling_core 0.23.0",
- "darling_macro 0.23.0",
-]
-
-[[package]]
-name = "darling_core"
-version = "0.20.11"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
-dependencies = [
- "fnv",
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim",
- "syn 2.0.118",
+ "darling_core",
+ "darling_macro",
]
[[package]]
@@ -1365,24 +1296,13 @@ dependencies = [
"syn 2.0.118",
]
-[[package]]
-name = "darling_macro"
-version = "0.20.11"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
-dependencies = [
- "darling_core 0.20.11",
- "quote",
- "syn 2.0.118",
-]
-
[[package]]
name = "darling_macro"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d"
dependencies = [
- "darling_core 0.23.0",
+ "darling_core",
"quote",
"syn 2.0.118",
]
@@ -1464,17 +1384,6 @@ dependencies = [
"tokio",
]
-[[package]]
-name = "der"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
-dependencies = [
- "const-oid 0.9.6",
- "pem-rfc7468",
- "zeroize",
-]
-
[[package]]
name = "der-parser"
version = "10.0.0"
@@ -1499,37 +1408,6 @@ dependencies = [
"serde_core",
]
-[[package]]
-name = "derive_builder"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947"
-dependencies = [
- "derive_builder_macro",
-]
-
-[[package]]
-name = "derive_builder_core"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8"
-dependencies = [
- "darling 0.20.11",
- "proc-macro2",
- "quote",
- "syn 2.0.118",
-]
-
-[[package]]
-name = "derive_builder_macro"
-version = "0.20.2"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c"
-dependencies = [
- "derive_builder_core",
- "syn 2.0.118",
-]
-
[[package]]
name = "derive_more"
version = "2.1.1"
@@ -1560,9 +1438,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer 0.10.4",
- "const-oid 0.9.6",
"crypto-common 0.1.7",
- "subtle",
]
[[package]]
@@ -1572,7 +1448,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
dependencies = [
"block-buffer 0.12.0",
- "const-oid 0.10.2",
+ "const-oid",
"crypto-common 0.2.2",
"ctutils",
]
@@ -1649,18 +1525,6 @@ dependencies = [
"cfg-if",
]
-[[package]]
-name = "enum-as-inner"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc"
-dependencies = [
- "heck",
- "proc-macro2",
- "quote",
- "syn 2.0.118",
-]
-
[[package]]
name = "equivalent"
version = "1.0.2"
@@ -1679,22 +1543,20 @@ dependencies = [
[[package]]
name = "etcetera"
-version = "0.8.0"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943"
+checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96"
dependencies = [
"cfg-if",
- "home",
- "windows-sys 0.48.0",
+ "windows-sys 0.61.2",
]
[[package]]
name = "event-listener"
-version = "5.4.1"
+version = "5.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab"
+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
dependencies = [
- "concurrent-queue",
"parking",
"pin-project-lite",
]
@@ -1739,9 +1601,9 @@ dependencies = [
[[package]]
name = "flume"
-version = "0.11.1"
+version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095"
+checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be"
dependencies = [
"futures-core",
"futures-sink",
@@ -1796,12 +1658,6 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
-[[package]]
-name = "funty"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
-
[[package]]
name = "futures"
version = "0.3.32"
@@ -1943,11 +1799,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
dependencies = [
"cfg-if",
- "js-sys",
"libc",
"r-efi 5.3.0",
"wasip2",
- "wasm-bindgen",
]
[[package]]
@@ -1957,11 +1811,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
dependencies = [
"cfg-if",
+ "js-sys",
"libc",
"r-efi 6.0.0",
"rand_core 0.10.1",
"wasip2",
"wasip3",
+ "wasm-bindgen",
]
[[package]]
@@ -1972,16 +1828,16 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
[[package]]
name = "h2"
-version = "0.4.14"
+version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733"
+checksum = "7d29020232d6aa3fb1daca64c1127cf662cf97f254ae16c18c05b8ab635fc118"
dependencies = [
"atomic-waker",
"bytes",
"fnv",
"futures-core",
"futures-sink",
- "http 1.4.1",
+ "http",
"indexmap 2.14.0",
"slab",
"tokio",
@@ -1994,9 +1850,6 @@ name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
-dependencies = [
- "ahash 0.7.8",
-]
[[package]]
name = "hashbrown"
@@ -2010,8 +1863,6 @@ version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
- "allocator-api2",
- "equivalent",
"foldhash 0.1.5",
]
@@ -2031,14 +1882,17 @@ name = "hashbrown"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
+dependencies = [
+ "foldhash 0.2.0",
+]
[[package]]
name = "hashlink"
-version = "0.10.0"
+version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
+checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f"
dependencies = [
- "hashbrown 0.15.5",
+ "hashbrown 0.16.1",
]
[[package]]
@@ -2060,46 +1914,70 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
-name = "hickory-proto"
-version = "0.25.2"
+name = "hickory-net"
+version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502"
+checksum = "c480823ed7c2c5d0f09c41020cb6b7c28029ce60ec42dc942158dcf22f8e0a4d"
dependencies = [
"async-trait",
"cfg-if",
"data-encoding",
- "enum-as-inner",
"futures-channel",
"futures-io",
"futures-util",
+ "hickory-proto",
+ "idna",
+ "ipnet",
+ "jni",
+ "rand 0.10.1",
+ "thiserror",
+ "tinyvec",
+ "tokio",
+ "tracing",
+ "url",
+]
+
+[[package]]
+name = "hickory-proto"
+version = "0.26.3"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d"
+dependencies = [
+ "data-encoding",
"idna",
"ipnet",
+ "jni",
"once_cell",
- "rand 0.9.4",
+ "prefix-trie",
+ "rand 0.10.1",
"ring",
"thiserror",
"tinyvec",
- "tokio",
"tracing",
"url",
]
[[package]]
name = "hickory-resolver"
-version = "0.25.2"
+version = "0.26.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a"
+checksum = "3f3da5255c95d5a716857d54b5b8f4e8d67c3484d3beaaaae2ce25063b3ba981"
dependencies = [
"cfg-if",
"futures-util",
+ "hickory-net",
"hickory-proto",
"ipconfig",
+ "ipnet",
+ "jni",
"moka",
+ "ndk-context",
"once_cell",
"parking_lot",
- "rand 0.9.4",
+ "rand 0.10.1",
"resolv-conf",
"smallvec",
+ "system-configuration",
"thiserror",
"tokio",
"tracing",
@@ -2107,20 +1985,11 @@ dependencies = [
[[package]]
name = "hkdf"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
-dependencies = [
- "hmac 0.12.1",
-]
-
-[[package]]
-name = "hmac"
-version = "0.12.1"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
+checksum = "4aaa26c720c68b866f2c96ef5c1264b3e6f473fe5d4ce61cd44bbe913e553018"
dependencies = [
- "digest 0.10.7",
+ "hmac",
]
[[package]]
@@ -2132,26 +2001,6 @@ dependencies = [
"digest 0.11.3",
]
-[[package]]
-name = "home"
-version = "0.5.12"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d"
-dependencies = [
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "http"
-version = "0.2.12"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
-dependencies = [
- "bytes",
- "fnv",
- "itoa",
-]
-
[[package]]
name = "http"
version = "1.4.1"
@@ -2162,17 +2011,6 @@ dependencies = [
"itoa",
]
-[[package]]
-name = "http-body"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
-dependencies = [
- "bytes",
- "http 0.2.12",
- "pin-project-lite",
-]
-
[[package]]
name = "http-body"
version = "1.0.1"
@@ -2180,7 +2018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
dependencies = [
"bytes",
- "http 1.4.1",
+ "http",
]
[[package]]
@@ -2191,8 +2029,8 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
dependencies = [
"bytes",
"futures-core",
- "http 1.4.1",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"pin-project-lite",
]
@@ -2228,8 +2066,8 @@ dependencies = [
"futures-channel",
"futures-core",
"h2",
- "http 1.4.1",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"httparse",
"httpdate",
"itoa",
@@ -2245,7 +2083,7 @@ version = "0.27.9"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f"
dependencies = [
- "http 1.4.1",
+ "http",
"hyper",
"hyper-util",
"rustls",
@@ -2265,8 +2103,8 @@ dependencies = [
"bytes",
"futures-channel",
"futures-util",
- "http 1.4.1",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"hyper",
"ipnet",
"libc",
@@ -2478,7 +2316,7 @@ dependencies = [
"pgdog-regress",
"pgdog-stats",
"postgres-native-tls",
- "rand 0.9.4",
+ "rand 0.10.1",
"reqwest",
"rust_decimal",
"serde_json",
@@ -2508,6 +2346,9 @@ name = "ipnet"
version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2"
+dependencies = [
+ "serde",
+]
[[package]]
name = "is_terminal_polyfill"
@@ -2668,9 +2509,6 @@ name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
-dependencies = [
- "spin",
-]
[[package]]
name = "leb128fmt"
@@ -2706,17 +2544,14 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c"
dependencies = [
- "bitflags 2.11.1",
"libc",
- "plain",
- "redox_syscall 0.7.5",
]
[[package]]
name = "libsqlite3-sys"
-version = "0.30.1"
+version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
+checksum = "b06e69070b7e12262b0cd90832f0a7396f142a2b330181255562decf9f0c6215"
dependencies = [
"pkg-config",
"vcpkg",
@@ -2751,11 +2586,11 @@ checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5"
[[package]]
name = "lru"
-version = "0.16.4"
+version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39"
+checksum = "4a9f71e3591c7ec44d3e563e87bf14ddc2bada8519dca046e5b0e560cd004e2d"
dependencies = [
- "hashbrown 0.16.1",
+ "hashbrown 0.17.1",
]
[[package]]
@@ -2773,16 +2608,6 @@ dependencies = [
"regex-automata",
]
-[[package]]
-name = "md-5"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
-dependencies = [
- "cfg-if",
- "digest 0.10.7",
-]
-
[[package]]
name = "md-5"
version = "0.11.0"
@@ -2793,12 +2618,6 @@ dependencies = [
"digest 0.11.3",
]
-[[package]]
-name = "md5"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
-
[[package]]
name = "md5"
version = "0.8.1"
@@ -2878,6 +2697,12 @@ dependencies = [
"tempfile",
]
+[[package]]
+name = "ndk-context"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
+
[[package]]
name = "nom"
version = "7.1.3"
@@ -2907,22 +2732,6 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "num-bigint-dig"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7"
-dependencies = [
- "lazy_static",
- "libm",
- "num-integer",
- "num-iter",
- "num-traits",
- "rand 0.8.6",
- "smallvec",
- "zeroize",
-]
-
[[package]]
name = "num-conv"
version = "0.2.2"
@@ -2938,17 +2747,6 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "num-iter"
-version = "0.1.45"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
[[package]]
name = "num-traits"
version = "0.2.19"
@@ -2956,7 +2754,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
- "libm",
]
[[package]]
@@ -3085,7 +2882,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall 0.5.18",
+ "redox_syscall",
"smallvec",
"windows-link",
]
@@ -3096,15 +2893,6 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
-[[package]]
-name = "pem-rfc7468"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
-dependencies = [
- "base64ct",
-]
-
[[package]]
name = "percent-encoding"
version = "2.3.2"
@@ -3112,36 +2900,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
-name = "pg_internals"
-version = "0.1.0"
-source = "git+https://github.com/pgdogdev/pg-internals?rev=ce5c26f2501d787cdb84f610176a92880944dbcd#ce5c26f2501d78...;
-dependencies = [
- "bindgen",
- "cc",
- "clang-sys",
- "phf 0.13.1",
- "phf_codegen",
- "prettyplease",
- "proc-macro2",
- "quote",
- "serde_json",
- "syn 2.0.118",
- "thiserror",
-]
-
-[[package]]
-name = "pg_raw_parse"
+name = "pg_internals"
version = "0.1.0"
-source = "git+https://github.com/pgdogdev/pg_raw_parse.git?rev=89937b1#89937b1a9c39bbb53b679f12aba3ff7c5ab3c093...;
+source = "git+https://github.com/pgdogdev/pg-internals?rev=ce5c26f2501d787cdb84f610176a92880944dbcd#ce5c26f2501d78...;
dependencies = [
- "bindgen",
+ "bindgen 0.72.1",
"cc",
- "convert_case 0.11.0",
- "generativity",
- "glob",
- "libc",
+ "clang-sys",
+ "phf 0.13.1",
+ "phf_codegen",
"prettyplease",
- "regex",
+ "proc-macro2",
+ "quote",
+ "serde_json",
"syn 2.0.118",
"thiserror",
]
@@ -3151,7 +2922,7 @@ name = "pg_raw_parse"
version = "0.1.0"
source = "git+https://github.com/pgdogdev/pg_raw_parse.git?rev=a4784fc603563d3db8e9f381347f039f39b1dd85#a4784fc603...;
dependencies = [
- "bindgen",
+ "bindgen 0.72.1",
"cc",
"convert_case 0.11.0",
"generativity",
@@ -3173,7 +2944,7 @@ dependencies = [
"aws-lc-rs",
"base64 0.22.1",
"bytes",
- "md5 0.8.1",
+ "md5",
"tokio",
]
@@ -3199,7 +2970,6 @@ dependencies = [
"clap",
"csv-core",
"dashmap",
- "derive_builder",
"derive_more",
"divan",
"dyn-clone",
@@ -3217,13 +2987,13 @@ dependencies = [
"lazy_static",
"libc",
"lru",
- "md5 0.7.0",
+ "md5",
"memchr",
"moka",
"once_cell",
"parking_lot",
"pg_internals",
- "pg_raw_parse 0.1.0 (git+https://github.com/pgdogdev/pg_raw_parse.git?rev=89937b1)";,
+ "pg_raw_parse",
"pgdog-config",
"pgdog-macros",
"pgdog-plugin",
@@ -3232,7 +3002,7 @@ dependencies = [
"pgdog-util",
"pgdog-vector",
"pin-project",
- "rand 0.9.4",
+ "rand 0.10.1",
"regex",
"reqwest",
"rmp-serde",
@@ -3244,7 +3014,7 @@ dependencies = [
"semver",
"serde",
"serde_json",
- "sha1",
+ "sha1 0.10.6",
"smallvec",
"socket2",
"stats_alloc",
@@ -3292,7 +3062,7 @@ version = "0.1.0"
dependencies = [
"once_cell",
"parking_lot",
- "pg_raw_parse 0.1.0 (git+https://github.com/pgdogdev/pg_raw_parse.git?rev=89937b1)";,
+ "pg_raw_parse",
"pgdog-plugin",
"thiserror",
]
@@ -3324,7 +3094,7 @@ name = "pgdog-plugin"
version = "0.5.0"
dependencies = [
"libloading",
- "pg_raw_parse 0.1.0 (git+https://github.com/pgdogdev/pg_raw_parse.git?rev=89937b1)";,
+ "pg_raw_parse",
"pgdog-postgres-types",
"tracing",
"tracing-subscriber",
@@ -3351,7 +3121,7 @@ version = "0.1.0"
dependencies = [
"arc-swap",
"once_cell",
- "pg_raw_parse 0.1.0 (git+https://github.com/pgdogdev/pg_raw_parse.git?rev=89937b1)";,
+ "pg_raw_parse",
"pgdog-plugin",
"serde",
"thiserror",
@@ -3366,8 +3136,8 @@ source = "git+https://github.com/pgdogdev/regress.git?rev=22032787eeaef9bf97aaa3
dependencies = [
"bytes",
"fallible-iterator",
- "pg_raw_parse 0.1.0 (git+https://github.com/pgdogdev/pg_raw_parse.git?rev=a4784fc603563d3db8e9f381347f039f39b1dd85)";,
- "postgres-protocol 0.6.12",
+ "pg_raw_parse",
+ "postgres-protocol 0.6.12 (git+https://github.com/pgdogdev/regress.git?rev=22032787eeaef9bf97aaa3216735a7369f1f9125)";,
"tokio",
]
@@ -3483,45 +3253,12 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkcs1"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f"
-dependencies = [
- "der",
- "pkcs8",
- "spki",
-]
-
-[[package]]
-name = "pkcs8"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
-dependencies = [
- "der",
- "spki",
-]
-
[[package]]
name = "pkg-config"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
-[[package]]
-name = "plain"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
-
[[package]]
name = "portable-atomic"
version = "1.13.1"
@@ -3551,19 +3288,19 @@ dependencies = [
[[package]]
name = "postgres-protocol"
-version = "0.6.11"
+version = "0.6.12"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "56201207dac53e2f38e848e31b4b91616a6bb6e0c7205b77718994a7f49e70fc"
+checksum = "08808e3c483c46e999108051c78334f473d5adb59d78bb80a1268c7e6aa6c514"
dependencies = [
"base64 0.22.1",
"byteorder",
"bytes",
"fallible-iterator",
- "hmac 0.13.0",
- "md-5 0.11.0",
+ "hmac",
+ "md-5",
"memchr",
"rand 0.10.1",
- "sha2 0.11.0",
+ "sha2",
"stringprep",
]
@@ -3576,23 +3313,23 @@ dependencies = [
"byteorder",
"bytes",
"fallible-iterator",
- "hmac 0.13.0",
- "md-5 0.11.0",
+ "hmac",
+ "md-5",
"memchr",
"rand 0.10.1",
- "sha2 0.11.0",
+ "sha2",
"stringprep",
]
[[package]]
name = "postgres-types"
-version = "0.2.13"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8dc729a129e682e8d24170cd30ae1aa01b336b096cbb56df6d534ffec133d186"
+checksum = "851ca9db4932932d69f3ea811b1abe63087a0f740a47692619dd40d4899b68be"
dependencies = [
"bytes",
"fallible-iterator",
- "postgres-protocol 0.6.11",
+ "postgres-protocol 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)";,
"uuid",
]
@@ -3620,6 +3357,17 @@ dependencies = [
"zerocopy",
]
+[[package]]
+name = "prefix-trie"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "4cf6e3177f0684016a5c209b00882e15f8bdd3f3bb48f0491df10cd102d0c6e7"
+dependencies = [
+ "either",
+ "ipnet",
+ "num-traits",
+]
+
[[package]]
name = "prettyplease"
version = "0.2.37"
@@ -3648,26 +3396,6 @@ dependencies = [
"unicode-ident",
]
-[[package]]
-name = "ptr_meta"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1"
-dependencies = [
- "ptr_meta_derive",
-]
-
-[[package]]
-name = "ptr_meta_derive"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
[[package]]
name = "quinn"
version = "0.11.11"
@@ -3690,15 +3418,16 @@ dependencies = [
[[package]]
name = "quinn-proto"
-version = "0.11.15"
+version = "0.11.19"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4fcb935c5bec503c2f0e306bdd3e58bb9029dcb14fa8d9ac76e3a5256ac0763e"
+checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe"
dependencies = [
"aws-lc-rs",
"bytes",
- "getrandom 0.3.4",
+ "getrandom 0.4.2",
"lru-slab",
- "rand 0.9.4",
+ "rand 0.10.1",
+ "rand_pcg",
"ring",
"rustc-hash",
"rustls",
@@ -3712,16 +3441,16 @@ dependencies = [
[[package]]
name = "quinn-udp"
-version = "0.5.14"
+version = "0.5.16"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
+checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016"
dependencies = [
"cfg_aliases",
"libc",
"once_cell",
"socket2",
"tracing",
- "windows-sys 0.52.0",
+ "windows-sys 0.61.2",
]
[[package]]
@@ -3745,12 +3474,6 @@ version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
-[[package]]
-name = "radium"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
-
[[package]]
name = "rand"
version = "0.8.6"
@@ -3828,19 +3551,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
[[package]]
-name = "redox_syscall"
-version = "0.5.18"
+name = "rand_pcg"
+version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
+checksum = "eb95882a1e14462c69aea9984bb261293ccfe6022ef8de0eda18bd5afb0052df"
dependencies = [
- "bitflags 2.11.1",
+ "rand_core 0.10.1",
]
[[package]]
name = "redox_syscall"
-version = "0.7.5"
+version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4666a1a60d8412eab19d94f6d13dcc9cea0a5ef4fdf6a5db306537413c661b1b"
+checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
dependencies = [
"bitflags 2.11.1",
]
@@ -3900,15 +3623,6 @@ version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
-[[package]]
-name = "rend"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c"
-dependencies = [
- "bytecheck",
-]
-
[[package]]
name = "reqwest"
version = "0.13.4"
@@ -3921,8 +3635,8 @@ dependencies = [
"futures-core",
"futures-util",
"h2",
- "http 1.4.1",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"http-body-util",
"hyper",
"hyper-rustls",
@@ -3972,35 +3686,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "rkyv"
-version = "0.7.46"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1"
-dependencies = [
- "bitvec",
- "bytecheck",
- "bytes",
- "hashbrown 0.12.3",
- "ptr_meta",
- "rend",
- "rkyv_derive",
- "seahash",
- "tinyvec",
- "uuid",
-]
-
-[[package]]
-name = "rkyv_derive"
-version = "0.7.46"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
[[package]]
name = "rmp"
version = "0.8.15"
@@ -4020,31 +3705,11 @@ dependencies = [
"serde",
]
-[[package]]
-name = "rsa"
-version = "0.9.10"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d"
-dependencies = [
- "const-oid 0.9.6",
- "digest 0.10.7",
- "num-bigint-dig",
- "num-integer",
- "num-traits",
- "pkcs1",
- "pkcs8",
- "rand_core 0.6.4",
- "signature",
- "spki",
- "subtle",
- "zeroize",
-]
-
[[package]]
name = "rust_decimal"
-version = "1.42.0"
+version = "1.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0c5108e3d4d903e21aac27f12ba5377b6b34f9f44b325e4894c7924169d06995"
+checksum = "7653272e75dcac41dc199fbea6f5797633994fafd339943c06c9af16bf29cd3a"
dependencies = [
"arrayvec",
"borsh",
@@ -4052,7 +3717,7 @@ dependencies = [
"num-traits",
"postgres-types",
"rand 0.8.6",
- "rkyv",
+ "rand 0.9.4",
"rust_decimal_macros",
"serde",
"serde_json",
@@ -4095,9 +3760,9 @@ dependencies = [
[[package]]
name = "rustix"
-version = "1.1.4"
+version = "1.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
+checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
dependencies = [
"bitflags 2.11.1",
"errno",
@@ -4108,9 +3773,9 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.23.40"
+version = "0.23.46"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b"
+checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
dependencies = [
"aws-lc-rs",
"log",
@@ -4172,9 +3837,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
[[package]]
name = "rustls-webpki"
-version = "0.103.13"
+version = "0.103.17"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"
+checksum = "e3a0760a887c14823fca5a1c970b01d47c328c696c0c64829d1df50e8f853fd5"
dependencies = [
"aws-lc-rs",
"ring",
@@ -4203,15 +3868,6 @@ dependencies = [
"winapi-util",
]
-[[package]]
-name = "scc"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "46e6f046b7fef48e2660c57ed794263155d713de679057f2d0c169bfc6e756cc"
-dependencies = [
- "sdd",
-]
-
[[package]]
name = "schannel"
version = "0.1.29"
@@ -4277,18 +3933,6 @@ dependencies = [
"rand 0.8.6",
]
-[[package]]
-name = "sdd"
-version = "3.0.10"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca"
-
-[[package]]
-name = "seahash"
-version = "4.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
-
[[package]]
name = "security-framework"
version = "3.7.0"
@@ -4381,18 +4025,6 @@ dependencies = [
"serde",
]
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
-dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
- "serde",
-]
-
[[package]]
name = "serde_with"
version = "3.22.0"
@@ -4420,7 +4052,7 @@ version = "3.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "8705578779c2b6bd90d84d66eb2e206b708b1a4d7b9f17641b293545bf1c7e46"
dependencies = [
- "darling 0.23.0",
+ "darling",
"proc-macro2",
"quote",
"syn 2.0.118",
@@ -4428,28 +4060,27 @@ dependencies = [
[[package]]
name = "serial_test"
-version = "3.4.0"
+version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "911bd979bf1070a3f3aa7b691a3b3e9968f339ceeec89e08c280a8a22207a32f"
+checksum = "a6df5ed973ad8d834e09f824f9e9f449af6b9a3745f78dec7cc752770bd3bf11"
dependencies = [
"futures-executor",
"futures-util",
"log",
"once_cell",
"parking_lot",
- "scc",
"serial_test_derive",
]
[[package]]
name = "serial_test_derive"
-version = "3.4.0"
+version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0a7d91949b85b0d2fb687445e448b40d322b6b3e4af6b44a29b21d9a5f33e6d9"
+checksum = "a22144e767da4ddd8416dbf383700542ffd8a5dc493dfecedfe1fe3ad03c98ae"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.118",
+ "syn 3.0.10",
]
[[package]]
@@ -4464,14 +4095,14 @@ dependencies = [
]
[[package]]
-name = "sha2"
-version = "0.10.9"
+name = "sha1"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
+checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214"
dependencies = [
"cfg-if",
- "cpufeatures 0.2.17",
- "digest 0.10.7",
+ "cpufeatures 0.3.0",
+ "digest 0.11.3",
]
[[package]]
@@ -4516,16 +4147,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "signature"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
-dependencies = [
- "digest 0.10.7",
- "rand_core 0.6.4",
-]
-
[[package]]
name = "simd-adler32"
version = "0.3.9"
@@ -4581,28 +4202,18 @@ dependencies = [
[[package]]
name = "spin"
-version = "0.9.8"
+version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
+checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e"
dependencies = [
"lock_api",
]
-[[package]]
-name = "spki"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
-dependencies = [
- "base64ct",
- "der",
-]
-
[[package]]
name = "sqlx"
-version = "0.8.6"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc"
+checksum = "edb1dddfbdfe5fb99dba0541a87b2edb8adbd59e45815db22d32d4fbbb8813dd"
dependencies = [
"sqlx-core",
"sqlx-macros",
@@ -4613,13 +4224,14 @@ dependencies = [
[[package]]
name = "sqlx-core"
-version = "0.8.6"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6"
+checksum = "c08f9787cc5aff062567dea2205f8ae37a617b04342633ab4f74944858ea6072"
dependencies = [
"base64 0.22.1",
"bigdecimal",
"bytes",
+ "cfg-if",
"chrono",
"crc",
"crossbeam-queue",
@@ -4629,18 +4241,17 @@ dependencies = [
"futures-intrusive",
"futures-io",
"futures-util",
- "hashbrown 0.15.5",
+ "hashbrown 0.16.1",
"hashlink",
"indexmap 2.14.0",
"log",
"memchr",
"native-tls",
- "once_cell",
"percent-encoding",
"rust_decimal",
"serde",
"serde_json",
- "sha2 0.10.9",
+ "sha2",
"smallvec",
"thiserror",
"tokio",
@@ -4652,9 +4263,9 @@ dependencies = [
[[package]]
name = "sqlx-macros"
-version = "0.8.6"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d"
+checksum = "bf62c58a1e7fd6031ee684eee21d07572f5aebe71c273a01ae4f04eeeba47c47"
dependencies = [
"proc-macro2",
"quote",
@@ -4665,20 +4276,20 @@ dependencies = [
[[package]]
name = "sqlx-macros-core"
-version = "0.8.6"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b"
+checksum = "c1ff75c9d609ac84aa8a3e0d92b5c0c54bf541a7f70db492fb40c9a4bea792c8"
dependencies = [
+ "cfg-if",
"dotenvy",
"either",
"heck",
"hex",
- "once_cell",
"proc-macro2",
"quote",
"serde",
"serde_json",
- "sha2 0.10.9",
+ "sha2",
"sqlx-core",
"sqlx-mysql",
"sqlx-postgres",
@@ -4690,55 +4301,39 @@ dependencies = [
[[package]]
name = "sqlx-mysql"
-version = "0.8.6"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526"
+checksum = "19eeb93b96eb10a3a59dfb436f3daf87d2fc41168ed9e9dc153ec8257dd6a761"
dependencies = [
- "atoi",
- "base64 0.22.1",
"bigdecimal",
"bitflags 2.11.1",
"byteorder",
"bytes",
"chrono",
"crc",
- "digest 0.10.7",
+ "digest 0.11.3",
"dotenvy",
"either",
- "futures-channel",
"futures-core",
- "futures-io",
"futures-util",
"generic-array",
- "hex",
- "hkdf",
- "hmac 0.12.1",
- "itoa",
"log",
- "md-5 0.10.6",
- "memchr",
- "once_cell",
"percent-encoding",
- "rand 0.8.6",
- "rsa",
"rust_decimal",
"serde",
- "sha1",
- "sha2 0.10.9",
- "smallvec",
+ "sha1 0.11.0",
+ "sha2",
"sqlx-core",
- "stringprep",
"thiserror",
"tracing",
"uuid",
- "whoami 1.6.1",
]
[[package]]
name = "sqlx-postgres"
-version = "0.8.6"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46"
+checksum = "b0e9e02f764a1fe640eeefc8eb33eeddd274204654ec9f2db8ff851a1dee2364"
dependencies = [
"atoi",
"base64 0.22.1",
@@ -4754,37 +4349,36 @@ dependencies = [
"futures-util",
"hex",
"hkdf",
- "hmac 0.12.1",
- "home",
+ "hmac",
"itoa",
"log",
- "md-5 0.10.6",
+ "md-5",
"memchr",
"num-bigint",
- "once_cell",
- "rand 0.8.6",
+ "rand 0.10.1",
"rust_decimal",
"serde",
"serde_json",
- "sha2 0.10.9",
+ "sha2",
"smallvec",
"sqlx-core",
"stringprep",
"thiserror",
"tracing",
"uuid",
- "whoami 1.6.1",
+ "whoami",
]
[[package]]
name = "sqlx-sqlite"
-version = "0.8.6"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea"
+checksum = "88b6b78a34ddcb1db4046d462db8f79cee811019d7297b99fca8fac5de26672e"
dependencies = [
"atoi",
"chrono",
"flume",
+ "form_urlencoded",
"futures-channel",
"futures-core",
"futures-executor",
@@ -4794,7 +4388,6 @@ dependencies = [
"log",
"percent-encoding",
"serde",
- "serde_urlencoded",
"sqlx-core",
"thiserror",
"tracing",
@@ -4839,9 +4432,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "syn"
-version = "1.0.109"
+version = "2.0.118"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
dependencies = [
"proc-macro2",
"quote",
@@ -4850,9 +4443,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.118"
+version = "3.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
+checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
dependencies = [
"proc-macro2",
"quote",
@@ -4906,12 +4499,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
-[[package]]
-name = "tap"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
-
[[package]]
name = "tempfile"
version = "3.27.0"
@@ -5091,9 +4678,9 @@ dependencies = [
[[package]]
name = "tokio-postgres"
-version = "0.7.17"
+version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4dd8df5ef180f6364759a6f00f7aadda4fbbac86cdee37480826a6ff9f3574ce"
+checksum = "a528f7d280f6d5b9cd149635c8705b0dd049754bc67d81d31fa25169a93809d3"
dependencies = [
"async-trait",
"byteorder",
@@ -5106,13 +4693,13 @@ dependencies = [
"percent-encoding",
"phf 0.13.1",
"pin-project-lite",
- "postgres-protocol 0.6.11",
+ "postgres-protocol 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)";,
"postgres-types",
"rand 0.10.1",
"socket2",
"tokio",
"tokio-util",
- "whoami 2.1.2",
+ "whoami",
]
[[package]]
@@ -5247,8 +4834,8 @@ dependencies = [
"bytes",
"futures-core",
"futures-util",
- "http 1.4.1",
- "http-body 1.0.1",
+ "http",
+ "http-body",
"http-body-util",
"pin-project-lite",
"tokio",
@@ -5352,7 +4939,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "5e4e430251f5ca8f86ea941286923dc2e91be7ca95fec777d75ee8ae1c493f64"
dependencies = [
- "ahash 0.8.12",
+ "ahash",
"dashmap",
"tokio",
"tracing",
@@ -5597,12 +5184,6 @@ dependencies = [
"wit-bindgen 0.51.0",
]
-[[package]]
-name = "wasite"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
-
[[package]]
name = "wasite"
version = "1.0.2"
@@ -5737,23 +5318,13 @@ dependencies = [
[[package]]
name = "webpki-root-certs"
-version = "1.0.8"
+version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267"
+checksum = "293198dcebfb821155b5092ab94b5a82ff180eddd7241df3bd6e66a4ffd1a585"
dependencies = [
"rustls-pki-types",
]
-[[package]]
-name = "whoami"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d"
-dependencies = [
- "libredox",
- "wasite 0.1.0",
-]
-
[[package]]
name = "whoami"
version = "2.1.2"
@@ -5763,7 +5334,7 @@ dependencies = [
"libc",
"libredox",
"objc2-system-configuration",
- "wasite 1.0.2",
+ "wasite",
"web-sys",
]
@@ -5852,22 +5423,13 @@ dependencies = [
"windows-link",
]
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.6",
+ "windows-targets",
]
[[package]]
@@ -5879,67 +5441,34 @@ dependencies = [
"windows-link",
]
-[[package]]
-name = "windows-targets"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
-dependencies = [
- "windows_aarch64_gnullvm 0.48.5",
- "windows_aarch64_msvc 0.48.5",
- "windows_i686_gnu 0.48.5",
- "windows_i686_msvc 0.48.5",
- "windows_x86_64_gnu 0.48.5",
- "windows_x86_64_gnullvm 0.48.5",
- "windows_x86_64_msvc 0.48.5",
-]
-
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "windows_aarch64_gnullvm 0.52.6",
- "windows_aarch64_msvc 0.52.6",
- "windows_i686_gnu 0.52.6",
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
"windows_i686_gnullvm",
- "windows_i686_msvc 0.52.6",
- "windows_x86_64_gnu 0.52.6",
- "windows_x86_64_gnullvm 0.52.6",
- "windows_x86_64_msvc 0.52.6",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
]
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
-
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
-
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
-
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
@@ -5952,48 +5481,24 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
-[[package]]
-name = "windows_i686_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
-
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
-
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
-
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
-
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
@@ -6028,7 +5533,7 @@ dependencies = [
"base64 0.22.1",
"deadpool",
"futures",
- "http 1.4.1",
+ "http",
"http-body-util",
"hyper",
"hyper-util",
@@ -6150,15 +5655,6 @@ version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index";
checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
-[[package]]
-name = "wyz"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
-dependencies = [
- "tap",
-]
-
[[package]]
name = "x509-parser"
version = "0.18.1"
diff --git a/Cargo.toml b/Cargo.toml
index 2cb3d14d5..e11ee9ac6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,7 +22,7 @@ edition = "2024"
pgdog-plugin = { path = "./pgdog-plugin", version = "0.5.0", default-features = false }
pgdog-config = { path = "./pgdog-config", version = "0.1.0" }
pgdog-postgres-types = { path = "./pgdog-postgres-types"}
-pg_raw_parse = { git = "https://github.com/pgdogdev/pg_raw_parse.git";, rev = "89937b1" }
+pg_raw_parse = { git = "https://github.com/pgdogdev/pg_raw_parse.git";, rev = "a4784fc603563d3db8e9f381347f039f39b1dd85" }
pgdog-util = { path = "./pgdog-util", version = "0.1.0" }
bon = "3.9"
derive_more = { version = "2", features = ["display", "from"] }
@@ -34,6 +34,9 @@ reqwest = { version = "0.13", features = ["json"] }
bytes = "1"
uuid = { version = "1", features = ["v4", "v7", "serde"] }
parking_lot = "0.12"
+rand = "0.10"
+serde = { version = "1", features = ["derive"] }
+toml = "0.8"
futures-util = "0.3.32"
tokio = { version = "1.54", features = ["full"]}
diff --git a/integration/rust/Cargo.toml b/integration/rust/Cargo.toml
index ba78267ce..05fd26559 100644
--- a/integration/rust/Cargo.toml
+++ b/integration/rust/Cargo.toml
@@ -9,7 +9,7 @@ test = true
[dependencies]
tokio-postgres = {version = "0.7.13", features = ["with-uuid-1"]}
native-tls = "0.2"
-sqlx = { version = "0.8.6", features = ["postgres", "runtime-tokio", "tls-native-tls", "bigdecimal", "chrono", "json", "rust_decimal", "uuid"]}
+sqlx = { version = "0.9.1", default-features = false, features = ["derive", "postgres", "runtime-tokio", "tls-native-tls", "bigdecimal", "chrono", "json", "rust_decimal", "uuid"]}
tokio.workspace = true
futures-util.workspace = true
uuid.workspace = true
@@ -22,9 +22,9 @@ rust_decimal = { version = "1.42.0", features = ["macros"] }
[dev-dependencies]
postgres-native-tls = "0.5"
-serial_test = "3"
+serial_test = "4"
reqwest.workspace = true
-rand = "0.9"
+rand.workspace = true
chrono-tz = "0.10.4"
pgdog-stats = { path = "../../pgdog-stats" }
pg_stream = "0.2.1"
diff --git a/integration/rust/src/lib.rs b/integration/rust/src/lib.rs
index 23f5525c1..b076c7467 100644
--- a/integration/rust/src/lib.rs
+++ b/integration/rust/src/lib.rs
@@ -1,2 +1,9 @@
+#[macro_export]
+macro_rules! unsafe_sql {
+ ($($arg:tt)*) => {
+ ::sqlx::SqlSafeStr::into_sql_str(::sqlx::AssertSqlSafe(::std::format!($($arg)*)))
+ };
+}
+
pub mod setup;
pub mod utils;
diff --git a/integration/rust/src/setup.rs b/integration/rust/src/setup.rs
index 72a22160a..de9c0c6ea 100644
--- a/integration/rust/src/setup.rs
+++ b/integration/rust/src/setup.rs
@@ -73,17 +73,14 @@ pub struct Backend {
}
pub async fn backends(application_name: &str, pool: &Pool<Postgres>) -> Vec<Backend> {
- pool.fetch_all(
- format!(
- "SELECT pid::INTEGER,
+ pool.fetch_all(unsafe_sql!(
+ "SELECT pid::INTEGER,
backend_start::TEXT
FROM pg_stat_activity
WHERE application_name = '{}'
ORDER BY backend_start",
- application_name
- )
- .as_str(),
- )
+ application_name
+ ))
.await
.unwrap()
.into_iter()
diff --git a/integration/rust/tests/bench/prepared_stress.rs b/integration/rust/tests/bench/prepared_stress.rs
index 6f0e8a17e..4f79c8865 100644
--- a/integration/rust/tests/bench/prepared_stress.rs
+++ b/integration/rust/tests/bench/prepared_stress.rs
@@ -21,8 +21,9 @@ async fn slam_with_prepared() -> Result<(), Box<dyn std::error::Error>> {
loop {
let r = rand::random_range(0..statements);
- let query = format!("SELECT 1, 2, 3, 4, $1, 'apples and oranges', 'blah', {}", r);
- let query = sqlx::query(query.as_str()).bind(r).execute(&mut conn);
+ let query =
+ unsafe_sql!("SELECT 1, 2, 3, 4, $1, 'apples and oranges', 'blah', {}", r);
+ let query = sqlx::query(query).bind(r).execute(&mut conn);
select! {
res = query => {
diff --git a/integration/rust/tests/integration/admin/resharding/copy_data.rs b/integration/rust/tests/integration/admin/resharding/copy_data.rs
index 1ef361012..435ed27e4 100644
--- a/integration/rust/tests/integration/admin/resharding/copy_data.rs
+++ b/integration/rust/tests/integration/admin/resharding/copy_data.rs
@@ -18,22 +18,21 @@ fn numbered_table(i: usize) -> String {
}
async fn create_table(pool: &Pool<Postgres>, table: &str) {
- pool.execute(format!("CREATE SCHEMA IF NOT EXISTS {TEST_SCHEMA}").as_str())
+ pool.execute(unsafe_sql!("CREATE SCHEMA IF NOT EXISTS {TEST_SCHEMA}"))
.await
.expect("test schema creation must succeed");
- pool.execute(
- format!("CREATE TABLE {TEST_SCHEMA}.{table} (id BIGSERIAL PRIMARY KEY, val TEXT)").as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "CREATE TABLE {TEST_SCHEMA}.{table} (id BIGSERIAL PRIMARY KEY, val TEXT)"
+ ))
.await
.unwrap();
}
async fn seed_table(direct: &Pool<Postgres>, table: &str, n: i64) {
direct
- .execute(
- format!("INSERT INTO {TEST_SCHEMA}.{table} (val) SELECT 'v' || g FROM generate_series(1, {n}) g")
- .as_str(),
- )
+ .execute(unsafe_sql!(
+ "INSERT INTO {TEST_SCHEMA}.{table} (val) SELECT 'v' || g FROM generate_series(1, {n}) g"
+ ))
.await
.unwrap();
}
@@ -44,7 +43,9 @@ fn table_progress(row: &PgRow) -> TaskProgress {
async fn set_parallel_within_table(admin: &Pool<Postgres>, readers: usize) {
admin
- .execute(format!("SET resharding_parallel_within_table_copies TO {readers}").as_str())
+ .execute(unsafe_sql!(
+ "SET resharding_parallel_within_table_copies TO {readers}"
+ ))
.await
.unwrap();
}
@@ -67,12 +68,11 @@ async fn copy_data(parallel_within_table: usize) {
// errors silently leaves the table with its default identity.
direct
.execute(
- format!(
+ unsafe_sql!(
"ALTER TABLE {TEST_SCHEMA}.{TEST_TABLE} ALTER COLUMN val SET NOT NULL;
ALTER TABLE {TEST_SCHEMA}.{TEST_TABLE} ADD CONSTRAINT {secondary_index} UNIQUE (val);
ALTER TABLE {TEST_SCHEMA}.{TEST_TABLE} REPLICA IDENTITY USING INDEX {secondary_index}"
- )
- .as_str(),
+ ),
)
.await
.unwrap();
@@ -80,7 +80,7 @@ async fn copy_data(parallel_within_table: usize) {
create_publication(&direct).await;
let row = admin
- .fetch_one(format!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}").as_str())
+ .fetch_one(unsafe_sql!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}"))
.await
.unwrap();
let task_id: i64 = row.get::<String, _>("task_id").parse().unwrap();
@@ -109,8 +109,7 @@ async fn copy_data(parallel_within_table: usize) {
assert_eq!(identity, "i");
let error = shard
.execute(
- format!("INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (id, val) VALUES (21, 'v1')")
- .as_str(),
+ unsafe_sql!("INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (id, val) VALUES (21, 'v1')"),
)
.await
.unwrap_err();
@@ -136,7 +135,7 @@ async fn test_copy_data_parallel() {
}
/// Runs `seed` to create the rows within the test table that will be copied to the dest.
-async fn copy_seeded(seed: &str, expected: i64) {
+async fn copy_seeded(seed: impl sqlx::SqlSafeStr + Send, expected: i64) {
let direct = connection_sqlx_direct().await;
let admin = admin_sqlx().await;
cleanup(&admin, &direct).await;
@@ -148,8 +147,11 @@ async fn copy_seeded(seed: &str, expected: i64) {
direct.execute(seed).await.unwrap();
create_publication(&direct).await;
- let task_id =
- run_task_command(&admin, &format!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}")).await;
+ let task_id = run_task_command(
+ &admin,
+ unsafe_sql!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}"),
+ )
+ .await;
wait_for_relation_on_shards(&admin, task_id, TEST_TABLE).await;
wait_for_rows_each_shard(&admin, task_id, TEST_TABLE, expected).await;
@@ -170,15 +172,15 @@ async fn test_copy_data_empty_table() {
#[tokio::test]
async fn test_copy_data_leading_dead_blocks() {
- let seed = format!(
+ let seed = unsafe_sql!(
"INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (val) SELECT 'v' || g FROM generate_series(1, 10000) g;
DELETE FROM {TEST_SCHEMA}.{TEST_TABLE} WHERE id <= 5000"
);
- copy_seeded(&seed, 5000).await;
+ copy_seeded(seed, 5000).await;
}
async fn table_checksum(pool: &Pool<Postgres>) -> (i64, String) {
- sqlx::query_as(&format!(
+ sqlx::query_as(unsafe_sql!(
"SELECT count(*), coalesce(sum(hashtextextended(id::text || ':' || val, 0)), 0)::text \
FROM {TEST_SCHEMA}.{TEST_TABLE}"
))
@@ -208,23 +210,20 @@ async fn copy_data_with_concurrent_writes(parallel_within_table: usize) {
let writes = async {
for i in 0..WRITES {
direct
- .execute(
- format!(
- "INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (val) VALUES ('new' || {i});
+ .execute(unsafe_sql!(
+ "INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (val) VALUES ('new' || {i});
UPDATE {TEST_SCHEMA}.{TEST_TABLE} SET val = val || 'x' WHERE id = {};
DELETE FROM {TEST_SCHEMA}.{TEST_TABLE} WHERE id = {}",
- i * 37 % ROW_COUNT + 1,
- i * 101 % ROW_COUNT + 1,
- )
- .as_str(),
- )
+ i * 37 % ROW_COUNT + 1,
+ i * 101 % ROW_COUNT + 1,
+ ))
.await
.unwrap();
}
};
- let command = format!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}");
- let copy = run_task_command(&admin, &command);
+ let command = unsafe_sql!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}");
+ let copy = run_task_command(&admin, command);
let (task_id, ()) = tokio::join!(copy, writes);
let expected = table_checksum(&direct).await;
@@ -274,7 +273,9 @@ async fn test_failed_copy_cancels_siblings_and_rolls_back() {
.collect::<Vec<_>>()
.join(", ");
direct
- .execute(format!("CREATE PUBLICATION {TEST_PUB} FOR TABLE {tables}").as_str())
+ .execute(unsafe_sql!(
+ "CREATE PUBLICATION {TEST_PUB} FOR TABLE {tables}"
+ ))
.await
.unwrap();
@@ -283,16 +284,18 @@ async fn test_failed_copy_cancels_siblings_and_rolls_back() {
let shard = connection_sqlx_direct_db(db).await;
create_table(&shard, &poisoned).await;
shard
- .execute(
- format!("INSERT INTO {TEST_SCHEMA}.{poisoned} (id, val) VALUES (1, 'poison')")
- .as_str(),
- )
+ .execute(unsafe_sql!(
+ "INSERT INTO {TEST_SCHEMA}.{poisoned} (id, val) VALUES (1, 'poison')"
+ ))
.await
.unwrap();
}
- let task_id =
- run_task_command(&admin, &format!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}")).await;
+ let task_id = run_task_command(
+ &admin,
+ unsafe_sql!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}"),
+ )
+ .await;
wait_for_task(&admin, "the copy-data run to fail", |task| {
task.id == Some(task_id) && matches!(task.status, TaskProgress::Error { .. })
diff --git a/integration/rust/tests/integration/admin/resharding/mod.rs b/integration/rust/tests/integration/admin/resharding/mod.rs
index d8f42d7ad..9d76a5adc 100644
--- a/integration/rust/tests/integration/admin/resharding/mod.rs
+++ b/integration/rust/tests/integration/admin/resharding/mod.rs
@@ -29,7 +29,7 @@ const SLOT_FILTER: &str = "slot_name LIKE '__pgdog_repl_%'";
const POLL: Duration = Duration::from_millis(200);
async fn drop_test_schema_on(pool: &Pool<Postgres>) {
- pool.execute(format!("DROP SCHEMA IF EXISTS {TEST_SCHEMA} CASCADE").as_str())
+ pool.execute(unsafe_sql!("DROP SCHEMA IF EXISTS {TEST_SCHEMA} CASCADE"))
.await
.expect("test schema cleanup must succeed");
}
@@ -54,7 +54,7 @@ async fn drain_tasks(admin: &Pool<Postgres>) {
}
if let Some(id) = task.id {
- let _ = admin.execute(format!("STOP_TASK {id}").as_str()).await;
+ let _ = admin.execute(unsafe_sql!("STOP_TASK {id}")).await;
}
}
sleep(POLL).await;
@@ -66,20 +66,17 @@ async fn drain_tasks(admin: &Pool<Postgres>) {
async fn drop_test_slots(direct: &Pool<Postgres>) {
let _ = direct
- .execute(
- format!(
- "SELECT pg_terminate_backend(active_pid) \
+ .execute(unsafe_sql!(
+ "SELECT pg_terminate_backend(active_pid) \
FROM pg_replication_slots \
WHERE ({SLOT_FILTER}) AND active_pid IS NOT NULL"
- )
- .as_str(),
- )
+ ))
.await;
timeout(Duration::from_secs(10), async {
loop {
let any_active = direct
- .fetch_optional(sqlx::query(&format!(
+ .fetch_optional(sqlx::query(unsafe_sql!(
"SELECT bool_or(active) AS active FROM pg_replication_slots WHERE {SLOT_FILTER}"
)))
.await
@@ -97,19 +94,16 @@ async fn drop_test_slots(direct: &Pool<Postgres>) {
.expect("replication slots did not deactivate");
let _ = direct
- .execute(
- format!(
- "SELECT pg_drop_replication_slot(slot_name) \
+ .execute(unsafe_sql!(
+ "SELECT pg_drop_replication_slot(slot_name) \
FROM pg_replication_slots \
WHERE ({SLOT_FILTER}) AND NOT active"
- )
- .as_str(),
- )
+ ))
.await;
}
async fn test_slot_names(pool: &Pool<Postgres>) -> Vec<String> {
- sqlx::query_scalar(&format!(
+ sqlx::query_scalar(unsafe_sql!(
"SELECT slot_name FROM pg_replication_slots WHERE {SLOT_FILTER} ORDER BY slot_name"
))
.fetch_all(pool)
@@ -133,7 +127,7 @@ async fn cleanup(admin: &Pool<Postgres>, direct: &Pool<Postgres>) {
drop_all_test_slots(direct).await;
let _ = direct
- .execute(format!("DROP PUBLICATION IF EXISTS {TEST_PUB}").as_str())
+ .execute(unsafe_sql!("DROP PUBLICATION IF EXISTS {TEST_PUB}"))
.await;
drop_test_schemas(direct).await;
@@ -195,9 +189,9 @@ async fn fail_if_task_errored(admin: &Pool<Postgres>, task_id: i64) {
}
async fn relation_present(pool: &Pool<Postgres>, name: &str) -> bool {
- pool.fetch_one(
- format!("SELECT to_regclass('{TEST_SCHEMA}.{name}') IS NOT NULL AS present").as_str(),
- )
+ pool.fetch_one(unsafe_sql!(
+ "SELECT to_regclass('{TEST_SCHEMA}.{name}') IS NOT NULL AS present"
+ ))
.await
.unwrap()
.get::<bool, _>("present")
@@ -229,10 +223,12 @@ async fn shard_row_count(db: &str, table: &str) -> i64 {
if !relation_present(&pool, table).await {
return 0;
}
- pool.fetch_one(format!("SELECT COUNT(*)::bigint AS n FROM {TEST_SCHEMA}.{table}").as_str())
- .await
- .unwrap()
- .get::<i64, _>("n")
+ pool.fetch_one(unsafe_sql!(
+ "SELECT COUNT(*)::bigint AS n FROM {TEST_SCHEMA}.{table}"
+ ))
+ .await
+ .unwrap()
+ .get::<i64, _>("n")
}
async fn wait_for_rows_each_shard(
@@ -281,14 +277,13 @@ async fn wait_for_task(admin: &Pool<Postgres>, desc: &str, pred: impl Fn(&Task)
async fn create_test_table(direct: &Pool<Postgres>) {
direct
- .execute(format!("CREATE SCHEMA IF NOT EXISTS {TEST_SCHEMA}").as_str())
+ .execute(unsafe_sql!("CREATE SCHEMA IF NOT EXISTS {TEST_SCHEMA}"))
.await
.expect("test schema creation must succeed");
direct
- .execute(
- format!("CREATE TABLE {TEST_SCHEMA}.{TEST_TABLE} (id BIGSERIAL PRIMARY KEY, val TEXT)")
- .as_str(),
- )
+ .execute(unsafe_sql!(
+ "CREATE TABLE {TEST_SCHEMA}.{TEST_TABLE} (id BIGSERIAL PRIMARY KEY, val TEXT)"
+ ))
.await
.unwrap();
}
@@ -296,10 +291,9 @@ async fn create_test_table(direct: &Pool<Postgres>) {
async fn seed_rows(direct: &Pool<Postgres>, n: i64) {
direct
.execute(
- format!(
+ unsafe_sql!(
"INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (val) SELECT 'v' || g FROM generate_series(1, {n}) g"
- )
- .as_str(),
+ ),
)
.await
.unwrap();
@@ -307,14 +301,14 @@ async fn seed_rows(direct: &Pool<Postgres>, n: i64) {
async fn create_publication(direct: &Pool<Postgres>) {
direct
- .execute(
- format!("CREATE PUBLICATION {TEST_PUB} FOR TABLE {TEST_SCHEMA}.{TEST_TABLE}").as_str(),
- )
+ .execute(unsafe_sql!(
+ "CREATE PUBLICATION {TEST_PUB} FOR TABLE {TEST_SCHEMA}.{TEST_TABLE}"
+ ))
.await
.unwrap();
}
-async fn run_task_command(admin: &Pool<Postgres>, command: &str) -> i64 {
+async fn run_task_command(admin: &Pool<Postgres>, command: impl sqlx::SqlSafeStr + Send) -> i64 {
admin
.fetch_one(command)
.await
diff --git a/integration/rust/tests/integration/admin/resharding/replication.rs b/integration/rust/tests/integration/admin/resharding/replication.rs
index 1e398c13b..c746bca4b 100644
--- a/integration/rust/tests/integration/admin/resharding/replication.rs
+++ b/integration/rust/tests/integration/admin/resharding/replication.rs
@@ -25,10 +25,10 @@ pub(super) async fn prepare_replication(admin: &Pool<Postgres>, direct: &Pool<Po
pub(super) async fn start_replication(admin: &Pool<Postgres>, slot: Option<&str>) -> i64 {
let command = match slot {
- Some(slot) => format!("REPLICATE pgdog pgdog_sharded {TEST_PUB} {slot}"),
- None => format!("REPLICATE pgdog pgdog_sharded {TEST_PUB}"),
+ Some(slot) => unsafe_sql!("REPLICATE pgdog pgdog_sharded {TEST_PUB} {slot}"),
+ None => unsafe_sql!("REPLICATE pgdog pgdog_sharded {TEST_PUB}"),
};
- let task_id = run_task_command(admin, &command).await;
+ let task_id = run_task_command(admin, command).await;
wait_for_task(admin, "replication ready", |task| {
task.id == Some(task_id) && task.inner_status == "replicating"
})
@@ -50,7 +50,7 @@ pub(super) async fn wait_for_values(
let shard = connection_sqlx_direct_db(database).await;
poll(&format!("replicated values on {database}"), || async {
fail_if_task_errored(admin, task_id).await;
- let actual = sqlx::query_as::<_, (i64, String)>(&format!(
+ let actual = sqlx::query_as::<_, (i64, String)>(unsafe_sql!(
"SELECT id, val FROM {TEST_SCHEMA}.{TEST_TABLE} ORDER BY id"
))
.fetch_all(&shard)
@@ -74,26 +74,24 @@ async fn test_replicate_streams_changes_without_copying_existing_rows() {
let task_id = start_replication(&admin, None).await;
direct
- .execute(
- format!(
- "INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (id, val) \
+ .execute(unsafe_sql!(
+ "INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (id, val) \
VALUES (2, 'inserted'), (3, 'removed')"
- )
- .as_str(),
- )
+ ))
.await
.expect("source inserts must succeed");
wait_for_values(&admin, task_id, &[(2, "inserted"), (3, "removed")]).await;
direct
- .execute(
- format!("UPDATE {TEST_SCHEMA}.{TEST_TABLE} SET val = 'updated' WHERE id = 2")
- .as_str(),
- )
+ .execute(unsafe_sql!(
+ "UPDATE {TEST_SCHEMA}.{TEST_TABLE} SET val = 'updated' WHERE id = 2"
+ ))
.await
.expect("source update must succeed");
direct
- .execute(format!("DELETE FROM {TEST_SCHEMA}.{TEST_TABLE} WHERE id = 3").as_str())
+ .execute(unsafe_sql!(
+ "DELETE FROM {TEST_SCHEMA}.{TEST_TABLE} WHERE id = 3"
+ ))
.await
.expect("source delete must succeed");
wait_for_values(&admin, task_id, &[(2, "updated")]).await;
@@ -133,7 +131,7 @@ async fn test_stop_task() {
);
let row = admin
- .fetch_one(format!("STOP_TASK {task_id}").as_str())
+ .fetch_one(unsafe_sql!("STOP_TASK {task_id}"))
.await
.unwrap();
assert_eq!(row.get::<String, _>("stop_task"), "OK");
@@ -160,8 +158,11 @@ async fn test_cutover_starts_reverse_replication() {
seed_rows(&direct, 20).await;
create_publication(&direct).await;
- let task_id =
- run_task_command(&admin, &format!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}")).await;
+ let task_id = run_task_command(
+ &admin,
+ unsafe_sql!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}"),
+ )
+ .await;
wait_for_task(&admin, "copy_data replicating", |t| {
t.id == Some(task_id) && t.inner_status == "replicating"
@@ -196,19 +197,16 @@ async fn test_cutover_starts_reverse_replication() {
})
.await;
connections[0]
- .execute(
- format!(
- "INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (id, val) \
+ .execute(unsafe_sql!(
+ "INSERT INTO {TEST_SCHEMA}.{TEST_TABLE} (id, val) \
VALUES (1001, 'written_after_cutover')"
- )
- .as_str(),
- )
+ ))
.await
.expect("writes through the new source must succeed");
for database in ["shard_0", "shard_1"] {
let shard = connection_sqlx_direct_db(database).await;
- let value: String = sqlx::query_scalar(&format!(
+ let value: String = sqlx::query_scalar(unsafe_sql!(
"SELECT val FROM {TEST_SCHEMA}.{TEST_TABLE} WHERE id = 1001"
))
.fetch_one(&shard)
@@ -221,7 +219,7 @@ async fn test_cutover_starts_reverse_replication() {
"the post-cutover row to replicate back to the old source",
|| async {
fail_if_task_errored(&admin, task_id).await;
- let value: Option<String> = sqlx::query_scalar(&format!(
+ let value: Option<String> = sqlx::query_scalar(unsafe_sql!(
"SELECT val FROM {TEST_SCHEMA}.{TEST_TABLE} WHERE id = 1001"
))
.fetch_optional(&direct)
@@ -233,7 +231,7 @@ async fn test_cutover_starts_reverse_replication() {
.await;
admin
- .execute(format!("STOP_TASK {task_id}").as_str())
+ .execute(unsafe_sql!("STOP_TASK {task_id}"))
.await
.expect("the migration task must stop");
wait_for_task_status(&admin, task_id, TaskProgress::Finished).await;
@@ -285,8 +283,11 @@ async fn test_three_cutovers_alternate_the_traffic_target() {
seed_rows(&direct, 20).await;
create_publication(&direct).await;
- let task_id =
- run_task_command(&admin, &format!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}")).await;
+ let task_id = run_task_command(
+ &admin,
+ unsafe_sql!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}"),
+ )
+ .await;
wait_for_task(&admin, "copy_data replicating", |t| {
t.id == Some(task_id) && t.inner_status == "replicating"
@@ -305,7 +306,7 @@ async fn test_three_cutovers_alternate_the_traffic_target() {
fail_if_task_errored(&admin, task_id).await;
admin
- .execute(format!("STOP_TASK {task_id}").as_str())
+ .execute(unsafe_sql!("STOP_TASK {task_id}"))
.await
.expect("the migration task must stop");
wait_for_task_status(&admin, task_id, TaskProgress::Finished).await;
diff --git a/integration/rust/tests/integration/admin/resharding/replication_slots.rs b/integration/rust/tests/integration/admin/resharding/replication_slots.rs
index a23571d5e..a1bd7f1e9 100644
--- a/integration/rust/tests/integration/admin/resharding/replication_slots.rs
+++ b/integration/rust/tests/integration/admin/resharding/replication_slots.rs
@@ -94,7 +94,7 @@ async fn test_show_replication_slots_tracks_named_stream_until_stopped() {
assert!(row.get::<Option<i64>, _>("task_id").is_some());
admin
- .execute(format!("STOP_TASK {task_id}").as_str())
+ .execute(unsafe_sql!("STOP_TASK {task_id}"))
.await
.expect("replication stop must succeed");
wait_for_task_status(&admin, task_id, TaskProgress::Cancelled).await;
diff --git a/integration/rust/tests/integration/admin/resharding/resharding.rs b/integration/rust/tests/integration/admin/resharding/resharding.rs
index 3e16e7b72..2e90bc5c2 100644
--- a/integration/rust/tests/integration/admin/resharding/resharding.rs
+++ b/integration/rust/tests/integration/admin/resharding/resharding.rs
@@ -21,8 +21,11 @@ async fn test_reshard() {
seed_rows(&direct, 20).await;
create_publication(&direct).await;
- let task_id =
- run_task_command(&admin, &format!("RESHARD pgdog pgdog_sharded {TEST_PUB}")).await;
+ let task_id = run_task_command(
+ &admin,
+ unsafe_sql!("RESHARD pgdog pgdog_sharded {TEST_PUB}"),
+ )
+ .await;
wait_for_task(&admin, "reshard task", |t| {
t.id == Some(task_id) && t.kind == "reshard"
@@ -41,7 +44,7 @@ async fn test_reshard() {
})
.await;
- let _ = admin.execute(format!("STOP_TASK {task_id}").as_str()).await;
+ let _ = admin.execute(unsafe_sql!("STOP_TASK {task_id}")).await;
timeout(Duration::from_secs(30), async {
loop {
if Tasks::fetch(&admin).await.find(task_id).is_some_and(|t| {
diff --git a/integration/rust/tests/integration/admin/resharding/schema_sync.rs b/integration/rust/tests/integration/admin/resharding/schema_sync.rs
index b1c593aff..abf75e0f0 100644
--- a/integration/rust/tests/integration/admin/resharding/schema_sync.rs
+++ b/integration/rust/tests/integration/admin/resharding/schema_sync.rs
@@ -131,7 +131,7 @@ async fn assert_schema_sync_rows(admin: &Pool<Postgres>, task_id: i64, sync_stat
}
async fn create_validation_schema(direct: &Pool<Postgres>) {
- let script = format!(
+ let script = unsafe_sql!(
"CREATE SCHEMA {TEST_SCHEMA};
CREATE TABLE {TEST_SCHEMA}.{VALIDATION_PARENT} (id BIGINT PRIMARY KEY);
@@ -160,13 +160,13 @@ async fn create_validation_schema(direct: &Pool<Postgres>) {
{TEST_SCHEMA}.{VALIDATION_UNCHECKED_CHILD};"
);
- direct.execute(script.as_str()).await.unwrap();
+ direct.execute(script).await.unwrap();
}
async fn run_schema_sync_phase(admin: &Pool<Postgres>, phase: &str) -> i64 {
let task_id = run_task_command(
admin,
- &format!("SCHEMA_SYNC {phase} pgdog pgdog_sharded {TEST_PUB}"),
+ unsafe_sql!("SCHEMA_SYNC {phase} pgdog pgdog_sharded {TEST_PUB}"),
)
.await;
wait_for_task_status(admin, task_id, TaskProgress::Finished).await;
@@ -229,7 +229,7 @@ async fn test_schema_sync_pre() {
let task_id = run_task_command(
&admin,
- &format!("SCHEMA_SYNC pre pgdog pgdog_sharded {TEST_PUB}"),
+ unsafe_sql!("SCHEMA_SYNC pre pgdog pgdog_sharded {TEST_PUB}"),
)
.await;
@@ -257,12 +257,9 @@ async fn test_schema_sync_post() {
for database in ["shard_0", "shard_1"] {
let shard = connection_sqlx_direct_db(database).await;
let error = shard
- .execute(
- format!(
- "INSERT INTO {TEST_SCHEMA}.{VALIDATION_CHILD} (id, parent_id) VALUES (1, 42)"
- )
- .as_str(),
- )
+ .execute(unsafe_sql!(
+ "INSERT INTO {TEST_SCHEMA}.{VALIDATION_CHILD} (id, parent_id) VALUES (1, 42)"
+ ))
.await
.unwrap_err();
assert_eq!(
@@ -309,12 +306,9 @@ async fn test_schema_sync_validation_rejects_existing_orphan() {
let shard = connection_sqlx_direct_db("shard_0").await;
shard
- .execute(
- format!(
- "INSERT INTO {TEST_SCHEMA}.{VALIDATION_CHILD} (id, parent_id) VALUES (1, 42)"
- )
- .as_str(),
- )
+ .execute(unsafe_sql!(
+ "INSERT INTO {TEST_SCHEMA}.{VALIDATION_CHILD} (id, parent_id) VALUES (1, 42)"
+ ))
.await
.unwrap();
@@ -322,7 +316,7 @@ async fn test_schema_sync_validation_rejects_existing_orphan() {
let task_id = run_task_command(
&admin,
- &format!("SCHEMA_SYNC post-data-validation pgdog pgdog_sharded {TEST_PUB}"),
+ unsafe_sql!("SCHEMA_SYNC post-data-validation pgdog pgdog_sharded {TEST_PUB}"),
)
.await;
let failure = wait_for_validation_failure(&admin, task_id).await;
diff --git a/integration/rust/tests/integration/admin/resharding/table_copies.rs b/integration/rust/tests/integration/admin/resharding/table_copies.rs
index 689d29c3e..9d0a0826d 100644
--- a/integration/rust/tests/integration/admin/resharding/table_copies.rs
+++ b/integration/rust/tests/integration/admin/resharding/table_copies.rs
@@ -77,13 +77,16 @@ async fn test_show_table_copies_during_copy() {
create_test_table(&direct).await;
seed_rows(&direct, SEEDED_ROWS).await;
direct
- .execute(format!("ANALYZE {TEST_SCHEMA}.{TEST_TABLE}").as_str())
+ .execute(unsafe_sql!("ANALYZE {TEST_SCHEMA}.{TEST_TABLE}"))
.await
.unwrap();
create_publication(&direct).await;
- let task_id =
- run_task_command(&admin, &format!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}")).await;
+ let task_id = run_task_command(
+ &admin,
+ unsafe_sql!("COPY_DATA pgdog pgdog_sharded {TEST_PUB}"),
+ )
+ .await;
wait_for_task(&admin, "the copy_data child task", |task| {
task.parent_id == Some(task_id) && task.kind == "copy_data"
diff --git a/integration/rust/tests/integration/admin_termination.rs b/integration/rust/tests/integration/admin_termination.rs
index 1d4e22127..9f5addf4c 100644
--- a/integration/rust/tests/integration/admin_termination.rs
+++ b/integration/rust/tests/integration/admin_termination.rs
@@ -58,7 +58,10 @@ async fn test_admin_termination_retry() {
// Terminate one of the backend connections
let pid_to_terminate = pids[0];
admin_pool
- .execute(format!("SELECT pg_terminate_backend({})", pid_to_terminate).as_str())
+ .execute(unsafe_sql!(
+ "SELECT pg_terminate_backend({})",
+ pid_to_terminate
+ ))
.await
.unwrap();
@@ -70,9 +73,7 @@ async fn test_admin_termination_retry() {
// 2. Discard it and fetch another connection
// 3. Return a working connection to the client
for i in 0..10 {
- let result = pool
- .fetch_one(format!("SELECT {} as num", i).as_str())
- .await;
+ let result = pool.fetch_one(unsafe_sql!("SELECT {} as num", i)).await;
// The query should succeed - PgDog should transparently handle the terminated connection
assert!(
diff --git a/integration/rust/tests/integration/advisory_locks.rs b/integration/rust/tests/integration/advisory_locks.rs
index f3b098e4b..421b64c02 100644
--- a/integration/rust/tests/integration/advisory_locks.rs
+++ b/integration/rust/tests/integration/advisory_locks.rs
@@ -20,13 +20,13 @@ pub async fn advisory_locks_with_functions() {
];
for func_to_try in funcs {
- sqlx::raw_sql(format!("SELECT pg_advisory_lock({func_to_try})").as_str())
+ sqlx::raw_sql(unsafe_sql!("SELECT pg_advisory_lock({func_to_try})"))
.execute(sharded_conn)
.await
.unwrap();
let lock_acquired: bool =
- sqlx::query_scalar(format!("SELECT pg_try_advisory_lock({func_to_try})").as_str())
+ sqlx::query_scalar(unsafe_sql!("SELECT pg_try_advisory_lock({func_to_try})"))
.fetch_one(sharded_conn_2)
.await
.unwrap();
@@ -45,13 +45,13 @@ pub async fn advisory_locks_with_2_params() {
let funcs = ["1, 2", "2, 1"];
for func_to_try in funcs {
- sqlx::raw_sql(format!("SELECT pg_advisory_lock({func_to_try})").as_str())
+ sqlx::raw_sql(unsafe_sql!("SELECT pg_advisory_lock({func_to_try})"))
.execute(sharded_conn)
.await
.unwrap();
let lock_acquired: bool =
- sqlx::query_scalar(format!("SELECT pg_try_advisory_lock({func_to_try})").as_str())
+ sqlx::query_scalar(unsafe_sql!("SELECT pg_try_advisory_lock({func_to_try})"))
.fetch_one(sharded_conn_2)
.await
.unwrap();
@@ -120,7 +120,7 @@ pub async fn advisory_locks_with_transactions() {
for lock in [1, 2] {
let lock_acquired: bool =
- sqlx::query_scalar(format!("SELECT pg_try_advisory_lock({lock})").as_str())
+ sqlx::query_scalar(unsafe_sql!("SELECT pg_try_advisory_lock({lock})"))
.fetch_one(sharded_conn_3)
.await
.unwrap();
@@ -134,7 +134,7 @@ pub async fn advisory_locks_unlock_all() {
let sharded_conn = connections_sqlx().await;
let sharded_conn = sharded_conn.get(1).unwrap();
for lock in [1, 2] {
- sqlx::raw_sql(format!("SELECT pg_advisory_lock({lock})").as_str())
+ sqlx::raw_sql(unsafe_sql!("SELECT pg_advisory_lock({lock})"))
.execute(sharded_conn)
.await
.unwrap();
@@ -151,7 +151,7 @@ pub async fn advisory_locks_unlock_all() {
for lock in [1, 2] {
let lock_acquired: bool =
- sqlx::query_scalar(format!("SELECT pg_try_advisory_lock({lock})").as_str())
+ sqlx::query_scalar(unsafe_sql!("SELECT pg_try_advisory_lock({lock})"))
.fetch_one(sharded_conn_2)
.await
.unwrap();
@@ -171,7 +171,7 @@ pub async fn advisory_locks_catalog_table() {
let sharded_conn = connections_sqlx().await;
let sharded_conn = sharded_conn.get(1).unwrap();
for lock in [1, 2] {
- sqlx::raw_sql(format!("SELECT pg_advisory_lock({lock})").as_str())
+ sqlx::raw_sql(unsafe_sql!("SELECT pg_advisory_lock({lock})"))
.execute(sharded_conn)
.await
.unwrap();
diff --git a/integration/rust/tests/integration/auth.rs b/integration/rust/tests/integration/auth.rs
index 71702ab8f..6834a7ecf 100644
--- a/integration/rust/tests/integration/auth.rs
+++ b/integration/rust/tests/integration/auth.rs
@@ -13,7 +13,7 @@ async fn test_auth_types() {
for auth_type in ["md5", "scram", "plain", "trust"] {
admin
- .execute(format!("SET auth_type TO '{auth_type}'").as_str())
+ .execute(unsafe_sql!("SET auth_type TO '{auth_type}'"))
.await
.unwrap();
assert_setting_str("auth_type", auth_type).await;
@@ -178,7 +178,7 @@ async fn test_multiple_passwords() {
// by every password-based auth type.
for auth_type in ["md5", "scram", "plain"] {
admin
- .execute(format!("SET auth_type TO '{auth_type}'").as_str())
+ .execute(unsafe_sql!("SET auth_type TO '{auth_type}'"))
.await
.unwrap();
assert_setting_str("auth_type", auth_type).await;
@@ -220,7 +220,7 @@ async fn test_multiple_passwords_server_side() {
// password should succeed.
for auth_type in ["md5", "scram", "plain"] {
admin
- .execute(format!("SET auth_type TO '{auth_type}'").as_str())
+ .execute(unsafe_sql!("SET auth_type TO '{auth_type}'"))
.await
.unwrap();
assert_setting_str("auth_type", auth_type).await;
diff --git a/integration/rust/tests/integration/auto_id.rs b/integration/rust/tests/integration/auto_id.rs
index 8ab9a6a08..bea2a2456 100644
--- a/integration/rust/tests/integration/auto_id.rs
+++ b/integration/rust/tests/integration/auto_id.rs
@@ -6,19 +6,16 @@ use sqlx::{Executor, Pool, Postgres};
const AUTO_ID_TABLE: &str = "auto_id_test";
async fn prepare_auto_id_table(pool: &Pool<Postgres>, admin: &Pool<Postgres>) {
- pool.execute(format!("DROP TABLE IF EXISTS {AUTO_ID_TABLE}").as_str())
+ pool.execute(unsafe_sql!("DROP TABLE IF EXISTS {AUTO_ID_TABLE}"))
.await
.unwrap();
- pool.execute(
- format!(
- "CREATE TABLE {AUTO_ID_TABLE} (
+ pool.execute(unsafe_sql!(
+ "CREATE TABLE {AUTO_ID_TABLE} (
id BIGINT PRIMARY KEY,
customer_id BIGINT NOT NULL,
name TEXT
)"
- )
- .as_str(),
- )
+ ))
.await
.unwrap();
// Enable rewrites and reload config so schema is picked up
@@ -27,7 +24,7 @@ async fn prepare_auto_id_table(pool: &Pool<Postgres>, admin: &Pool<Postgres>) {
}
async fn cleanup_auto_id_table(pool: &Pool<Postgres>) {
- pool.execute(format!("DROP TABLE IF EXISTS {AUTO_ID_TABLE}").as_str())
+ pool.execute(unsafe_sql!("DROP TABLE IF EXISTS {AUTO_ID_TABLE}"))
.await
.ok();
admin_sqlx().await.execute("RELOAD").await.unwrap();
@@ -47,7 +44,7 @@ async fn test_auto_id_rewrite_mode_injects_id() {
.unwrap();
// Use unique values to avoid AST cache collision with other tests
- let result = sqlx::query(&format!(
+ let result = sqlx::query(unsafe_sql!(
"INSERT INTO {AUTO_ID_TABLE} (customer_id, name) VALUES (100, 'rewrite_test')"
))
.execute(&pool)
@@ -59,7 +56,7 @@ async fn test_auto_id_rewrite_mode_injects_id() {
result.err()
);
- let row: (i64, i64, String) = sqlx::query_as(&format!(
+ let row: (i64, i64, String) = sqlx::query_as(unsafe_sql!(
"SELECT id, customer_id, name FROM {AUTO_ID_TABLE} WHERE customer_id = 100"
))
.fetch_one(&pool)
@@ -82,7 +79,7 @@ async fn test_auto_id_error_mode_rejects_missing_pk() {
prepare_auto_id_table(&pool, &admin).await;
// Verify table exists and has expected structure
- let check: (i64,) = sqlx::query_as(&format!(
+ let check: (i64,) = sqlx::query_as(unsafe_sql!(
"SELECT COUNT(*) FROM information_schema.columns WHERE table_name = '{}'",
AUTO_ID_TABLE
))
@@ -101,7 +98,7 @@ async fn test_auto_id_error_mode_rejects_missing_pk() {
.unwrap();
// Use unique values to avoid AST cache collision with other tests
- let err = sqlx::query(&format!(
+ let err = sqlx::query(unsafe_sql!(
"INSERT INTO {AUTO_ID_TABLE} (customer_id, name) VALUES (200, 'error_test')"
))
.execute(&pool)
@@ -135,7 +132,7 @@ async fn test_auto_id_ignore_mode_allows_missing_pk() {
// Use unique values to avoid AST cache collision with other tests
// Insert without 'id' - should fail at DB level (NOT NULL from PRIMARY KEY)
- let err = sqlx::query(&format!(
+ let err = sqlx::query(unsafe_sql!(
"INSERT INTO {AUTO_ID_TABLE} (customer_id, name) VALUES (300, 'ignore_test')"
))
.execute(&pool)
@@ -166,7 +163,7 @@ async fn test_auto_id_with_explicit_pk_no_injection() {
.unwrap();
// Use unique values to avoid AST cache collision with other tests
- let result = sqlx::query(&format!(
+ let result = sqlx::query(unsafe_sql!(
"INSERT INTO {AUTO_ID_TABLE} (id, customer_id, name) VALUES (42, 400, 'explicit_test')"
))
.execute(&pool)
@@ -178,7 +175,7 @@ async fn test_auto_id_with_explicit_pk_no_injection() {
result.err()
);
- let row: (i64, i64, String) = sqlx::query_as(&format!(
+ let row: (i64, i64, String) = sqlx::query_as(unsafe_sql!(
"SELECT id, customer_id, name FROM {AUTO_ID_TABLE} WHERE id = 42"
))
.fetch_one(&pool)
@@ -210,7 +207,7 @@ async fn test_auto_id_multi_row_insert() {
.unwrap();
// Use unique values to avoid AST cache collision with other tests
- let result = sqlx::query(&format!(
+ let result = sqlx::query(unsafe_sql!(
"INSERT INTO {AUTO_ID_TABLE} (customer_id, name) VALUES (500, 'multi_first'), (500, 'multi_second')"
))
.execute(&pool)
@@ -222,7 +219,7 @@ async fn test_auto_id_multi_row_insert() {
result.err()
);
- let rows: Vec<(i64, i64, String)> = sqlx::query_as(&format!(
+ let rows: Vec<(i64, i64, String)> = sqlx::query_as(unsafe_sql!(
"SELECT id, customer_id, name FROM {AUTO_ID_TABLE} WHERE customer_id = 500 ORDER BY name"
))
.fetch_all(&pool)
@@ -253,7 +250,7 @@ async fn test_auto_id_default_replaced_with_unique_id() {
.unwrap();
// Insert with DEFAULT as primary key value - should be replaced with unique_id
- let result = sqlx::query(&format!(
+ let result = sqlx::query(unsafe_sql!(
"INSERT INTO {AUTO_ID_TABLE} (id, customer_id, name) VALUES (DEFAULT, 600, 'default_test')"
))
.execute(&pool)
@@ -265,7 +262,7 @@ async fn test_auto_id_default_replaced_with_unique_id() {
result.err()
);
- let row: (i64, i64, String) = sqlx::query_as(&format!(
+ let row: (i64, i64, String) = sqlx::query_as(unsafe_sql!(
"SELECT id, customer_id, name FROM {AUTO_ID_TABLE} WHERE customer_id = 600"
))
.fetch_one(&pool)
diff --git a/integration/rust/tests/integration/avg.rs b/integration/rust/tests/integration/avg.rs
index 50bb665d4..739e4448d 100644
--- a/integration/rust/tests/integration/avg.rs
+++ b/integration/rust/tests/integration/avg.rs
@@ -8,19 +8,19 @@ async fn avg_merges_with_helper_count() -> Result<(), Box<dyn std::error::Error>
// Ensure clean state on each shard.
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ DROP TABLE IF EXISTS avg_reduce_test",
shard
);
- sharded.execute(comment.as_str()).await.ok();
+ sharded.execute(comment).await.ok();
}
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ CREATE TABLE avg_reduce_test(price DOUBLE PRECISION, customer_id BIGINT)",
shard
);
- sharded.execute(comment.as_str()).await?;
+ sharded.execute(comment).await?;
}
// Make sure sharded table is loaded in schema.
@@ -53,8 +53,8 @@ async fn avg_merges_with_helper_count() -> Result<(), Box<dyn std::error::Error>
// Cleanup tables per shard.
for shard in [0, 1] {
- let comment = format!("/* pgdog_shard: {} */ DROP TABLE avg_reduce_test", shard);
- sharded.execute(comment.as_str()).await.ok();
+ let comment = unsafe_sql!("/* pgdog_shard: {} */ DROP TABLE avg_reduce_test", shard);
+ sharded.execute(comment).await.ok();
}
Ok(())
@@ -67,19 +67,19 @@ async fn avg_without_helper_should_still_merge() -> Result<(), Box<dyn std::erro
// Clean slate on each shard.
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ DROP TABLE IF EXISTS avg_rewrite_expectation",
shard
);
- sharded.execute(comment.as_str()).await.ok();
+ sharded.execute(comment).await.ok();
}
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ CREATE TABLE avg_rewrite_expectation(price DOUBLE PRECISION, customer_id BIGINT)",
shard
);
- sharded.execute(comment.as_str()).await?;
+ sharded.execute(comment).await?;
}
admin_sqlx().await.execute("RELOAD").await?;
@@ -141,19 +141,19 @@ async fn avg_multiple_columns_should_merge() -> Result<(), Box<dyn std::error::E
let sharded = conns.get(1).cloned().unwrap();
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ DROP TABLE IF EXISTS avg_multi_column",
shard
);
- sharded.execute(comment.as_str()).await.ok();
+ sharded.execute(comment).await.ok();
}
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ CREATE TABLE avg_multi_column(price DOUBLE PRECISION, discount DOUBLE PRECISION, customer_id BIGINT)",
shard
);
- sharded.execute(comment.as_str()).await?;
+ sharded.execute(comment).await?;
}
admin_sqlx().await.execute("RELOAD").await?;
@@ -216,8 +216,8 @@ async fn avg_multiple_columns_should_merge() -> Result<(), Box<dyn std::error::E
);
for shard in [0, 1] {
- let comment = format!("/* pgdog_shard: {} */ DROP TABLE avg_multi_column", shard);
- sharded.execute(comment.as_str()).await.ok();
+ let comment = unsafe_sql!("/* pgdog_shard: {} */ DROP TABLE avg_multi_column", shard);
+ sharded.execute(comment).await.ok();
}
Ok(())
@@ -229,19 +229,19 @@ async fn avg_prepared_statement_should_merge() -> Result<(), Box<dyn std::error:
let sharded = conns.get(1).cloned().unwrap();
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ DROP TABLE IF EXISTS avg_prepared_params",
shard
);
- sharded.execute(comment.as_str()).await.ok();
+ sharded.execute(comment).await.ok();
}
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ CREATE TABLE avg_prepared_params(price DOUBLE PRECISION, customer_id BIGINT)",
shard
);
- sharded.execute(comment.as_str()).await?;
+ sharded.execute(comment).await?;
}
admin_sqlx().await.execute("RELOAD").await?;
@@ -293,11 +293,11 @@ async fn avg_prepared_statement_should_merge() -> Result<(), Box<dyn std::error:
);
for shard in [0, 1] {
- let comment = format!(
+ let comment = unsafe_sql!(
"/* pgdog_shard: {} */ DROP TABLE avg_prepared_params",
shard
);
- sharded.execute(comment.as_str()).await.ok();
+ sharded.execute(comment).await.ok();
}
Ok(())
diff --git a/integration/rust/tests/integration/ban.rs b/integration/rust/tests/integration/ban.rs
index baaf77541..6ca56a0db 100644
--- a/integration/rust/tests/integration/ban.rs
+++ b/integration/rust/tests/integration/ban.rs
@@ -17,12 +17,9 @@ async fn ban_unban(database: &str, ban: bool, replica: bool) {
.unwrap();
if !ban {
- admin
- .execute(format!("UNBAN {}", id).as_str())
- .await
- .unwrap();
+ admin.execute(unsafe_sql!("UNBAN {}", id)).await.unwrap();
} else {
- admin.execute(format!("BAN {}", id).as_str()).await.unwrap();
+ admin.execute(unsafe_sql!("BAN {}", id)).await.unwrap();
}
}
diff --git a/integration/rust/tests/integration/cache_bench.rs b/integration/rust/tests/integration/cache_bench.rs
index 5da9a1fa1..6684c825b 100644
--- a/integration/rust/tests/integration/cache_bench.rs
+++ b/integration/rust/tests/integration/cache_bench.rs
@@ -8,7 +8,7 @@ async fn test_cache_bench() {
.unwrap();
for i in 0..10_000 {
- let query = format!(
+ let query = unsafe_sql!(
r#"SELECT
a.aid,
a.bid,
@@ -152,7 +152,7 @@ async fn test_cache_bench() {
"#,
i
);
- let stmt = conn.prepare(&query).await.unwrap();
+ let stmt = conn.prepare(query).await.unwrap();
stmt.query().execute(&mut conn).await.unwrap();
}
}
diff --git a/integration/rust/tests/integration/connection_recovery.rs b/integration/rust/tests/integration/connection_recovery.rs
index 270da31a2..c4840e9b2 100644
--- a/integration/rust/tests/integration/connection_recovery.rs
+++ b/integration/rust/tests/integration/connection_recovery.rs
@@ -57,11 +57,11 @@ async fn ban_pools(database: &str) {
let (primary_id, replica_id) = get_pool_ids(database).await;
admin
- .execute(format!("BAN {}", primary_id).as_str())
+ .execute(unsafe_sql!("BAN {}", primary_id))
.await
.unwrap();
admin
- .execute(format!("BAN {}", replica_id).as_str())
+ .execute(unsafe_sql!("BAN {}", replica_id))
.await
.unwrap();
}
@@ -71,11 +71,11 @@ async fn unban_pools(database: &str) {
let (primary_id, replica_id) = get_pool_ids(database).await;
admin
- .execute(format!("UNBAN {}", primary_id).as_str())
+ .execute(unsafe_sql!("UNBAN {}", primary_id))
.await
.unwrap();
admin
- .execute(format!("UNBAN {}", replica_id).as_str())
+ .execute(unsafe_sql!("UNBAN {}", replica_id))
.await
.unwrap();
}
diff --git a/integration/rust/tests/integration/cross_shard_disabled.rs b/integration/rust/tests/integration/cross_shard_disabled.rs
index 627722dc5..d23c99a43 100644
--- a/integration/rust/tests/integration/cross_shard_disabled.rs
+++ b/integration/rust/tests/integration/cross_shard_disabled.rs
@@ -101,7 +101,7 @@ async fn test_cross_shard_disabled_with_unknown_sharding_key() {
conn.execute("BEGIN").await.unwrap();
- conn.execute(format!("SET pgdog.sharding_key TO '{}'", 25).as_str())
+ conn.execute(unsafe_sql!("SET pgdog.sharding_key TO '{}'", 25))
.await
.unwrap();
diff --git a/integration/rust/tests/integration/having.rs b/integration/rust/tests/integration/having.rs
index eb6a81a30..1336e82e8 100644
--- a/integration/rust/tests/integration/having.rs
+++ b/integration/rust/tests/integration/having.rs
@@ -143,13 +143,10 @@ async fn prepared_having_parameter_typed_and_untyped() -> Result<(), Box<dyn std
async fn reset_table(pool: &PgPool) -> Result<(), sqlx::Error> {
cleanup(pool).await;
for shard in [0, 1] {
- pool.execute(
- format!(
- "/* pgdog_shard: {shard} */ \
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {shard} */ \
CREATE TABLE having_merge_test(customer_id BIGINT, order_id BIGINT, tag JSONB)"
- )
- .as_str(),
- )
+ ))
.await?;
}
admin_sqlx().await.execute("RELOAD").await?;
@@ -157,16 +154,16 @@ async fn reset_table(pool: &PgPool) -> Result<(), sqlx::Error> {
}
async fn seed(pool: &PgPool, shard: usize, statement: &str) -> Result<(), sqlx::Error> {
- pool.execute(format!("/* pgdog_shard: {shard} */ {statement}").as_str())
+ pool.execute(unsafe_sql!("/* pgdog_shard: {shard} */ {statement}"))
.await?;
Ok(())
}
async fn cleanup(pool: &PgPool) {
for shard in [0, 1] {
- pool.execute(
- format!("/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS having_merge_test").as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS having_merge_test"
+ ))
.await
.ok();
}
diff --git a/integration/rust/tests/integration/limit.rs b/integration/rust/tests/integration/limit.rs
index 35fc04ca1..5bab9497c 100644
--- a/integration/rust/tests/integration/limit.rs
+++ b/integration/rust/tests/integration/limit.rs
@@ -11,17 +11,14 @@ async fn limit_without_order_by_across_shards() -> Result<(), Box<dyn std::error
// Guarantee five rows on each shard so a per-shard LIMIT exceeds the global limit.
for shard in [0, 1] {
transaction
- .execute(
- format!(
- "/* pgdog_shard: {shard} */ INSERT INTO sharded (id) VALUES (1), (2), (3), (4), (5)"
- )
- .as_str(),
- )
+ .execute(unsafe_sql!(
+ "/* pgdog_shard: {shard} */ INSERT INTO sharded (id) VALUES (1), (2), (3), (4), (5)"
+ ))
.await?;
}
for (limit, expected) in [(5_i64, 5), (0, 0), (100, 10)] {
- let rows = sqlx::raw_sql(&format!("SELECT id FROM sharded LIMIT {limit}"))
+ let rows = sqlx::raw_sql(unsafe_sql!("SELECT id FROM sharded LIMIT {limit}"))
.fetch_all(&mut *transaction)
.await?;
assert_eq!(rows.len(), expected, "simple protocol LIMIT {limit}");
@@ -90,24 +87,21 @@ async fn limit_across_shards() -> Result<(), Box<dyn std::error::Error>> {
async fn reset_table(pool: &PgPool, table: &str, schema: &str) -> Result<(), sqlx::Error> {
for shard in [0, 1] {
- pool.execute(
- format!(
- "/* pgdog_shard: {} */ DROP TABLE IF EXISTS {}",
- shard, table
- )
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ DROP TABLE IF EXISTS {}",
+ shard,
+ table
+ ))
.await
.ok();
}
for shard in [0, 1] {
- pool.execute(
- format!(
- "/* pgdog_shard: {} */ CREATE TABLE {} {}",
- shard, table, schema
- )
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ CREATE TABLE {} {}",
+ shard,
+ table,
+ schema
+ ))
.await?;
}
admin_sqlx().await.execute("RELOAD").await?;
@@ -115,15 +109,19 @@ async fn reset_table(pool: &PgPool, table: &str, schema: &str) -> Result<(), sql
}
async fn seed(pool: &PgPool, shard: usize, stmt: &str) -> Result<(), sqlx::Error> {
- pool.execute(format!("/* pgdog_shard: {} */ {}", shard, stmt).as_str())
+ pool.execute(unsafe_sql!("/* pgdog_shard: {} */ {}", shard, stmt))
.await?;
Ok(())
}
async fn cleanup(pool: &PgPool, table: &str) {
for shard in [0, 1] {
- pool.execute(format!("/* pgdog_shard: {} */ DROP TABLE {}", shard, table).as_str())
- .await
- .ok();
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ DROP TABLE {}",
+ shard,
+ table
+ ))
+ .await
+ .ok();
}
}
diff --git a/integration/rust/tests/integration/maintenance_mode.rs b/integration/rust/tests/integration/maintenance_mode.rs
index 80eff213f..fccf4caaa 100644
--- a/integration/rust/tests/integration/maintenance_mode.rs
+++ b/integration/rust/tests/integration/maintenance_mode.rs
@@ -85,7 +85,7 @@ async fn test_maintenance_mode_multiple_cycles() {
admin.simple_query("MAINTENANCE OFF").await.unwrap();
// Connection should work when maintenance is off
- conn.execute(format!("SELECT {}", i * 2 + 1).as_str())
+ conn.execute(unsafe_sql!("SELECT {}", i * 2 + 1))
.await
.unwrap();
@@ -94,7 +94,7 @@ async fn test_maintenance_mode_multiple_cycles() {
admin.simple_query("MAINTENANCE OFF").await.unwrap();
// Connection should work after maintenance is turned off
- conn.execute(format!("SELECT {}", i * 2 + 2).as_str())
+ conn.execute(unsafe_sql!("SELECT {}", i * 2 + 2))
.await
.unwrap();
}
diff --git a/integration/rust/tests/integration/max.rs b/integration/rust/tests/integration/max.rs
index 89d2ba300..109054daf 100644
--- a/integration/rust/tests/integration/max.rs
+++ b/integration/rust/tests/integration/max.rs
@@ -241,24 +241,21 @@ async fn max_timestamptz() -> Result<(), Box<dyn std::error::Error>> {
async fn reset_table(pool: &PgPool, table: &str, schema: &str) -> Result<(), sqlx::Error> {
for shard in [0, 1] {
- pool.execute(
- format!(
- "/* pgdog_shard: {} */ DROP TABLE IF EXISTS {}",
- shard, table
- )
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ DROP TABLE IF EXISTS {}",
+ shard,
+ table
+ ))
.await
.ok();
}
for shard in [0, 1] {
- pool.execute(
- format!(
- "/* pgdog_shard: {} */ CREATE TABLE {} {}",
- shard, table, schema
- )
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ CREATE TABLE {} {}",
+ shard,
+ table,
+ schema
+ ))
.await?;
}
admin_sqlx().await.execute("RELOAD").await?;
@@ -266,16 +263,20 @@ async fn reset_table(pool: &PgPool, table: &str, schema: &str) -> Result<(), sql
}
async fn seed(pool: &PgPool, shard: usize, stmt: &str) -> Result<(), sqlx::Error> {
- pool.execute(format!("/* pgdog_shard: {} */ {}", shard, stmt).as_str())
+ pool.execute(unsafe_sql!("/* pgdog_shard: {} */ {}", shard, stmt))
.await?;
Ok(())
}
async fn cleanup(pool: &PgPool, table: &str) {
for shard in [0, 1] {
- pool.execute(format!("/* pgdog_shard: {} */ DROP TABLE {}", shard, table).as_str())
- .await
- .ok();
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ DROP TABLE {}",
+ shard,
+ table
+ ))
+ .await
+ .ok();
}
}
@@ -283,8 +284,8 @@ async fn combined_max(table: &str, column: &str) -> Result<f64, sqlx::Error> {
let mut max_val: Option<f64> = None;
for url in SHARD_URLS {
let mut conn = PgConnection::connect(url).await?;
- let query = format!("SELECT MAX({})::float8 FROM {}", column, table);
- let val: Option<f64> = sqlx::query_scalar(&query).fetch_one(&mut conn).await?;
+ let query = unsafe_sql!("SELECT MAX({})::float8 FROM {}", column, table);
+ let val: Option<f64> = sqlx::query_scalar(query).fetch_one(&mut conn).await?;
if let Some(v) = val {
max_val = Some(max_val.map_or(v, |m| m.max(v)));
}
diff --git a/integration/rust/tests/integration/non_deterministic_funcs.rs b/integration/rust/tests/integration/non_deterministic_funcs.rs
index afc0a98c0..3d8eff730 100644
--- a/integration/rust/tests/integration/non_deterministic_funcs.rs
+++ b/integration/rust/tests/integration/non_deterministic_funcs.rs
@@ -187,7 +187,7 @@ async fn transaction_time_select_equality() {
/// Helper method to run a query twice, in one transaction, in both simple and extended protocol,
/// and assert that the response is equal (and of the correct type)
-async fn run_and_assert_eq<T>(query: &str, col: &str)
+async fn run_and_assert_eq<T>(query: &'static str, col: &str)
where
T: PartialEq
+ std::fmt::Debug
@@ -670,29 +670,25 @@ async fn test_simple_extended_and_prepare(
.await
.unwrap();
- let row1 = sqlx::raw_sql(
- format!("INSERT INTO dummy_omni_table(id, {cols}) VALUES (1, {vals}) RETURNING *").as_str(),
- )
+ let row1 = sqlx::raw_sql(unsafe_sql!(
+ "INSERT INTO dummy_omni_table(id, {cols}) VALUES (1, {vals}) RETURNING *"
+ ))
.fetch_one(&mut *transaction)
.await
.unwrap();
// By putting the Bind parameter first, it forces us to use the Binary text format, testing vs the already tested String.
- let row2 = sqlx::query(
- format!("INSERT INTO dummy_omni_table(id, {cols}) VALUES ($1, {vals}) RETURNING *")
- .as_str(),
- )
+ let row2 = sqlx::query(unsafe_sql!(
+ "INSERT INTO dummy_omni_table(id, {cols}) VALUES ($1, {vals}) RETURNING *"
+ ))
.bind(2)
.fetch_one(&mut *transaction)
.await
.unwrap();
- sqlx::raw_sql(
- format!(
- "PREPARE stmt AS INSERT INTO dummy_omni_table(id, {cols}) VALUES ($1, {vals}) RETURNING *"
- )
- .as_str(),
- )
+ sqlx::raw_sql(unsafe_sql!(
+ "PREPARE stmt AS INSERT INTO dummy_omni_table(id, {cols}) VALUES ($1, {vals}) RETURNING *"
+ ))
.execute(&mut *transaction)
.await
.unwrap();
@@ -718,10 +714,9 @@ async fn reusable_func_test(
conn.execute("DROP TABLE IF EXISTS dummy_omni_table")
.await
.unwrap();
- conn.execute(
- format!("CREATE TABLE IF NOT EXISTS dummy_omni_table(id BIGSERIAL PRIMARY KEY, {schema})")
- .as_str(),
- )
+ conn.execute(unsafe_sql!(
+ "CREATE TABLE IF NOT EXISTS dummy_omni_table(id BIGSERIAL PRIMARY KEY, {schema})"
+ ))
.await
.unwrap();
admin_sqlx().await.execute("RELOAD").await.unwrap();
@@ -782,7 +777,7 @@ where
] {
let mut sesh = conn.begin().await.unwrap();
- sesh.execute(format!("SET TIME ZONE '{insertion_tz}'").as_str())
+ sesh.execute(unsafe_sql!("SET TIME ZONE '{insertion_tz}'"))
.await
.unwrap();
@@ -1033,7 +1028,7 @@ async fn fetch_rows_with_tz(
sesh: &mut Transaction<'_, Postgres>,
fetch_tz: &str,
) -> (Vec<PgRow>, Vec<PgRow>) {
- sesh.execute(format!("SET TIME ZONE '{fetch_tz}'").as_str())
+ sesh.execute(unsafe_sql!("SET TIME ZONE '{fetch_tz}'"))
.await
.unwrap();
diff --git a/integration/rust/tests/integration/notify.rs b/integration/rust/tests/integration/notify.rs
index da5a17c39..eac72a081 100644
--- a/integration/rust/tests/integration/notify.rs
+++ b/integration/rust/tests/integration/notify.rs
@@ -23,7 +23,7 @@ async fn test_listener_restarts_and_resubscribes_after_backend_termination() {
timeout(Duration::from_secs(10), async {
loop {
notifier
- .execute(format!("NOTIFY \"{channel}\", '{payload}'").as_str())
+ .execute(unsafe_sql!("NOTIFY \"{channel}\", '{payload}'"))
.await
.expect("send notification through PgDog");
@@ -134,7 +134,7 @@ async fn test_notify() {
let mut conn = PgConnection::connect("postgres://pgdog:pgdog@127.0.0.1:6432/pgdog")
.await
.unwrap();
- conn.execute(format!("NOTIFY {channel}, '{channel}'").as_str())
+ conn.execute(unsafe_sql!("NOTIFY {channel}, '{channel}'"))
.await
.unwrap();
});
@@ -178,7 +178,7 @@ async fn test_notify_payload_with_quote() {
.await
.unwrap();
notifier
- .execute(format!("NOTIFY {channel}, 'it''s here'").as_str())
+ .execute(unsafe_sql!("NOTIFY {channel}, 'it''s here'"))
.await
.expect("NOTIFY with an escaped quote in the payload");
@@ -211,7 +211,7 @@ async fn test_unlisten_all_stops_notifications() {
for channel in &channels {
notifier
- .execute(format!("NOTIFY {channel}, 'before'").as_str())
+ .execute(unsafe_sql!("NOTIFY {channel}, 'before'"))
.await
.unwrap();
let notification = timeout(Duration::from_secs(10), listener.recv())
@@ -227,7 +227,7 @@ async fn test_unlisten_all_stops_notifications() {
for channel in &channels {
notifier
- .execute(format!("NOTIFY {channel}, 'after'").as_str())
+ .execute(unsafe_sql!("NOTIFY {channel}, 'after'"))
.await
.unwrap();
}
diff --git a/integration/rust/tests/integration/offset.rs b/integration/rust/tests/integration/offset.rs
index b59700e00..ff14a5ea3 100644
--- a/integration/rust/tests/integration/offset.rs
+++ b/integration/rust/tests/integration/offset.rs
@@ -5,16 +5,17 @@ const TABLE: &str = "offset_test";
async fn reset(pool: &PgPool) -> Result<(), sqlx::Error> {
for shard in [0, 1] {
- pool.execute(format!("/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS {TABLE}").as_str())
- .await
- .ok();
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS {TABLE}"
+ ))
+ .await
+ .ok();
}
for shard in [0, 1] {
pool.execute(
- format!(
+ unsafe_sql!(
"/* pgdog_shard: {shard} */ CREATE TABLE {TABLE} (id SERIAL, value INTEGER, customer_id BIGINT)"
- )
- .as_str(),
+ ),
)
.await?;
}
@@ -24,23 +25,21 @@ async fn reset(pool: &PgPool) -> Result<(), sqlx::Error> {
async fn seed(pool: &PgPool) -> Result<(), sqlx::Error> {
// Shard 0: values 1..=5
- pool.execute(
- format!("/* pgdog_shard: 0 */ INSERT INTO {TABLE}(value) VALUES (1), (2), (3), (4), (5)")
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: 0 */ INSERT INTO {TABLE}(value) VALUES (1), (2), (3), (4), (5)"
+ ))
.await?;
// Shard 1: values 6..=10
- pool.execute(
- format!("/* pgdog_shard: 1 */ INSERT INTO {TABLE}(value) VALUES (6), (7), (8), (9), (10)")
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: 1 */ INSERT INTO {TABLE}(value) VALUES (6), (7), (8), (9), (10)"
+ ))
.await?;
Ok(())
}
async fn cleanup(pool: &PgPool) {
for shard in [0, 1] {
- pool.execute(format!("/* pgdog_shard: {shard} */ DROP TABLE {TABLE}").as_str())
+ pool.execute(unsafe_sql!("/* pgdog_shard: {shard} */ DROP TABLE {TABLE}"))
.await
.ok();
}
@@ -49,18 +48,16 @@ async fn cleanup(pool: &PgPool) {
async fn seed_with_customer_id(pool: &PgPool) -> Result<(), sqlx::Error> {
// Shard 0: values 1..=5 with customer_id=1
pool.execute(
- format!(
+ unsafe_sql!(
"/* pgdog_shard: 0 */ INSERT INTO {TABLE}(value, customer_id) VALUES (1,1), (2,1), (3,1), (4,1), (5,1)"
- )
- .as_str(),
+ ),
)
.await?;
// Shard 1: values 6..=10 with customer_id=1
pool.execute(
- format!(
+ unsafe_sql!(
"/* pgdog_shard: 1 */ INSERT INTO {TABLE}(value, customer_id) VALUES (6,1), (7,1), (8,1), (9,1), (10,1)"
- )
- .as_str(),
+ ),
)
.await?;
Ok(())
@@ -78,31 +75,41 @@ async fn offset_pagination_literals() -> Result<(), Box<dyn std::error::Error>>
// Page 1: OFFSET 0 LIMIT 3
let rows = sharded
- .fetch_all(format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 0").as_str())
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 0"
+ ))
.await?;
assert_eq!(values(&rows), vec![1, 2, 3]);
// Page 2: OFFSET 3 LIMIT 3
let rows = sharded
- .fetch_all(format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 3").as_str())
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 3"
+ ))
.await?;
assert_eq!(values(&rows), vec![4, 5, 6]);
// Page 3: OFFSET 6 LIMIT 3
let rows = sharded
- .fetch_all(format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 6").as_str())
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 6"
+ ))
.await?;
assert_eq!(values(&rows), vec![7, 8, 9]);
// Page 4: OFFSET 9 LIMIT 3 (only 1 row left)
let rows = sharded
- .fetch_all(format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 9").as_str())
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 9"
+ ))
.await?;
assert_eq!(values(&rows), vec![10]);
// Past the end
let rows = sharded
- .fetch_all(format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 10").as_str())
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 10"
+ ))
.await?;
assert!(rows.is_empty());
@@ -116,10 +123,10 @@ async fn offset_pagination_prepared() -> Result<(), Box<dyn std::error::Error>>
reset(&sharded).await?;
seed(&sharded).await?;
- let sql = format!("SELECT value FROM {TABLE} ORDER BY value LIMIT $1 OFFSET $2");
+ let sql = unsafe_sql!("SELECT value FROM {TABLE} ORDER BY value LIMIT $1 OFFSET $2");
// Page 1
- let rows = sqlx::query(&sql)
+ let rows = sqlx::query(sql.clone())
.bind(3i64)
.bind(0i64)
.fetch_all(&sharded)
@@ -127,7 +134,7 @@ async fn offset_pagination_prepared() -> Result<(), Box<dyn std::error::Error>>
assert_eq!(values(&rows), vec![1, 2, 3]);
// Page 2
- let rows = sqlx::query(&sql)
+ let rows = sqlx::query(sql.clone())
.bind(3i64)
.bind(3i64)
.fetch_all(&sharded)
@@ -135,7 +142,7 @@ async fn offset_pagination_prepared() -> Result<(), Box<dyn std::error::Error>>
assert_eq!(values(&rows), vec![4, 5, 6]);
// Page 3
- let rows = sqlx::query(&sql)
+ let rows = sqlx::query(sql.clone())
.bind(3i64)
.bind(6i64)
.fetch_all(&sharded)
@@ -143,7 +150,7 @@ async fn offset_pagination_prepared() -> Result<(), Box<dyn std::error::Error>>
assert_eq!(values(&rows), vec![7, 8, 9]);
// Partial last page
- let rows = sqlx::query(&sql)
+ let rows = sqlx::query(sql.clone())
.bind(3i64)
.bind(9i64)
.fetch_all(&sharded)
@@ -151,7 +158,7 @@ async fn offset_pagination_prepared() -> Result<(), Box<dyn std::error::Error>>
assert_eq!(values(&rows), vec![10]);
// Past the end
- let rows = sqlx::query(&sql)
+ let rows = sqlx::query(sql)
.bind(3i64)
.bind(10i64)
.fetch_all(&sharded)
@@ -169,14 +176,14 @@ async fn offset_pagination_expressions() -> Result<(), Box<dyn std::error::Error
seed(&sharded).await?;
let rows = sharded
- .fetch_all(
- format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 1 + 2 OFFSET 2 * 2").as_str(),
- )
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 1 + 2 OFFSET 2 * 2"
+ ))
.await?;
assert_eq!(values(&rows), vec![5, 6, 7]);
// sqlx sends i32 parameters as 4-byte binary integers.
- let rows = sqlx::query(&format!(
+ let rows = sqlx::query(unsafe_sql!(
"SELECT value FROM {TABLE} ORDER BY value LIMIT $1::int OFFSET $2::int + 1"
))
.bind(3i32)
@@ -197,7 +204,9 @@ async fn offset_full_scan() -> Result<(), Box<dyn std::error::Error>> {
// OFFSET 0 with LIMIT covering all rows returns everything in order.
let rows = sharded
- .fetch_all(format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 10 OFFSET 0").as_str())
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 10 OFFSET 0"
+ ))
.await?;
assert_eq!(values(&rows), vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
@@ -213,7 +222,9 @@ async fn offset_large_offset() -> Result<(), Box<dyn std::error::Error>> {
// OFFSET larger than total row count.
let rows = sharded
- .fetch_all(format!("SELECT value FROM {TABLE} ORDER BY value LIMIT 5 OFFSET 100").as_str())
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value LIMIT 5 OFFSET 100"
+ ))
.await?;
assert!(rows.is_empty());
@@ -228,16 +239,16 @@ async fn offset_descending_order() -> Result<(), Box<dyn std::error::Error>> {
seed(&sharded).await?;
let rows = sharded
- .fetch_all(
- format!("SELECT value FROM {TABLE} ORDER BY value DESC LIMIT 3 OFFSET 2").as_str(),
- )
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value DESC LIMIT 3 OFFSET 2"
+ ))
.await?;
assert_eq!(values(&rows), vec![8, 7, 6]);
let rows = sharded
- .fetch_all(
- format!("SELECT value FROM {TABLE} ORDER BY value DESC LIMIT 3 OFFSET 5").as_str(),
- )
+ .fetch_all(unsafe_sql!(
+ "SELECT value FROM {TABLE} ORDER BY value DESC LIMIT 3 OFFSET 5"
+ ))
.await?;
assert_eq!(values(&rows), vec![5, 4, 3]);
@@ -254,45 +265,33 @@ async fn offset_single_shard_not_rewritten() -> Result<(), Box<dyn std::error::E
// Query with shard comment forces single-shard routing.
// LIMIT/OFFSET should be passed through unchanged to Postgres.
let rows = sharded
- .fetch_all(
- format!(
- "/* pgdog_shard: 0 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 2"
- )
- .as_str(),
- )
+ .fetch_all(unsafe_sql!(
+ "/* pgdog_shard: 0 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 2"
+ ))
.await?;
// Shard 0 has values 1..=5, so OFFSET 2 LIMIT 3 → [3, 4, 5]
assert_eq!(values(&rows), vec![3, 4, 5]);
let rows = sharded
- .fetch_all(
- format!(
- "/* pgdog_shard: 0 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 2 OFFSET 4"
- )
- .as_str(),
- )
+ .fetch_all(unsafe_sql!(
+ "/* pgdog_shard: 0 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 2 OFFSET 4"
+ ))
.await?;
// Only 1 row left at offset 4 on shard 0
assert_eq!(values(&rows), vec![5]);
let rows = sharded
- .fetch_all(
- format!(
- "/* pgdog_shard: 1 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 0"
- )
- .as_str(),
- )
+ .fetch_all(unsafe_sql!(
+ "/* pgdog_shard: 1 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 3 OFFSET 0"
+ ))
.await?;
// Shard 1 has values 6..=10
assert_eq!(values(&rows), vec![6, 7, 8]);
let rows = sharded
- .fetch_all(
- format!(
- "/* pgdog_shard: 1 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 10 OFFSET 3"
- )
- .as_str(),
- )
+ .fetch_all(unsafe_sql!(
+ "/* pgdog_shard: 1 */ SELECT value FROM {TABLE} ORDER BY value LIMIT 10 OFFSET 3"
+ ))
.await?;
assert_eq!(values(&rows), vec![9, 10]);
@@ -307,14 +306,14 @@ async fn offset_single_shard_prepared() -> Result<(), Box<dyn std::error::Error>
seed_with_customer_id(&sharded).await?;
// Parameterized query targeting a single shard via WHERE customer_id.
- let sql = format!(
+ let sql = unsafe_sql!(
"SELECT value FROM {TABLE} WHERE customer_id = $1 ORDER BY value LIMIT $2 OFFSET $3"
);
// customer_id=1 hashes to some shard; both shards have data with customer_id=1,
// but the router sends the query to only one shard. Regardless of which shard
// it picks, LIMIT/OFFSET should work correctly on the shard's local data.
- let rows = sqlx::query(&sql)
+ let rows = sqlx::query(sql.clone())
.bind(1i64)
.bind(3i64)
.bind(0i64)
@@ -329,7 +328,7 @@ async fn offset_single_shard_prepared() -> Result<(), Box<dyn std::error::Error>
let first_page = vals.clone();
// Next page should continue where we left off.
- let rows = sqlx::query(&sql)
+ let rows = sqlx::query(sql)
.bind(1i64)
.bind(3i64)
.bind(3i64)
diff --git a/integration/rust/tests/integration/order_by.rs b/integration/rust/tests/integration/order_by.rs
index 6ae374a38..58cf1b729 100644
--- a/integration/rust/tests/integration/order_by.rs
+++ b/integration/rust/tests/integration/order_by.rs
@@ -20,7 +20,9 @@ async fn sorts_by_case_expression_across_shards() {
(16, "pay"),
] {
sharded_connection
- .execute(format!("INSERT INTO sharded (id, value) VALUES ({id}, '{value}')").as_str())
+ .execute(unsafe_sql!(
+ "INSERT INTO sharded (id, value) VALUES ({id}, '{value}')"
+ ))
.await
.unwrap();
}
diff --git a/integration/rust/tests/integration/passthrough_debounce.rs b/integration/rust/tests/integration/passthrough_debounce.rs
index 7251a43de..fff29e853 100644
--- a/integration/rust/tests/integration/passthrough_debounce.rs
+++ b/integration/rust/tests/integration/passthrough_debounce.rs
@@ -37,7 +37,7 @@ async fn test_passthrough_debounce_retries_same_credentials_after_expiry() {
// NOLOGIN makes the initial validation fail even when local PostgreSQL
// uses trust authentication. No shared test user's credentials are changed.
direct
- .execute(format!("CREATE ROLE {user} NOLOGIN PASSWORD 'pgdog'").as_str())
+ .execute(unsafe_sql!("CREATE ROLE {user} NOLOGIN PASSWORD 'pgdog'"))
.await
.expect("create temporarily disabled role");
let url = format!("postgres://{user}:pgdog@127.0.0.1:6432/pgdog");
@@ -63,7 +63,7 @@ async fn test_passthrough_debounce_retries_same_credentials_after_expiry() {
}
direct
- .execute(format!("ALTER ROLE {user} LOGIN").as_str())
+ .execute(unsafe_sql!("ALTER ROLE {user} LOGIN"))
.await?;
// Neither reload nor unban: only expiry should allow fresh validation
// of exactly the credentials whose previous check failed.
@@ -77,7 +77,7 @@ async fn test_passthrough_debounce_retries_same_credentials_after_expiry() {
admin.execute("RELOAD").await.expect("restore config");
direct
- .execute(format!("DROP ROLE {user}").as_str())
+ .execute(unsafe_sql!("DROP ROLE {user}"))
.await
.expect("remove test role");
assert_eq!(result.expect("same credentials must work after expiry"), 1);
diff --git a/integration/rust/tests/integration/passthrough_race.rs b/integration/rust/tests/integration/passthrough_race.rs
index bbb7487a3..3cc1be21a 100644
--- a/integration/rust/tests/integration/passthrough_race.rs
+++ b/integration/rust/tests/integration/passthrough_race.rs
@@ -30,10 +30,10 @@ async fn test_passthrough_concurrent_first_login() -> anyhow::Result<()> {
// forcibly interrupted run that could not reach the cleanup below.
let user = format!("pgdog_passthrough_race_{round:02}");
direct
- .execute(format!("DROP ROLE IF EXISTS {user}").as_str())
+ .execute(unsafe_sql!("DROP ROLE IF EXISTS {user}"))
.await?;
direct
- .execute(format!("CREATE ROLE {user} LOGIN PASSWORD 'pgdog'").as_str())
+ .execute(unsafe_sql!("CREATE ROLE {user} LOGIN PASSWORD 'pgdog'"))
.await?;
roles.push(user.clone());
let url = format!("postgres://{user}:pgdog@127.0.0.1:6432/pgdog");
@@ -88,7 +88,7 @@ async fn test_passthrough_concurrent_first_login() -> anyhow::Result<()> {
cleanup_errors.push(format!("restore config: {error}"));
}
for user in roles {
- if let Err(error) = direct.execute(format!("DROP ROLE {user}").as_str()).await {
+ if let Err(error) = direct.execute(unsafe_sql!("DROP ROLE {user}")).await {
cleanup_errors.push(format!("drop {user}: {error}"));
}
}
diff --git a/integration/rust/tests/integration/prepared.rs b/integration/rust/tests/integration/prepared.rs
index 0489dd1aa..5cceaf2e8 100644
--- a/integration/rust/tests/integration/prepared.rs
+++ b/integration/rust/tests/integration/prepared.rs
@@ -157,17 +157,17 @@ async fn test_prepared_cache_helper_not_evicted_on_close() {
// Build a deterministic dataset per shard to trigger AVG rewrite.
for shard in [0, 1] {
- let drop = format!(
+ let drop = unsafe_sql!(
"/* pgdog_shard: {} */ DROP TABLE IF EXISTS avg_helper_cleanup",
shard
);
- sharded.execute(drop.as_str()).await.ok();
+ sharded.execute(drop).await.ok();
- let create = format!(
+ let create = unsafe_sql!(
"/* pgdog_shard: {} */ CREATE TABLE avg_helper_cleanup(price DOUBLE PRECISION)",
shard
);
- sharded.execute(create.as_str()).await.unwrap();
+ sharded.execute(create).await.unwrap();
}
sharded
@@ -186,11 +186,11 @@ async fn test_prepared_cache_helper_not_evicted_on_close() {
// Clean up tables so subsequent tests start fresh.
for shard in [0, 1] {
- let drop = format!(
+ let drop = unsafe_sql!(
"/* pgdog_shard: {} */ DROP TABLE IF EXISTS avg_helper_cleanup",
shard
);
- sharded.execute(drop.as_str()).await.ok();
+ sharded.execute(drop).await.ok();
}
sharded.close().await;
@@ -235,12 +235,12 @@ async fn test_prepard_cache_eviction() {
for _ in 0..10 {
for id in 0..50 {
- let query = format!(
+ let query = unsafe_sql!(
"/* test_prepard_cache_eviction: {} */ SELECT $1::bigint",
id
);
for conn in &conns {
- let row = sqlx::query(query.as_str())
+ let row = sqlx::query(query.clone())
.bind(id)
.fetch_one(conn)
.await
@@ -305,8 +305,8 @@ async fn test_memory_realloc() {
let pool = pool.clone();
tasks.push(spawn(async move {
for i in 0..1000 {
- let query = format!("SELECT $1::bigint, $2::integer, $3::text, 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', '{}'", i);
- let _result = sqlx::query(query.as_str()).bind(i as i64).bind(i).bind("test").execute(&pool).await.unwrap();
+ let query = unsafe_sql!("SELECT $1::bigint, $2::integer, $3::text, 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', 'Splits the bytes into two at the given index.Afterwards self contains elements [at, len), and the returned Bytes contains elements [0, at).This is an O(1) operation that just increases the reference count and sets a few indices.', '{}'", i);
+ let _result = sqlx::query(query).bind(i as i64).bind(i).bind("test").execute(&pool).await.unwrap();
}
}));
}
diff --git a/integration/rust/tests/integration/reload.rs b/integration/rust/tests/integration/reload.rs
index a859226ee..cae64c3f8 100644
--- a/integration/rust/tests/integration/reload.rs
+++ b/integration/rust/tests/integration/reload.rs
@@ -257,10 +257,10 @@ async fn test_reload_pool_size_not_exceeded() {
admin.simple_query("RELOAD").await.unwrap();
sleep(Duration::from_millis(100)).await;
- let query = format!(
+ let query = unsafe_sql!(
"SELECT COUNT(*)::BIGINT FROM pg_stat_activity WHERE application_name = '{app_name}'"
);
- let count: i64 = direct.fetch_one(query.as_str()).await.unwrap().get(0);
+ let count: i64 = direct.fetch_one(query).await.unwrap().get(0);
eprintln!("reload {i}: {count} connections (pool_size={pool_size})");
assert!(
diff --git a/integration/rust/tests/integration/rewrite.rs b/integration/rust/tests/integration/rewrite.rs
index 2963401ff..1edf8cb40 100644
--- a/integration/rust/tests/integration/rewrite.rs
+++ b/integration/rust/tests/integration/rewrite.rs
@@ -50,7 +50,7 @@ async fn sharded_multi_row_insert_rejected() {
let mut pools = connections_sqlx().await;
let sharded = pools.swap_remove(1);
- let err = sqlx::query(&format!(
+ let err = sqlx::query(unsafe_sql!(
"INSERT INTO {SHARDED_INSERT_TABLE} (id, value) VALUES (1, 'one'), (2, 'two')"
))
.execute(&sharded)
@@ -78,14 +78,14 @@ async fn non_sharded_multi_row_insert_allowed() {
prepare_non_sharded_table(&primary).await;
- sqlx::query(&format!(
+ sqlx::query(unsafe_sql!(
"INSERT INTO {NON_SHARDED_TABLE} (id, name) VALUES (1, 'one'), (2, 'two')"
))
.execute(&primary)
.await
.expect("multi-row insert should succeed for non-sharded table");
- let rows: Vec<(i64, String)> = sqlx::query_as(&format!(
+ let rows: Vec<(i64, String)> = sqlx::query_as(unsafe_sql!(
"SELECT id, name FROM {NON_SHARDED_TABLE} ORDER BY id"
))
.fetch_all(&primary)
@@ -113,20 +113,20 @@ async fn split_inserts_rewrite_moves_rows_across_shards() {
prepare_split_table(&pool).await;
- sqlx::query(&format!(
+ sqlx::query(unsafe_sql!(
"INSERT INTO {SHARDED_INSERT_TABLE} (id, value) VALUES (1, 'one'), (11, 'eleven')"
))
.execute(&pool)
.await
.expect("split insert should succeed");
- let shard0: Option<String> = sqlx::query_scalar(&format!(
+ let shard0: Option<String> = sqlx::query_scalar(unsafe_sql!(
"SELECT value FROM {SHARDED_INSERT_TABLE} WHERE id = 1"
))
.fetch_optional(&pool)
.await
.expect("fetch shard 0 row");
- let shard1: Option<String> = sqlx::query_scalar(&format!(
+ let shard1: Option<String> = sqlx::query_scalar(unsafe_sql!(
"SELECT value FROM {SHARDED_INSERT_TABLE} WHERE id = 11"
))
.fetch_optional(&pool)
@@ -176,7 +176,7 @@ async fn omnisharded_sharding_key_update_in_transaction() {
assert_eq!(result.rows_affected(), 1);
for shard in [0, 1] {
- let rows: Vec<(i64, i64, String)> = sqlx::query_as(&format!(
+ let rows: Vec<(i64, i64, String)> = sqlx::query_as(unsafe_sql!(
"/* pgdog_shard: {shard} */ SELECT id, customer_id, value FROM sharded_omni"
))
.fetch_all(&mut *txn)
@@ -199,17 +199,15 @@ async fn update_moves_row_between_shards() {
prepare_table(&pool).await;
- let insert = format!("INSERT INTO {TEST_TABLE} (id, value) VALUES (1, 'old')");
- pool.execute(insert.as_str())
- .await
- .expect("insert initial row");
+ let insert = unsafe_sql!("INSERT INTO {TEST_TABLE} (id, value) VALUES (1, 'old')");
+ pool.execute(insert).await.expect("insert initial row");
assert_eq!(count_on_shard(&pool, 0, 1).await, 1, "row on shard 0");
assert_eq!(count_on_shard(&pool, 1, 1).await, 0, "no row on shard 1");
let mut txn = pool.begin().await.unwrap();
- let update = format!("UPDATE {TEST_TABLE} SET id = 11 WHERE id = 1");
- let result = txn.execute(update.as_str()).await.expect("rewrite update");
+ let update = unsafe_sql!("UPDATE {TEST_TABLE} SET id = 11 WHERE id = 1");
+ let result = txn.execute(update).await.expect("rewrite update");
assert_eq!(result.rows_affected(), 1, "exactly one row updated");
txn.commit().await.unwrap();
@@ -237,21 +235,19 @@ async fn update_rejects_multiple_rows() {
prepare_table(&pool).await;
- let insert_first = format!("INSERT INTO {TEST_TABLE} (id, value) VALUES (1, 'old')");
- pool.execute(insert_first.as_str())
- .await
- .expect("insert first row");
+ let insert_first = unsafe_sql!("INSERT INTO {TEST_TABLE} (id, value) VALUES (1, 'old')");
+ pool.execute(insert_first).await.expect("insert first row");
- let insert_second = format!("INSERT INTO {TEST_TABLE} (id, value) VALUES (2, 'older')");
- pool.execute(insert_second.as_str())
+ let insert_second = unsafe_sql!("INSERT INTO {TEST_TABLE} (id, value) VALUES (2, 'older')");
+ pool.execute(insert_second)
.await
.expect("insert second row");
let mut txn = pool.begin().await.unwrap();
- let update = format!("UPDATE {TEST_TABLE} SET id = 11 WHERE id IN (1, 2)");
+ let update = unsafe_sql!("UPDATE {TEST_TABLE} SET id = 11 WHERE id IN (1, 2)");
let err = txn
- .execute(update.as_str())
+ .execute(update)
.await
.expect_err("expected multi-row rewrite to fail");
let db_err = err
@@ -295,16 +291,14 @@ async fn update_expects_transactions() {
prepare_table(&pool).await;
- let insert = format!("INSERT INTO {TEST_TABLE} (id, value) VALUES (1, 'old')");
- pool.execute(insert.as_str())
- .await
- .expect("insert initial row");
+ let insert = unsafe_sql!("INSERT INTO {TEST_TABLE} (id, value) VALUES (1, 'old')");
+ pool.execute(insert).await.expect("insert initial row");
let mut conn = pool.acquire().await.expect("acquire connection");
- let update = format!("UPDATE {TEST_TABLE} SET id = 11 WHERE id = 1");
+ let update = unsafe_sql!("UPDATE {TEST_TABLE} SET id = 11 WHERE id = 1");
let err = conn
- .execute(update.as_str())
+ .execute(update)
.await
.expect_err("sharding key update must be executed inside a transaction");
let db_err = err
@@ -404,62 +398,59 @@ async fn test_error_disconnects_and_update_works() -> Result<(), Box<dyn std::er
async fn prepare_table(pool: &Pool<Postgres>) {
for shard in [0, 1] {
- let drop = format!("/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS {TEST_TABLE}");
- pool.execute(drop.as_str()).await.unwrap();
- let create = format!(
+ let drop = unsafe_sql!("/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS {TEST_TABLE}");
+ pool.execute(drop).await.unwrap();
+ let create = unsafe_sql!(
"/* pgdog_shard: {shard} */ CREATE TABLE {TEST_TABLE} (id BIGINT PRIMARY KEY, value TEXT)"
);
- pool.execute(create.as_str()).await.unwrap();
+ pool.execute(create).await.unwrap();
}
}
async fn cleanup_table(pool: &Pool<Postgres>) {
for shard in [0, 1] {
- let drop = format!("/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS {TEST_TABLE}");
- pool.execute(drop.as_str()).await.ok();
+ let drop = unsafe_sql!("/* pgdog_shard: {shard} */ DROP TABLE IF EXISTS {TEST_TABLE}");
+ pool.execute(drop).await.ok();
}
}
async fn prepare_split_table(pool: &Pool<Postgres>) {
- let truncate = format!("TRUNCATE TABLE {SHARDED_INSERT_TABLE}");
- pool.execute(truncate.as_str()).await.unwrap();
+ let truncate = unsafe_sql!("TRUNCATE TABLE {SHARDED_INSERT_TABLE}");
+ pool.execute(truncate).await.unwrap();
}
async fn cleanup_split_table(pool: &Pool<Postgres>) {
- let truncate = format!("TRUNCATE TABLE {SHARDED_INSERT_TABLE}");
- pool.execute(truncate.as_str()).await.ok();
+ let truncate = unsafe_sql!("TRUNCATE TABLE {SHARDED_INSERT_TABLE}");
+ pool.execute(truncate).await.ok();
}
async fn count_on_shard(pool: &Pool<Postgres>, shard: i32, id: i64) -> i64 {
- let sql = format!(
+ let sql = unsafe_sql!(
"/* pgdog_shard: {shard} */ SELECT COUNT(*)::bigint FROM {TEST_TABLE} WHERE id = {id}"
);
- sqlx::query_scalar(sql.as_str())
- .fetch_one(pool)
- .await
- .unwrap()
+ sqlx::query_scalar(sql).fetch_one(pool).await.unwrap()
}
async fn prepare_non_sharded_table(pool: &Pool<Postgres>) {
- let _ = sqlx::query(&format!("DROP TABLE IF EXISTS {NON_SHARDED_TABLE}"))
+ let _ = sqlx::query(unsafe_sql!("DROP TABLE IF EXISTS {NON_SHARDED_TABLE}"))
.execute(pool)
.await;
- sqlx::query(&format!(
+ sqlx::query(unsafe_sql!(
"CREATE TABLE IF NOT EXISTS {NON_SHARDED_TABLE} (id BIGINT PRIMARY KEY, name TEXT)"
))
.execute(pool)
.await
.expect("create non-sharded table");
- sqlx::query(&format!("TRUNCATE TABLE {NON_SHARDED_TABLE}"))
+ sqlx::query(unsafe_sql!("TRUNCATE TABLE {NON_SHARDED_TABLE}"))
.execute(pool)
.await
.expect("truncate non-sharded table");
}
async fn cleanup_non_sharded_table(pool: &Pool<Postgres>) {
- let _ = sqlx::query(&format!("DROP TABLE IF EXISTS {NON_SHARDED_TABLE}"))
+ let _ = sqlx::query(unsafe_sql!("DROP TABLE IF EXISTS {NON_SHARDED_TABLE}"))
.execute(pool)
.await;
}
diff --git a/integration/rust/tests/integration/rewrite_omni.rs b/integration/rust/tests/integration/rewrite_omni.rs
index 532774eda..77a32382d 100644
--- a/integration/rust/tests/integration/rewrite_omni.rs
+++ b/integration/rust/tests/integration/rewrite_omni.rs
@@ -25,13 +25,10 @@ async fn test_omni_only_pk_rewrite() {
// Configure sharding.
let mut t = pool.begin().await.unwrap();
t.execute("DELETE FROM pgdog.config").await.unwrap();
- t.execute(
- format!(
- "INSERT INTO pgdog.config (shard, shards) VALUES ({}, 2)",
- shard
- )
- .as_str(),
- )
+ t.execute(unsafe_sql!(
+ "INSERT INTO pgdog.config (shard, shards) VALUES ({}, 2)",
+ shard
+ ))
.await
.unwrap();
t.commit().await.unwrap();
diff --git a/integration/rust/tests/integration/set_in_transaction.rs b/integration/rust/tests/integration/set_in_transaction.rs
index ebd862c0c..ed51d19db 100644
--- a/integration/rust/tests/integration/set_in_transaction.rs
+++ b/integration/rust/tests/integration/set_in_transaction.rs
@@ -22,7 +22,7 @@ async fn run_set_in_transaction_reset_after_commit() {
// Start a transaction and change lock_timeout
conn.execute("BEGIN").await.unwrap();
- conn.execute(format!("SET lock_timeout TO '{}'", new_timeout).as_str())
+ conn.execute(unsafe_sql!("SET lock_timeout TO '{}'", new_timeout))
.await
.unwrap();
@@ -110,7 +110,7 @@ async fn run_set_in_transaction_reset_after_rollback() {
// Start a transaction and change statement_timeout
conn.execute("BEGIN").await.unwrap();
- conn.execute(format!("SET statement_timeout TO '{}'", new_timeout).as_str())
+ conn.execute(unsafe_sql!("SET statement_timeout TO '{}'", new_timeout))
.await
.unwrap();
@@ -181,7 +181,7 @@ async fn run_set_local_in_transaction_reset_after_commit() {
// Start a transaction and change work_mem using SET LOCAL
conn.execute("BEGIN").await.unwrap();
- conn.execute(format!("SET LOCAL work_mem TO '{}'", new_work_mem).as_str())
+ conn.execute(unsafe_sql!("SET LOCAL work_mem TO '{}'", new_work_mem))
.await
.unwrap();
diff --git a/integration/rust/tests/integration/set_sharding_key.rs b/integration/rust/tests/integration/set_sharding_key.rs
index 84f2aee2c..674f4b69c 100644
--- a/integration/rust/tests/integration/set_sharding_key.rs
+++ b/integration/rust/tests/integration/set_sharding_key.rs
@@ -33,7 +33,7 @@ async fn test_single_sharding_function() {
for id in 1..21 {
conn.execute("BEGIN").await.unwrap();
- conn.execute(format!("SET pgdog.sharding_key TO '{}'", id).as_str())
+ conn.execute(unsafe_sql!("SET pgdog.sharding_key TO '{}'", id))
.await
.unwrap();
let result: (i64,) =
diff --git a/integration/rust/tests/integration/shard_consistency.rs b/integration/rust/tests/integration/shard_consistency.rs
index 4b9ff8470..5f735e4c6 100644
--- a/integration/rust/tests/integration/shard_consistency.rs
+++ b/integration/rust/tests/integration/shard_consistency.rs
@@ -227,7 +227,9 @@ async fn shard_consistency_data_row_validator_prepared_statement()
// Now prepare a statement against the views.
let result = sharded
- .prepare("SELECT * FROM datarow_view WHERE id > $1")
+ .prepare(sqlx::SqlStr::from_static(
+ "SELECT * FROM datarow_view WHERE id > $1",
+ ))
.await;
// We want this test to specifically trigger DataRow validation, not RowDescription validation
diff --git a/integration/rust/tests/integration/stddev.rs b/integration/rust/tests/integration/stddev.rs
index 4ee428c11..be5b9dd64 100644
--- a/integration/rust/tests/integration/stddev.rs
+++ b/integration/rust/tests/integration/stddev.rs
@@ -9,16 +9,19 @@ async fn test_variance_sparse_inputs() {
for data_type in ["int4", "int8", "numeric", "real", "float8"] {
let table = format!("test_variance_sparse_{data_type}");
setup_schema(&conns, &table, data_type).await;
- let query = format!(
+ let query = unsafe_sql!(
"SELECT var_pop(value), var_samp(value), stddev_pop(value), stddev_samp(value) FROM {table}"
);
for values in [&[][..], &["NULL"][..], &["42"][..], &["42", "NULL"][..]] {
setup_data(&conns, &table, values).await;
let expected = postgres
- .fetch_one(&*query)
+ .fetch_one(query.clone())
.await
.expect("PostgreSQL result");
- let actual = conns[1].fetch_one(&*query).await.expect("sharded result");
+ let actual = conns[1]
+ .fetch_one(query.clone())
+ .await
+ .expect("sharded result");
for column in 0..4 {
if matches!(data_type, "real" | "float8") {
assert_eq!(
@@ -207,10 +210,10 @@ fn assert_dec_eq(mut actual: Decimal, expected: Decimal) {
async fn setup_schema(conns: &[Pool<Postgres>], table_name: &str, data_type: &str) {
for conn in conns {
- conn.execute(&*format!("DROP TABLE IF EXISTS {table_name}"))
+ conn.execute(unsafe_sql!("DROP TABLE IF EXISTS {table_name}"))
.await
.unwrap();
- conn.execute(&*format!(
+ conn.execute(unsafe_sql!(
"CREATE TABLE {table_name} (customer_id BIGINT NOT NULL, value {data_type})",
))
.await
@@ -221,11 +224,11 @@ async fn setup_schema(conns: &[Pool<Postgres>], table_name: &str, data_type: &st
async fn setup_data<T: std::fmt::Display>(conns: &[Pool<Postgres>], table_name: &str, data: &[T]) {
for conn in conns {
- conn.execute(&*format!("TRUNCATE TABLE {table_name}"))
+ conn.execute(unsafe_sql!("TRUNCATE TABLE {table_name}"))
.await
.unwrap();
for (i, value) in data.iter().enumerate() {
- conn.execute(&*format!(
+ conn.execute(unsafe_sql!(
"INSERT INTO {table_name} (customer_id, value) VALUES ({i}, {value})"
))
.await
diff --git a/integration/rust/tests/integration/subqueries/mod.rs b/integration/rust/tests/integration/subqueries/mod.rs
index bd7983f32..68a4e6221 100644
--- a/integration/rust/tests/integration/subqueries/mod.rs
+++ b/integration/rust/tests/integration/subqueries/mod.rs
@@ -57,58 +57,58 @@ async fn setup_subqueries_suite(suffix: &str, first_time_running: bool) {
let setup_sql_list = if first_time_running {
vec![
- format!(
+ unsafe_sql!(
"DROP TABLE IF EXISTS {subpackages_table}, {suborders_table}, {subusers_table}, {substates_table}"
),
- format!(
+ unsafe_sql!(
"CREATE TABLE {subusers_table} (id BIGINT PRIMARY KEY, username text, status text, profile jsonb, signed_up date, last_ip inet, tags varchar[], media_ids bigint[])"
),
- format!("CREATE TABLE {substates_table} (state text PRIMARY KEY, shipping text)"),
- format!(
+ unsafe_sql!("CREATE TABLE {substates_table} (state text PRIMARY KEY, shipping text)"),
+ unsafe_sql!(
"CREATE TABLE {suborders_table} (id BIGINT PRIMARY KEY, user_id BIGINT REFERENCES {subusers_table}(id), state text REFERENCES {substates_table}(state), created_at TIMESTAMPTZ)"
),
- format!(
+ unsafe_sql!(
"CREATE TABLE {subpackages_table} (id BIGINT PRIMARY KEY, user_id BIGINT REFERENCES {subusers_table}(id), order_id BIGINT REFERENCES {suborders_table}(id), shipped_at TIMESTAMPTZ , estimated_arrival_time TIMESTAMPTZ)"
),
]
} else {
- vec![format!(
+ vec![unsafe_sql!(
"TRUNCATE {subusers_table}, {substates_table}, {suborders_table}, {subpackages_table}"
)]
};
let setup_sql_inserts = [
- format!("INSERT INTO {substates_table}(state, shipping) VALUES ('CA', 'quick')"),
- format!("INSERT INTO {substates_table}(state, shipping) VALUES ('NC', 'not quick')"),
- format!(
+ unsafe_sql!("INSERT INTO {substates_table}(state, shipping) VALUES ('CA', 'quick')"),
+ unsafe_sql!("INSERT INTO {substates_table}(state, shipping) VALUES ('NC', 'not quick')"),
+ unsafe_sql!(
"INSERT INTO {subusers_table}(id, username, status, profile, signed_up, last_ip, tags, media_ids) VALUES (1, 'test', 'VIP', '{{\"plan\": \"pro\"}}', '2026-01-01', '10.0.0.1', '{{a,b}}', '{{1,2}}')"
),
- format!(
+ unsafe_sql!(
"INSERT INTO {subusers_table}(id, username, status, profile, signed_up, last_ip, tags, media_ids) VALUES (2, 'test2', 'regular', '{{\"plan\": \"free\"}}', '2026-02-01', '192.168.0.2', '{{}}', '{{}}')"
),
- format!(
+ unsafe_sql!(
"INSERT INTO {subusers_table}(id, username, status, profile, signed_up, last_ip, tags, media_ids) VALUES (3, 'test3', 'VIP', '{{\"plan\": \"pro\"}}', '2026-03-01', '10.0.0.3', '{{c,NULL}}', '{{3}}')"
),
- format!("INSERT INTO {subusers_table}(id, username, status) VALUES (4, 'test4', NULL)"),
- format!(
+ unsafe_sql!("INSERT INTO {subusers_table}(id, username, status) VALUES (4, 'test4', NULL)"),
+ unsafe_sql!(
"INSERT INTO {suborders_table}(id, user_id, state, created_at) VALUES (1, 1, 'CA', '2026-10-12 14:30:00 America/New_York')"
),
- format!(
+ unsafe_sql!(
"INSERT INTO {suborders_table}(id, user_id, state, created_at) VALUES (2, 1, 'CA', '2026-10-13 14:30:00 America/New_York')"
),
- format!(
+ unsafe_sql!(
"INSERT INTO {suborders_table}(id, user_id, state, created_at) VALUES (3, 2, 'NC', '2026-10-13 14:25:00 America/New_York')"
),
];
// Aggregate both our direct database and the proxy with our tables...
for setup_sql in setup_sql_list {
- sqlx::raw_sql(setup_sql.as_str())
+ sqlx::raw_sql(setup_sql.clone())
.execute(&sharded_conn)
.await
.unwrap();
- sqlx::raw_sql(setup_sql.as_str())
+ sqlx::raw_sql(setup_sql)
.execute(&direct_postgres)
.await
.unwrap();
@@ -116,12 +116,12 @@ async fn setup_subqueries_suite(suffix: &str, first_time_running: bool) {
// Aggregate both our direct database and the proxy with our data
for setup_sql_insert in setup_sql_inserts {
- sqlx::raw_sql(setup_sql_insert.as_str())
+ sqlx::raw_sql(setup_sql_insert.clone())
.execute(&sharded_conn)
.await
.unwrap();
- sqlx::raw_sql(setup_sql_insert.as_str())
+ sqlx::raw_sql(setup_sql_insert)
.execute(&direct_postgres)
.await
.unwrap();
diff --git a/integration/rust/tests/integration/subqueries/wire.rs b/integration/rust/tests/integration/subqueries/wire.rs
index 1a9ee8634..126a533fd 100644
--- a/integration/rust/tests/integration/subqueries/wire.rs
+++ b/integration/rust/tests/integration/subqueries/wire.rs
@@ -211,7 +211,7 @@ async fn fetch_pg_stat_statement(
// PERF(jkaczman): Technically, this could be a singular query send that doesn't filter by datname,
// then we break it apart ourselves.
let statements = sqlx::raw_sql(
- format!("SELECT application_name, query FROM pg_stat_monitor WHERE datname = 'shard_{shard}' ORDER BY stats_since ASC").as_str(),
+ unsafe_sql!("SELECT application_name, query FROM pg_stat_monitor WHERE datname = 'shard_{shard}' ORDER BY stats_since ASC"),
)
.fetch_all(&sharded_conn)
.await
diff --git a/integration/rust/tests/integration/sum.rs b/integration/rust/tests/integration/sum.rs
index 0c0bb7b51..e12709e1a 100644
--- a/integration/rust/tests/integration/sum.rs
+++ b/integration/rust/tests/integration/sum.rs
@@ -128,24 +128,21 @@ async fn sum_matches_direct_shard_queries() -> Result<(), Box<dyn std::error::Er
async fn reset_table(pool: &PgPool, table: &str, schema: &str) -> Result<(), sqlx::Error> {
for shard in [0, 1] {
- pool.execute(
- format!(
- "/* pgdog_shard: {} */ DROP TABLE IF EXISTS {}",
- shard, table
- )
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ DROP TABLE IF EXISTS {}",
+ shard,
+ table
+ ))
.await
.ok();
}
for shard in [0, 1] {
- pool.execute(
- format!(
- "/* pgdog_shard: {} */ CREATE TABLE {} {}",
- shard, table, schema
- )
- .as_str(),
- )
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ CREATE TABLE {} {}",
+ shard,
+ table,
+ schema
+ ))
.await?;
}
admin_sqlx().await.execute("RELOAD").await?;
@@ -153,16 +150,20 @@ async fn reset_table(pool: &PgPool, table: &str, schema: &str) -> Result<(), sql
}
async fn seed(pool: &PgPool, shard: usize, stmt: &str) -> Result<(), sqlx::Error> {
- pool.execute(format!("/* pgdog_shard: {} */ {}", shard, stmt).as_str())
+ pool.execute(unsafe_sql!("/* pgdog_shard: {} */ {}", shard, stmt))
.await?;
Ok(())
}
async fn cleanup(pool: &PgPool, table: &str) {
for shard in [0, 1] {
- pool.execute(format!("/* pgdog_shard: {} */ DROP TABLE {}", shard, table).as_str())
- .await
- .ok();
+ pool.execute(unsafe_sql!(
+ "/* pgdog_shard: {} */ DROP TABLE {}",
+ shard,
+ table
+ ))
+ .await
+ .ok();
}
}
@@ -170,8 +171,8 @@ async fn combined_sum(table: &str, column: &str) -> Result<f64, sqlx::Error> {
let mut total = 0.0;
for url in SHARD_URLS {
let mut conn = PgConnection::connect(url).await?;
- let query = format!("SELECT COALESCE(SUM({}), 0)::float8 FROM {}", column, table);
- let sum: f64 = sqlx::query_scalar(&query).fetch_one(&mut conn).await?;
+ let query = unsafe_sql!("SELECT COALESCE(SUM({}), 0)::float8 FROM {}", column, table);
+ let sum: f64 = sqlx::query_scalar(query).fetch_one(&mut conn).await?;
total += sum;
}
Ok(total)
diff --git a/integration/rust/tests/mod.rs b/integration/rust/tests/mod.rs
index 5b7601c85..26ee904eb 100644
--- a/integration/rust/tests/mod.rs
+++ b/integration/rust/tests/mod.rs
@@ -1,3 +1,6 @@
+#[macro_use]
+extern crate integration_tests_rust;
+
pub mod bench;
pub mod integration;
pub mod sqlx;
diff --git a/pgdog-config/Cargo.toml b/pgdog-config/Cargo.toml
index c5ba25722..7dfa0fe02 100644
--- a/pgdog-config/Cargo.toml
+++ b/pgdog-config/Cargo.toml
@@ -4,14 +4,14 @@ version = "0.1.0"
edition = "2024"
[dependencies]
-serde = { version = "1", features = ["derive"] }
+serde.workspace = true
serde_json.workspace = true
tracing = "0.1"
thiserror = "2"
-toml = "0.8"
+toml.workspace = true
url = "2"
uuid.workspace = true
-rand = "*"
+rand.workspace = true
pgdog-vector = { path = "../pgdog-vector" }
once_cell = "*"
schemars.workspace = true
diff --git a/pgdog-postgres-types/Cargo.toml b/pgdog-postgres-types/Cargo.toml
index 3abe65b14..07ad804aa 100644
--- a/pgdog-postgres-types/Cargo.toml
+++ b/pgdog-postgres-types/Cargo.toml
@@ -8,7 +8,7 @@ chrono = "0.4"
bytes.workspace = true
thiserror = "*"
uuid.workspace = true
-serde = { version = "*", features = ["derive"]}
+serde.workspace = true
schemars.workspace = true
pgdog-vector = { path = "../pgdog-vector" }
rust_decimal = { version = "1.36", features = ["db-postgres"] }
diff --git a/pgdog-stats/Cargo.toml b/pgdog-stats/Cargo.toml
index 647124101..de25c68b6 100644
--- a/pgdog-stats/Cargo.toml
+++ b/pgdog-stats/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2024"
[dependencies]
-serde = {version = "*", features = ["derive", "rc"]}
+serde = { workspace = true, features = ["rc"] }
serde_with.workspace = true
pgdog-config = { path = "../pgdog-config" }
pgdog-postgres-types = { path = "../pgdog-postgres-types" }
diff --git a/pgdog-vector/Cargo.toml b/pgdog-vector/Cargo.toml
index 900753ae1..76c38bca2 100644
--- a/pgdog-vector/Cargo.toml
+++ b/pgdog-vector/Cargo.toml
@@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2024"
[dependencies]
-serde = { version = "1", features = ["derive"] }
+serde.workspace = true
serde_json.workspace = true
schemars.workspace = true
diff --git a/pgdog/Cargo.toml b/pgdog/Cargo.toml
index 62db8e3d7..d6c5cabca 100644
--- a/pgdog/Cargo.toml
+++ b/pgdog/Cargo.toml
@@ -27,17 +27,17 @@ thiserror = "2"
derive_more = { workspace = true, features = ["debug", "error", "from_str"] }
bytes.workspace = true
clap = { version = "4", features = ["derive"] }
-serde = { version = "1", features = ["derive"] }
+serde.workspace = true
serde_json.workspace = true
async-trait = "0.1"
-rand = "0.9.2"
+rand.workspace = true
once_cell = "1"
tokio-rustls = { version = "0.26", features = ["aws-lc-rs"] }
rustls-native-certs = "0.8"
rustls-pki-types = "1"
aws-lc-rs = "1"
arc-swap = "1"
-toml = "0.8"
+toml.workspace = true
pgdog-plugin.workspace = true
pgdog-util.workspace = true
tokio-util = { version = "0.7", features = ["rt"] }
@@ -46,7 +46,7 @@ itoa = "1"
ryu = "1"
scram = { git = "https://github.com/pgdogdev/scram.git";, rev = "ee15a47f1051dc79589e8db666be7014c1e23fba" }
base64 = "0.22"
-md5 = "0.7"
+md5 = "0.8"
futures = "0.3"
csv-core = "0.1"
regex = "1"
@@ -64,12 +64,11 @@ hyper-util = { version = "0.1", features = ["full"] }
socket2 = { version = "0.6", features = ["all"] }
sha1 = "0.10"
indexmap.workspace = true
-lru = "0.16"
-hickory-resolver = "0.25.2"
+lru = "0.19"
+hickory-resolver = "0.26.3"
lazy_static = "1"
dashmap = "6"
moka = { version = "0.12", features = ["sync"] }
-derive_builder = "0.20.2"
aws-config = { version = "1", features = ["behavior-version-latest"] }
aws-sdk-rds = { version = "1", default-features = false }
pgdog-config = { path = "../pgdog-config" }
diff --git a/pgdog/src/auth/md5.rs b/pgdog/src/auth/md5.rs
index 58da2aad5..cc9fea7de 100644
--- a/pgdog/src/auth/md5.rs
+++ b/pgdog/src/auth/md5.rs
@@ -5,7 +5,7 @@
use bytes::Bytes;
use md5::Context;
-use rand::Rng;
+use rand::RngExt;
use super::Error;
use crate::net::messages::{Authentication, Password};
@@ -50,12 +50,12 @@ impl<'a> Client<'a> {
let mut md5 = Context::new();
md5.consume(password);
md5.consume(self.user);
- let first_pass = md5.compute();
+ let first_pass = md5.finalize();
let mut md5 = Context::new();
md5.consume(format!("{:x}", first_pass));
md5.consume(self.salt);
- format!("md5{:x}", md5.compute())
+ format!("md5{:x}", md5.finalize())
}
/// Used for pgdog->postgres auth which can only be
diff --git a/pgdog/src/auth/scram/server.rs b/pgdog/src/auth/scram/server.rs
index 7c477df92..1946c6344 100644
--- a/pgdog/src/auth/scram/server.rs
+++ b/pgdog/src/auth/scram/server.rs
@@ -9,7 +9,7 @@ use pgdog_config::users::PasswordKind;
use scram::server::ClientFinal;
use tracing::error;
-use rand::Rng;
+use rand::RngExt;
use scram::{
AuthenticationProvider, AuthenticationStatus, PasswordInfo, ScramServer, hash_password,
};
diff --git a/pgdog/src/backend/error.rs b/pgdog/src/backend/error.rs
index e92abcacc..ba6ad2a46 100644
--- a/pgdog/src/backend/error.rs
+++ b/pgdog/src/backend/error.rs
@@ -85,7 +85,7 @@ pub(crate) enum Error {
TlsRequired,
#[error("{0}")]
- DnsLookupError(#[from] hickory_resolver::ResolveError),
+ DnsLookupError(#[from] hickory_resolver::net::NetError),
#[error("could not resolve to any address for hostname {0}")]
DnsResolutionFailed(String),
diff --git a/pgdog/src/backend/pool/connection/mirror/mod.rs b/pgdog/src/backend/pool/connection/mirror/mod.rs
index e4f885544..4440a334c 100644
--- a/pgdog/src/backend/pool/connection/mirror/mod.rs
+++ b/pgdog/src/backend/pool/connection/mirror/mod.rs
@@ -3,7 +3,7 @@
use std::time::Duration;
use pgdog_config::MirroringLevel;
-use rand::{Rng, rng};
+use rand::{RngExt, rng};
use tokio::select;
use tokio::sync::mpsc::*;
use tokio::time::Instant;
diff --git a/pgdog/src/backend/pool/dns_cache.rs b/pgdog/src/backend/pool/dns_cache.rs
index bdefcb25d..7d784a8bc 100644
--- a/pgdog/src/backend/pool/dns_cache.rs
+++ b/pgdog/src/backend/pool/dns_cache.rs
@@ -5,7 +5,7 @@
//! hostname cache hits so callers resolve DNS on every request. IP literals are
//! returned directly and are not stored in the cache.
-use hickory_resolver::{Resolver, name_server::TokioConnectionProvider};
+use hickory_resolver::{TokioResolver, config::LookupIpStrategy};
use once_cell::sync::Lazy;
use parking_lot::RwLock;
use std::collections::HashMap;
@@ -37,7 +37,7 @@ impl Deref for CacheEntry {
/// Shared hostname-to-IP cache backed by the system DNS resolver.
pub(crate) struct DnsCache {
- resolver: Arc<Resolver<TokioConnectionProvider>>,
+ resolver: Arc<TokioResolver>,
cache: Arc<RwLock<HashMap<String, CacheEntry>>>,
}
@@ -56,9 +56,9 @@ impl DnsCache {
/// Create a new DNS cache instance.
pub(crate) fn new() -> Self {
// Initialize the Resolver with system config (e.g., /etc/resolv.conf on Unix)
- let resolver = Resolver::builder(TokioConnectionProvider::default())
- .unwrap()
- .build();
+ let mut builder = TokioResolver::builder_tokio().unwrap();
+ builder.options_mut().ip_strategy = LookupIpStrategy::Ipv4thenIpv6;
+ let resolver = builder.build().unwrap();
DnsCache {
resolver: Arc::new(resolver),
diff --git a/pgdog/src/backend/pool/test/mod.rs b/pgdog/src/backend/pool/test/mod.rs
index 2aad0cefb..a7ecdc57f 100644
--- a/pgdog/src/backend/pool/test/mod.rs
+++ b/pgdog/src/backend/pool/test/mod.rs
@@ -5,7 +5,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Duration, SystemTime};
use pgdog_config::ServerAuth;
-use rand::Rng;
+use rand::RngExt;
use tokio::spawn;
use tokio::task::yield_now;
use tokio::time::{Instant, sleep, timeout};
diff --git a/pgdog/src/backend/replication/logical/subscriber/tests.rs b/pgdog/src/backend/replication/logical/subscriber/tests.rs
index 460412b61..fe436b51a 100644
--- a/pgdog/src/backend/replication/logical/subscriber/tests.rs
+++ b/pgdog/src/backend/replication/logical/subscriber/tests.rs
@@ -1,7 +1,7 @@
use bytes::Bytes;
use pgdog_config::User;
use pgdog_postgres_types::Oid;
-use rand::Rng;
+use rand::RngExt;
use crate::{
backend::{
diff --git a/pgdog/src/backend/server.rs b/pgdog/src/backend/server.rs
index b24db5b76..3f7bd510f 100644
--- a/pgdog/src/backend/server.rs
+++ b/pgdog/src/backend/server.rs
@@ -1284,7 +1284,7 @@ impl Server {
if jitter.is_zero() {
return;
}
- use rand::Rng;
+ use rand::RngExt;
// Sampling is signed, so drop into ms locally; result goes back
// out as a Duration immediately, no leak across the API.
let jitter_ms = jitter.as_millis() as i64;
@@ -3026,7 +3026,7 @@ pub(crate) mod test {
#[tokio::test]
async fn test_drain_chaos() {
use crate::net::bind::Parameter;
- use rand::Rng;
+ use rand::RngExt;
let mut server = test_server().await;
let mut rng = rand::rng();
@@ -3705,7 +3705,7 @@ pub(crate) mod test {
}
async fn verify_server_usable(server: &mut Server) {
- use rand::Rng;
+ use rand::RngExt;
let expected: i32 = rand::rng().random_range(1..1_000_000);
let result = server
.execute(&format!("SELECT {}", expected))
diff --git a/pgdog/src/cli.rs b/pgdog/src/cli.rs
index 8b98bf3db..2cf4258e4 100644
--- a/pgdog/src/cli.rs
+++ b/pgdog/src/cli.rs
@@ -191,7 +191,7 @@ pub(crate) enum Commands {
/// Generate and print a SCRAM-SHA-256 hash from a plaintext password.
#[allow(clippy::print_stdout)]
pub(crate) fn hash_password(password: &str) {
- use rand::Rng;
+ use rand::RngExt;
let salt: [u8; 16] = rand::rng().random();
let iterations = std::num::NonZeroU32::new(4096).unwrap();
diff --git a/pgdog/src/frontend/client/query_engine/multi_step/test/simple.rs b/pgdog/src/frontend/client/query_engine/multi_step/test/simple.rs
index 676eaff7a..0aa2a6889 100644
--- a/pgdog/src/frontend/client/query_engine/multi_step/test/simple.rs
+++ b/pgdog/src/frontend/client/query_engine/multi_step/test/simple.rs
@@ -1,5 +1,5 @@
mod insert {
- use rand::{Rng, rng};
+ use rand::{RngExt, rng};
use tokio::{io::AsyncWriteExt, spawn};
use crate::{
diff --git a/pgdog/src/frontend/client/query_engine/two_pc/transaction.rs b/pgdog/src/frontend/client/query_engine/two_pc/transaction.rs
index b0db6eb9e..804299a7c 100644
--- a/pgdog/src/frontend/client/query_engine/two_pc/transaction.rs
+++ b/pgdog/src/frontend/client/query_engine/two_pc/transaction.rs
@@ -1,4 +1,4 @@
-use rand::{Rng, rng};
+use rand::{RngExt, rng};
use serde::{Deserialize, Serialize};
use std::{fmt::Display, str::FromStr};
diff --git a/pgdog/src/frontend/client/query_engine/two_pc/wal/tests/test_chaos.rs b/pgdog/src/frontend/client/query_engine/two_pc/wal/tests/test_chaos.rs
index fd2f164d7..a494647f5 100644
--- a/pgdog/src/frontend/client/query_engine/two_pc/wal/tests/test_chaos.rs
+++ b/pgdog/src/frontend/client/query_engine/two_pc/wal/tests/test_chaos.rs
@@ -2,7 +2,7 @@
use std::{sync::Arc, time::Duration};
-use rand::Rng;
+use rand::RngExt;
use tokio::time::sleep;
use super::*;
diff --git a/pgdog/src/frontend/client/sticky.rs b/pgdog/src/frontend/client/sticky.rs
index a84c6aa93..1b935c4f6 100644
--- a/pgdog/src/frontend/client/sticky.rs
+++ b/pgdog/src/frontend/client/sticky.rs
@@ -2,7 +2,7 @@
//! default routing behavior determined by the query parser.
use pgdog_config::Role;
-use rand::{Rng, rng};
+use rand::{RngExt, rng};
use crate::net::{Parameters, parameter::ParameterValue};
diff --git a/pgdog/src/frontend/client/test/test_client.rs b/pgdog/src/frontend/client/test/test_client.rs
index 415a10bec..6ea8bc114 100644
--- a/pgdog/src/frontend/client/test/test_client.rs
+++ b/pgdog/src/frontend/client/test/test_client.rs
@@ -2,7 +2,7 @@ use std::{fmt::Debug, ops::Deref};
use bytes::{BufMut, Bytes, BytesMut};
use pgdog_config::RewriteMode;
-use rand::{Rng, rng};
+use rand::{RngExt, rng};
use tokio::{
io::{AsyncReadExt, AsyncWriteExt},
net::{TcpListener, TcpStream},
diff --git a/pgdog/src/frontend/router/parser/route.rs b/pgdog/src/frontend/router/parser/route.rs
index e18944d17..594852323 100644
--- a/pgdog/src/frontend/router/parser/route.rs
+++ b/pgdog/src/frontend/router/parser/route.rs
@@ -84,7 +84,7 @@ impl From<Vec<usize>> for Shard {
/// Path a query should take and any transformations
/// that should be applied to the response.
-#[derive(Debug, Clone, Default, derive_builder::Builder)]
+#[derive(Debug, Clone, Default)]
pub(crate) struct Route {
/// Computed shard. This is where the query carrying
/// this route will go no matter what.
diff --git a/pgdog/src/net/discovery/listener.rs b/pgdog/src/net/discovery/listener.rs
index a3dd5304f..636bfee0c 100644
--- a/pgdog/src/net/discovery/listener.rs
+++ b/pgdog/src/net/discovery/listener.rs
@@ -2,7 +2,7 @@
use once_cell::sync::Lazy;
use parking_lot::Mutex;
-use rand::Rng;
+use rand::RngExt;
use tracing::{debug, error, info};
use std::collections::HashMap;
diff --git a/pgdog/src/net/messages/backend_key.rs b/pgdog/src/net/messages/backend_key.rs
index ac64af202..5e8536be9 100644
--- a/pgdog/src/net/messages/backend_key.rs
+++ b/pgdog/src/net/messages/backend_key.rs
@@ -12,7 +12,7 @@ use smallvec::SmallVec;
use super::frontend_pid::FrontendPid;
-use rand::Rng;
+use rand::RngExt;
const LEGACY_SECRET_LEN: usize = std::mem::size_of::<i32>();
const EXTENDED_SECRET_LEN: usize = 32;
const MAX_SECRET_LEN: usize = 256;
diff --git a/pgdog/src/net/messages/buffer.rs b/pgdog/src/net/messages/buffer.rs
index d0b86327f..ecc6713ce 100644
--- a/pgdog/src/net/messages/buffer.rs
+++ b/pgdog/src/net/messages/buffer.rs
@@ -218,8 +218,8 @@ mod test {
spawn(async move {
let mut conn = TcpStream::connect(addr).await.unwrap();
- use rand::{Rng, SeedableRng, rngs::StdRng};
- let mut rng = StdRng::from_os_rng();
+ use rand::{RngExt, rngs::StdRng};
+ let mut rng: StdRng = rand::make_rng();
for i in 0..5000 {
let msg = Sync.to_bytes();
diff --git a/pgdog/src/util.rs b/pgdog/src/util.rs
index 48e815246..b9df691bf 100644
--- a/pgdog/src/util.rs
+++ b/pgdog/src/util.rs
@@ -16,7 +16,7 @@ pub(crate) use time::{
use futures::future::Either;
use once_cell::sync::Lazy;
-use rand::{Rng, distr::Alphanumeric};
+use rand::{RngExt, distr::Alphanumeric};
use std::ops::ControlFlow;
use std::{env, future::Future, future::ready};
use tokio::task::{JoinError, spawn_blocking};
diff --git a/pgdog/src/util/time.rs b/pgdog/src/util/time.rs
index 003ac6ad7..aad5d2d4e 100644
--- a/pgdog/src/util/time.rs
+++ b/pgdog/src/util/time.rs
@@ -3,7 +3,7 @@
use chrono::{DateTime, Local, Utc};
use futures::{FutureExt, future::Either};
use pgdog_config::MAX_DURATION;
-use rand::Rng;
+use rand::RngExt;
use std::future::{Future, pending};
use std::panic::Location;
use std::time::{Duration, Instant};
diff --git a/plugins/pgdog-primary-only-tables/Cargo.toml b/plugins/pgdog-primary-only-tables/Cargo.toml
index efcd100d8..f566ec3a3 100644
--- a/plugins/pgdog-primary-only-tables/Cargo.toml
+++ b/plugins/pgdog-primary-only-tables/Cargo.toml
@@ -10,8 +10,8 @@ crate-type = ["cdylib"]
pgdog-plugin.workspace = true
once_cell = "1"
thiserror = "2"
-toml = "0.8"
-serde = { version = "1", features = ["derive"]}
+toml.workspace = true
+serde.workspace = true
arc-swap = "1"
tracing = "0.1"
pg_raw_parse.workspace = true
^ permalink raw [nested|flat] 4+ messages in thread
* Re: [pgdogdev/pgdog] PR #2076: security: update outdated dependencies
@ 2026-11-19 19:14 "codecov[bot] (bot) (@codecov[bot])" <noreply+codecov[bot]@github.com>
2 siblings, 0 replies; 4+ messages in thread
From: codecov[bot] (bot) (@codecov[bot]) @ 2026-11-19 19:14 UTC (permalink / raw)
To: pgdogdev/pgdog <noreply+pgdogdev-pgdog@github.com>
## [Codecov](https://app.codecov.io/gh/pgdogdev/pgdog/pull/2076?dropdown=coverage&src=pr&el=h1&utm_me...) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:loudspeaker: Thoughts on this report? [Let us know!](https://github.com/codecov/feedback/issues/255)
^ permalink raw [nested|flat] 4+ messages in thread
* Re: [pgdogdev/pgdog] PR #2076: security: update outdated dependencies
@ 2026-11-19 19:52 "github-actions[bot] (bot) (@github-actions[bot])" <noreply+github-actions[bot]@github.com>
2 siblings, 0 replies; 4+ messages in thread
From: github-actions[bot] (bot) (@github-actions[bot]) @ 2026-11-19 19:52 UTC (permalink / raw)
To: pgdogdev/pgdog <noreply+pgdogdev-pgdog@github.com>
<!-- metal-bench -->
**Metal bench (arm64) failed.** 5 of 520 measures outside bounds.
| suite | throughput | cpu/txn | user cycles/txn | user instr/txn | kernel cycles/txn | kernel instr/txn | ctx/txn |
|---|---|---|---|---|---|---|---|
| pooler | | 18.55 (-1.2% ± 0.7%) | 17,572 (-0.8% ± 0.5%) | 31,521 (+0.3% ± 0.02%) | 29,794 (-1.6% ± 1.1%) | 51,218 (+0.3% ± 0.6%) | |
| lb | | 19.22 (-0.8% ± 1.2%) | 18,047 (-1.5% ± 0.8%) | 32,336 (+0.0% ± 0.05%) | 30,742 (-0.8% ± 1.8%) | 52,208 (-0.1% ± 0.2%) | |
| sharding-w2 | | 33.85 (-0.3% ± 1.4%) | 46,521 (-0.2% ± 0.9%) | 94,991 (+0.0% ± 0.07%) | 42,038 (+0.3% ± 3.2%) | 53,632 (+0.0% ± 0.09%) | 1.541 (+0.1% ± 0.4%) |
| sharding-w8 | 239,620 (+0.2% ± 1.0%) | 30.06 (-0.3% ± 1.0%) | 46,058 (+0.2% ± 0.6%) | 50,544 (+0.0% ± 0.01%) | 37,029 (-1.0% ± 1.7%) | 42,354 (-0.1% ± 0.08%) | 0.1618 (+0.3% ± 1.0%) |
<details><summary>Counters per txn</summary>
| suite | frontend stall | l1i refill | backend stall |
|---|---|---|---|
| pooler | 6,953 (-4.1% ± 1.4%) | 2,593 (-1.1% ± 0.5%) | |
| lb | 7,143 (-5.9% ± 2.3%) | 2,629 (-1.8% ± 1.0%) | |
| sharding-w2 | 21,699 (+0.5% ± 1.7%) | 4,642 (+0.3% ± 0.7%) | |
| sharding-w8 | 22,838 (+1.9% ± 3.2%) | 4,514 (+0.7% ± 0.8%) | |
</details>
| benchmark | measure | result | baseline | change | bound |
|---|---|---|---|---|---|
| extended_evicting::set | instructions | 15,923 | 15,615 | **+1.97% ± 0.00%** | +1% |
| full_extended_cached::aggregate | instructions | 146,295 | 144,115 | **+1.51% ± 0.00%** | +1% |
| full_extended_cached::delete_all_shards | instructions | 96,354 | 95,077 | **+1.34% ± 0.00%** | +1% |
| full_named_cached::insert_split | instructions | 88,775 | 87,845 | **+1.06% ± 0.00%** | +1% |
| full_named_cached::update_by_key | instructions | 62,314 | 60,493 | **+3.01% ± 0.00%** | +1% |
Microbench: 502 of 507 measures within bounds.
<details><summary>Microbench latency: 1 benches changed more than 3%</summary>
| benchmark | latency | baseline | change | instructions change |
|---|---|---|---|---|
| full_simple::order_limit_offset | 27,664 ns | 28,670 ns | -3.49% ± 2.94% | -0.30% ± 0.00% |
</details>
<details><summary>Hot code per txn</summary>
| path | base | head | change |
|---|---|---|---|
| pooler | 114.7 KB | 115.1 KB | **+0.4 KB** |
| sharding-w2 | 169.6 KB | 170.3 KB | **+0.8 KB** |
pooler:
| crate | base | head | change |
|---|---|---|---|
| pgdog::frontend::client::query_engine | 20.2 KB | 20.4 KB | +0.2 KB |
| tokio | 18.4 KB | 18.4 KB | +0.0 KB |
| pgdog::backend::pool | 17.7 KB | 17.6 KB | -0.1 KB |
| aws-lc (TLS crypto) | 10.2 KB | 10.4 KB | +0.2 KB |
| rustls (TLS) | 8.4 KB | 8.8 KB | +0.3 KB |
| pgdog::frontend (other) | 8.0 KB | 8.1 KB | +0.1 KB |
| pgdog::backend::server | 7.7 KB | 7.7 KB | +0.0 KB |
| other | 6.2 KB | 6.1 KB | -0.1 KB |
| everything else | 17.9 KB | 17.8 KB | -0.1 KB |
| function | head | change |
|---|---|---|
| `pgdog::frontend::client::Client::run::{{closure}}` | 5.6 KB | +0.0 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 5.2 KB | +0.0 KB |
| `pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}}` | 4.4 KB | +0.1 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 3.4 KB | +0.0 KB |
| `tokio::runtime::task::raw::poll` | 3.1 KB | +0.1 KB |
sharding-w2:
| crate | base | head | change |
|---|---|---|---|
| pgdog::frontend::router | 29.3 KB | 29.4 KB | +0.1 KB |
| pgdog::frontend::client::query_engine | 21.6 KB | 21.8 KB | +0.2 KB |
| tokio | 18.8 KB | 18.9 KB | +0.2 KB |
| pgdog::backend::pool | 18.1 KB | 18.4 KB | +0.3 KB |
| aws-lc (TLS crypto) | 12.9 KB | 13.2 KB | +0.2 KB |
| other | 10.1 KB | 10.9 KB | +0.8 KB |
| pgdog::frontend (other) | 8.9 KB | 9.0 KB | +0.1 KB |
| rustls (TLS) | 8.4 KB | 8.6 KB | +0.2 KB |
| everything else | 41.4 KB | 40.0 KB | -1.4 KB |
| function | head | change |
|---|---|---|
| `pgdog::frontend::client::Client::run::{{closure}}` | 6.3 KB | +0.0 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 5.4 KB | +0.1 KB |
| `pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}}` | 4.2 KB | +0.0 KB |
| `pgdog::frontend::router::parser::query::select::<impl pgdog::frontend::router::parser::que` | 3.9 KB | +0.1 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 3.4 KB | +0.1 KB |
</details>
<details><summary>lb flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...).
</details>
<details><summary>microbench flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...).
</details>
<details><summary>pooler flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...).
</details>
<details><summary>sharding-w2 flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...).
</details>
<details><summary>sharding-w8 flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results/meskill-2026-11-19-remove-yon/f70f289aec259a62011...).
</details>
<details><summary>Logs</summary>
[lb](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results/meskill-2026-11-19-remo...), [microbench](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results/meskill-2026-11-19-remo...), [pooler](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results/meskill-2026-11-19-remo...), [sharding-w2](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results/meskill-2026-11-19-remo...), [sharding-w8](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results/meskill-2026-11-19-remo...), [verdict.json](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results/meskill-2026-11-19-remo...)
</details>
Compared f70f289a with 61e9a90b on m8g.metal-24xl (spot).
^ permalink raw [nested|flat] 4+ messages in thread
* Re: [pgdogdev/pgdog] PR #2076: security: update outdated dependencies
@ 2026-11-19 19:53 "github-actions[bot] (bot) (@github-actions[bot])" <noreply+github-actions[bot]@github.com>
2 siblings, 0 replies; 4+ messages in thread
From: github-actions[bot] (bot) (@github-actions[bot]) @ 2026-11-19 19:53 UTC (permalink / raw)
To: pgdogdev/pgdog <noreply+pgdogdev-pgdog@github.com>
<!-- metal-bench-x86 -->
**Metal bench (x86) failed.** 3 of 520 measures outside bounds.
| suite | throughput | cpu/txn | user cycles/txn | user instr/txn | kernel cycles/txn | kernel instr/txn | ctx/txn |
|---|---|---|---|---|---|---|---|
| pooler | | 25.98 (-0.2% ± 0.3%) | 18,836 (-0.4% ± 0.2%) | 32,945 (+0.4% ± 0.06%) | 33,804 (-0.1% ± 0.3%) | 36,471 (-0.0% ± 0.4%) | |
| lb | | 26.36 (-0.2% ± 0.2%) | 19,382 (-0.6% ± 0.2%) | 33,910 (+0.4% ± 0.04%) | 33,847 (-0.2% ± 0.4%) | 37,196 (+0.1% ± 0.7%) | |
| sharding-w2 | | 42.21 (-0.1% ± 1.2%) | 47,282 (-0.1% ± 0.7%) | 98,855 (+0.1% ± 0.02%) | 38,715 (-0.3% ± 2.7%) | 40,164 (-0.0% ± 0.1%) | 1.524 (-0.1% ± 0.2%) |
| sharding-w8 | 206,029 (-0.1% ± 0.4%) | 33.01 (+0.3% ± 0.7%) | 46,271 (+0.5% ± 1.3%) | 53,221 (+0.3% ± 0.2%) | 31,241 (-0.0% ± 0.2%) | 32,512 (+0.0% ± 0.08%) | 0.172 (-0.5% ± 1.8%) |
<details><summary>Counters per txn</summary>
| suite | frontend stall | l1i refill | backend stall |
|---|---|---|---|
| pooler | 3,797 (-7.9% ± 0.5%) | 1,192 (-4.2% ± 1.0%) | 36,457 (+4.9% ± 0.9%) |
| lb | 3,936 (-9.4% ± 0.5%) | 1,232 (-4.2% ± 0.7%) | 37,474 (+6.0% ± 0.5%) |
| sharding-w2 | 7,032 (-11.1% ± 1.6%) | 1,599 (-2.9% ± 1.6%) | 110,705 (+5.0% ± 3.1%) |
| sharding-w8 | 3,763 (-16.3% ± 1.5%) | 883 (-7.1% ± 1.1%) | 176,858 (+3.6% ± 2.4%) |
</details>
| benchmark | measure | result | baseline | change | bound |
|---|---|---|---|---|---|
| extended_cached::aggregate | instructions | 17,705 | 17,437 | **+1.54% ± 0.00%** | +1% |
| extended_evicting::select_all_shards | instructions | 24,996 | 24,747 | **+1.01% ± 0.00%** | +1% |
| extended_evicting::select_omni | instructions | 22,218 | 21,941 | **+1.26% ± 0.00%** | +1% |
Microbench: 504 of 507 measures within bounds.
<details><summary>Microbench latency: 43 benches changed more than 3%</summary>
| benchmark | latency | baseline | change | instructions change |
|---|---|---|---|---|
| extended_cold::begin | 2,322 ns | 2,114 ns | +9.83% ± 0.66% | +0.00% ± 0.00% |
| extended_cold::set | 2,898 ns | 2,683 ns | +8.03% ± 0.65% | +0.00% ± 0.00% |
| extended_evicting::set | 3,097 ns | 2,884 ns | +7.39% ± 0.78% | +0.00% ± 0.00% |
| simple_cold::begin | 2,090 ns | 1,952 ns | +7.06% ± 0.93% | +0.00% ± 0.00% |
| extended_evicting::begin | 2,468 ns | 2,309 ns | +6.92% ± 1.04% | +0.00% ± 0.00% |
| simple_cold::set | 2,692 ns | 2,549 ns | +5.61% ± 1.20% | +0.00% ± 0.00% |
| simple_cold::order_limit_offset | 9,135 ns | 8,662 ns | +5.46% ± 0.38% | -0.04% ± 0.00% |
| extended_cold::order_limit_offset | 9,226 ns | 8,754 ns | +5.39% ± 0.36% | -0.05% ± 0.00% |
| extended_evicting::distinct | 4,843 ns | 4,614 ns | +4.96% ± 0.91% | +0.00% ± 0.00% |
| extended_cold::insert | 6,982 ns | 6,678 ns | +4.55% ± 0.47% | -0.01% ± 0.00% |
| simple_cold::having | 18,758 ns | 17,968 ns | +4.40% ± 2.21% | +0.13% ± 0.00% |
| extended_evicting::order_limit_offset | 9,491 ns | 9,093 ns | +4.38% ± 0.71% | +0.10% ± 0.00% |
| extended_cold::having_distinct_limit | 25,028 ns | 23,992 ns | +4.32% ± 0.96% | +0.08% ± 0.00% |
| extended_cold::distinct | 4,643 ns | 4,452 ns | +4.27% ± 0.40% | +0.00% ± 0.00% |
| extended_evicting::delete_all_shards | 3,311 ns | 3,179 ns | +4.16% ± 0.58% | +0.00% ± 0.00% |
| extended_cold::insert_returning | 7,942 ns | 7,630 ns | +4.09% ± 0.38% | +0.32% ± 0.00% |
| extended_evicting::select_omni | 4,115 ns | 3,954 ns | +4.07% ± 0.65% | +1.26% ± 0.00% |
| extended_evicting::update_by_key | 4,952 ns | 4,761 ns | +4.02% ± 0.54% | +0.02% ± 0.00% |
| simple_cold::having_distinct_limit | 24,698 ns | 23,746 ns | +4.01% ± 0.78% | +0.06% ± 0.00% |
| extended_cold::delete_all_shards | 3,131 ns | 3,010 ns | +3.99% ± 0.34% | +0.00% ± 0.00% |
| extended_evicting::lookup | 5,770 ns | 5,548 ns | +3.99% ± 0.30% | +0.02% ± 0.00% |
| extended_evicting::insert_split | 17,354 ns | 16,718 ns | +3.81% ± 0.97% | -0.04% ± 0.00% |
| simple_cold::aggregate | 9,203 ns | 8,879 ns | +3.64% ± 1.15% | -0.29% ± 0.00% |
| simple_cold::insert_split | 15,710 ns | 15,158 ns | +3.64% ± 1.02% | +0.11% ± 0.00% |
| extended_cold::having | 18,858 ns | 18,200 ns | +3.62% ± 0.21% | -0.09% ± 0.00% |
| extended_evicting::group_by | 7,004 ns | 6,762 ns | +3.57% ± 0.82% | +0.01% ± 0.00% |
| extended_evicting::insert | 7,176 ns | 6,937 ns | +3.45% ± 1.02% | -0.01% ± 0.00% |
| extended_evicting::select_by_key | 5,375 ns | 5,196 ns | +3.45% ± 0.53% | +0.02% ± 0.00% |
| extended_cold::select_omni | 3,930 ns | 3,801 ns | +3.40% ± 0.47% | +0.00% ± 0.00% |
| simple_cold::select_by_key | 4,998 ns | 4,834 ns | +3.40% ± 1.74% | +0.02% ± 0.00% |
| extended_cold::group_by | 6,804 ns | 6,582 ns | +3.37% ± 0.46% | +0.00% ± 0.00% |
| extended_evicting::update_all_shards | 3,997 ns | 3,868 ns | +3.34% ± 0.87% | +0.00% ± 0.00% |
| extended_evicting::select_all_shards | 4,464 ns | 4,321 ns | +3.30% ± 0.91% | +1.01% ± 0.00% |
| extended_cold::select_by_key | 5,171 ns | 5,012 ns | +3.18% ± 0.55% | +0.02% ± 0.00% |
| extended_evicting::min_max_sum | 8,711 ns | 8,443 ns | +3.17% ± 0.39% | +0.00% ± 0.00% |
| extended_evicting::having_distinct_limit | 25,122 ns | 24,350 ns | +3.17% ± 0.58% | -0.01% ± 0.00% |
| simple_cold::distinct | 4,412 ns | 4,276 ns | +3.17% ± 0.34% | +0.00% ± 0.00% |
| full_named_cached::update_by_key | 12,702 ns | 12,318 ns | +3.12% ± 2.83% | -0.01% ± 0.00% |
| extended_cold::join | 7,882 ns | 7,648 ns | +3.06% ± 0.38% | -0.48% ± 0.00% |
| extended_evicting::having | 19,100 ns | 18,534 ns | +3.05% ± 0.33% | -0.09% ± 0.00% |
</details>
<details><summary>Hot code per txn</summary>
| path | base | head | change |
|---|---|---|---|
| pooler | 116.5 KB | 116.2 KB | **-0.2 KB** |
| sharding-w2 | 170.2 KB | 171.2 KB | **+1.0 KB** |
pooler:
| crate | base | head | change |
|---|---|---|---|
| pgdog::frontend::client::query_engine | 22.7 KB | 22.8 KB | +0.1 KB |
| pgdog::backend::pool | 18.6 KB | 18.6 KB | -0.1 KB |
| tokio | 18.6 KB | 18.3 KB | -0.2 KB |
| pgdog::frontend (other) | 9.8 KB | 9.6 KB | -0.2 KB |
| aws-lc (TLS crypto) | 9.4 KB | 8.6 KB | -0.8 KB |
| rustls (TLS) | 7.8 KB | 8.5 KB | +0.7 KB |
| pgdog::backend::server | 8.0 KB | 8.3 KB | +0.3 KB |
| other | 5.7 KB | 5.8 KB | +0.1 KB |
| everything else | 15.9 KB | 15.8 KB | -0.2 KB |
| function | head | change |
|---|---|---|
| `pgdog::frontend::client::Client::run::{{closure}}` | 7.4 KB | -0.1 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 6.4 KB | -0.2 KB |
| `pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}}` | 5.1 KB | +0.2 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 4.0 KB | +0.1 KB |
| `tokio::runtime::task::raw::poll` | 3.6 KB | -0.1 KB |
sharding-w2:
| crate | base | head | change |
|---|---|---|---|
| pgdog::frontend::router | 28.1 KB | 28.2 KB | +0.2 KB |
| pgdog::frontend::client::query_engine | 24.1 KB | 24.3 KB | +0.2 KB |
| pgdog::backend::pool | 18.8 KB | 18.8 KB | +0.1 KB |
| tokio | 18.4 KB | 18.6 KB | +0.2 KB |
| pgdog::frontend (other) | 10.8 KB | 10.8 KB | +0.0 KB |
| aws-lc (TLS crypto) | 10.4 KB | 10.6 KB | +0.2 KB |
| other | 10.3 KB | 10.5 KB | +0.2 KB |
| pgdog::backend::server | 8.9 KB | 8.9 KB | -0.1 KB |
| everything else | 40.6 KB | 40.6 KB | +0.0 KB |
| function | head | change |
|---|---|---|
| `pgdog::frontend::client::Client::run::{{closure}}` | 8.2 KB | +0.1 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 6.4 KB | +0.0 KB |
| `pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}}` | 4.8 KB | +0.1 KB |
| `pgdog::frontend::router::parser::query::select::<impl pgdog::frontend::router::parser::que` | 4.7 KB | +0.2 KB |
| `pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine:` | 3.9 KB | +0.2 KB |
</details>
<details><summary>lb flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...).
</details>
<details><summary>microbench flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...).
</details>
<details><summary>pooler flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...).
</details>
<details><summary>sharding-w2 flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...).
</details>
<details><summary>sharding-w8 flamegraph vs 61e9a90b</summary>

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...) for hover, zoom and search.

[Open interactive](https://pgdog-metal-bench.s3.amazonaws.com/results-x86/meskill-2026-11-19-remove-yon/f70f289aec259a6...).
</details>
<details><summary>Logs</summary>
[lb](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results-x86/meskill-2026-11-19-...), [microbench](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results-x86/meskill-2026-11-19-...), [pooler](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results-x86/meskill-2026-11-19-...), [sharding-w2](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results-x86/meskill-2026-11-19-...), [sharding-w8](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results-x86/meskill-2026-11-19-...), [verdict.json](https://s3.console.aws.amazon.com/s3/object/pgdog-metal-bench?prefix=results-x86/meskill-2026-11-19-...)
</details>
Compared f70f289a with 61e9a90b on c7i.metal-48xl (on-demand).
^ permalink raw [nested|flat] 4+ messages in thread
end of thread, other threads:[~2026-11-19 19:53 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 19:10 [pgdogdev/pgdog] PR #2076: security: update outdated dependencies "meskill (@meskill)" <noreply+meskill@github.com>
2026-11-19 19:14 ` "codecov[bot] (bot) (@codecov[bot])" <noreply+codecov[bot]@github.com>
2026-11-19 19:52 ` "github-actions[bot] (bot) (@github-actions[bot])" <noreply+github-actions[bot]@github.com>
2026-11-19 19:53 ` "github-actions[bot] (bot) (@github-actions[bot])" <noreply+github-actions[bot]@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox