feat: update pgwire to 0.37 (#3910)

# Description of Changes

Update pgwire to 0.37

Make `DataRowEncoder` reusable as enabled in this release, make
introduce 3x performance on encoding.

# API and ABI breaking changes

N/A

# Expected complexity level and risk

N/A

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->

---------

Signed-off-by: Ning Sun <sunning@greptime.com>
Signed-off-by: joshua-spacetime <josh@clockworklabs.io>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
This commit is contained in:
Ning Sun
2026-03-20 00:50:28 +08:00
committed by GitHub
parent 5c7d7e7c75
commit 44c4b2a4aa
4 changed files with 18 additions and 7 deletions
Generated
+14 -2
View File
@@ -5237,9 +5237,9 @@ dependencies = [
[[package]]
name = "pgwire"
version = "0.34.2"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f56a81b4fcc69016028f657a68f9b8e8a2a4b7d07684ca3298f2d3e7ff199ce"
checksum = "02d86d57e732d40382ceb9bfea80901d839bae8571aa11c06af9177aed9dfb6c"
dependencies = [
"async-trait",
"bytes",
@@ -5252,8 +5252,10 @@ dependencies = [
"postgres-types",
"rand 0.9.2",
"rust_decimal",
"ryu",
"serde",
"serde_json",
"smol_str",
"thiserror 2.0.17",
"tokio",
"tokio-util",
@@ -7432,6 +7434,16 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
[[package]]
name = "smol_str"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3498b0a27f93ef1402f20eefacfaa1691272ac4eca1cdc8c596cb0a245d6cbf5"
dependencies = [
"borsh",
"serde_core",
]
[[package]]
name = "socket2"
version = "0.5.10"
+1 -1
View File
@@ -245,7 +245,7 @@ paste = "1.0"
percent-encoding = "2.3"
petgraph = { version = "0.6.5", default-features = false }
pin-project-lite = "0.2.9"
pgwire = { version = "0.34.2", default-features = false, features = ["server-api", "pg-ext-types"] }
pgwire = { version = "0.37", default-features = false, features = ["server-api", "pg-ext-types"] }
postgres-types = "0.2.5"
pretty_assertions = { version = "1.4", features = ["unstable"] }
proc-macro2 = "1.0"
+1 -1
View File
@@ -57,7 +57,7 @@ pub(crate) fn type_of(schema: &ProductType, ty: &ProductTypeElement) -> Type {
_ => Type::ANYARRAY,
},
AlgebraicType::Product(_) => match format {
PsqlPrintFmt::Hex => Type::BYTEA_ARRAY,
PsqlPrintFmt::Hex => Type::BYTEA,
PsqlPrintFmt::Timestamp => Type::TIMESTAMP,
PsqlPrintFmt::Duration => Type::INTERVAL,
PsqlPrintFmt::Uuid => Type::UUID,
+2 -3
View File
@@ -73,9 +73,8 @@ pub(crate) fn to_rows(
let mut results = Vec::with_capacity(stmt.rows.len());
let ty = Typespace::EMPTY.with_type(&stmt.schema);
let mut encoder = DataRowEncoder::new(header.clone());
for row in stmt.rows {
let mut encoder = DataRowEncoder::new(header.clone());
for (idx, value) in ty.with_values(&row).enumerate() {
let ty = satn::PsqlType {
client: PsqlClient::Postgres,
@@ -86,7 +85,7 @@ pub(crate) fn to_rows(
let mut fmt = PsqlFormatter { encoder: &mut encoder };
value.serialize(TypedSerializer { ty: &ty, f: &mut fmt })?;
}
results.push(encoder.finish());
results.push(Ok(encoder.take_row()));
}
Ok(stream::iter(results))
}