Skip to content

Commit 19c1d4f

Browse files
authored
feat: pgwire 0.33 (#197)
* feat: update pgwire to 0.33 * test: update duckdb example
1 parent 3ddbd66 commit 19c1d4f

File tree

7 files changed

+29
-50
lines changed

7 files changed

+29
-50
lines changed

Cargo.lock

Lines changed: 10 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bytes = "1.10.1"
1919
chrono = { version = "0.4", features = ["std"] }
2020
datafusion = { version = "50", default-features = false }
2121
futures = "0.3"
22-
pgwire = { version = "0.32", default-features = false }
22+
pgwire = { version = "0.33", default-features = false }
2323
postgres-types = "0.2"
2424
rust_decimal = { version = "1.38", features = ["db-postgres"] }
2525
tokio = { version = "1", default-features = false }

arrow-pg/examples/duckdb.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub struct DuckDBBackend {
2626
query_parser: Arc<NoopQueryParser>,
2727
}
2828

29+
#[derive(Debug)]
2930
struct DummyAuthSource;
3031

3132
#[async_trait]
@@ -44,7 +45,7 @@ impl AuthSource for DummyAuthSource {
4445

4546
#[async_trait]
4647
impl SimpleQueryHandler for DuckDBBackend {
47-
async fn do_query<'a, C>(&self, _client: &mut C, query: &str) -> PgWireResult<Vec<Response<'a>>>
48+
async fn do_query<C>(&self, _client: &mut C, query: &str) -> PgWireResult<Vec<Response>>
4849
where
4950
C: ClientInfo + Unpin + Send + Sync,
5051
{
@@ -152,12 +153,12 @@ impl ExtendedQueryHandler for DuckDBBackend {
152153
self.query_parser.clone()
153154
}
154155

155-
async fn do_query<'a, C>(
156+
async fn do_query<C>(
156157
&self,
157158
_client: &mut C,
158159
portal: &Portal<Self::Statement>,
159160
_max_rows: usize,
160-
) -> PgWireResult<Response<'a>>
161+
) -> PgWireResult<Response>
161162
where
162163
C: ClientInfo + Unpin + Send + Sync,
163164
{

arrow-pg/src/datatypes/df.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ use rust_decimal::Decimal;
1818

1919
use super::{arrow_schema_to_pg_fields, encode_recordbatch, into_pg_type};
2020

21-
pub async fn encode_dataframe<'a>(
22-
df: DataFrame,
23-
format: &Format,
24-
) -> PgWireResult<QueryResponse<'a>> {
21+
pub async fn encode_dataframe(df: DataFrame, format: &Format) -> PgWireResult<QueryResponse> {
2522
let fields = Arc::new(arrow_schema_to_pg_fields(df.schema().as_arrow(), format)?);
2623

2724
let recordbatch_stream = df

datafusion-postgres/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datafusion-pg-catalog = { path = "../datafusion-pg-catalog", version = "0.11.0"
2222
futures.workspace = true
2323
getset = "0.1"
2424
log = "0.4"
25-
pgwire = { workspace = true, features = ["server-api-ring", "scram"] }
25+
pgwire = { workspace = true, features = ["server-api-ring"] }
2626
postgres-types.workspace = true
2727
rust_decimal.workspace = true
2828
tokio = { version = "1.47", features = ["sync", "net"] }

datafusion-postgres/src/auth.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl PgCatalogContextProvider for AuthManager {
460460

461461
/// AuthSource implementation for integration with pgwire authentication
462462
/// Provides proper password-based authentication instead of custom startup handler
463-
#[derive(Clone)]
463+
#[derive(Clone, Debug)]
464464
pub struct DfAuthSource {
465465
pub auth_manager: Arc<AuthManager>,
466466
}
@@ -550,6 +550,7 @@ impl AuthSource for DfAuthSource {
550550
// ```
551551

552552
/// Simple AuthSource implementation that accepts any user with empty password
553+
#[derive(Debug)]
553554
pub struct SimpleAuthSource {
554555
auth_manager: Arc<AuthManager>,
555556
}

datafusion-postgres/src/handlers.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl DfSessionService {
209209
ResourceType::All
210210
}
211211

212-
fn mock_show_response<'a>(name: &str, value: &str) -> PgWireResult<QueryResponse<'a>> {
212+
fn mock_show_response(name: &str, value: &str) -> PgWireResult<QueryResponse> {
213213
let fields = vec![FieldInfo::new(
214214
name.to_string(),
215215
None,
@@ -228,11 +228,11 @@ impl DfSessionService {
228228
Ok(QueryResponse::new(Arc::new(fields), Box::pin(row_stream)))
229229
}
230230

231-
async fn try_respond_set_statements<'a, C>(
231+
async fn try_respond_set_statements<C>(
232232
&self,
233233
client: &mut C,
234234
query_lower: &str,
235-
) -> PgWireResult<Option<Response<'a>>>
235+
) -> PgWireResult<Option<Response>>
236236
where
237237
C: ClientInfo,
238238
{
@@ -310,11 +310,11 @@ impl DfSessionService {
310310
}
311311
}
312312

313-
async fn try_respond_transaction_statements<'a, C>(
313+
async fn try_respond_transaction_statements<C>(
314314
&self,
315315
client: &C,
316316
query_lower: &str,
317-
) -> PgWireResult<Option<Response<'a>>>
317+
) -> PgWireResult<Option<Response>>
318318
where
319319
C: ClientInfo,
320320
{
@@ -361,11 +361,11 @@ impl DfSessionService {
361361
}
362362
}
363363

364-
async fn try_respond_show_statements<'a, C>(
364+
async fn try_respond_show_statements<C>(
365365
&self,
366366
client: &C,
367367
query_lower: &str,
368-
) -> PgWireResult<Option<Response<'a>>>
368+
) -> PgWireResult<Option<Response>>
369369
where
370370
C: ClientInfo,
371371
{
@@ -423,7 +423,7 @@ impl DfSessionService {
423423

424424
#[async_trait]
425425
impl SimpleQueryHandler for DfSessionService {
426-
async fn do_query<'a, C>(&self, client: &mut C, query: &str) -> PgWireResult<Vec<Response<'a>>>
426+
async fn do_query<C>(&self, client: &mut C, query: &str) -> PgWireResult<Vec<Response>>
427427
where
428428
C: ClientInfo + Unpin + Send + Sync,
429429
{
@@ -599,12 +599,12 @@ impl ExtendedQueryHandler for DfSessionService {
599599
Ok(DescribePortalResponse::new(fields))
600600
}
601601

602-
async fn do_query<'a, C>(
602+
async fn do_query<C>(
603603
&self,
604604
client: &mut C,
605605
portal: &Portal<Self::Statement>,
606606
_max_rows: usize,
607-
) -> PgWireResult<Response<'a>>
607+
) -> PgWireResult<Response>
608608
where
609609
C: ClientInfo + Unpin + Send + Sync,
610610
{

0 commit comments

Comments
 (0)