11use std:: {
22 collections:: { HashMap , HashSet } ,
3- fmt:: Write ,
3+ fmt:: { Debug , Write } ,
44 fs:: File ,
55 io,
66 sync:: Arc ,
@@ -15,6 +15,7 @@ use clap::Parser;
1515use cursor:: PeerCursors ;
1616use dashmap:: { DashMap , mapref:: entry:: Entry as DashEntry } ;
1717use flow_rs:: grpc:: { FlowGrpcClient , PeerCreationResult } ;
18+ use futures:: Sink ;
1819use peer_connections:: { PeerConnectionTracker , PeerConnections } ;
1920use peer_cursor:: {
2021 QueryExecutor , QueryOutput , Schema ,
@@ -23,7 +24,7 @@ use peer_cursor::{
2324use peerdb_parser:: { NexusParsedStatement , NexusQueryParser , NexusStatement } ;
2425use pgwire:: {
2526 api:: {
26- ClientInfo , NoopErrorHandler , PgWireServerHandlers , Type ,
27+ ClientInfo , ClientPortalStore , NoopErrorHandler , PgWireServerHandlers , Type ,
2728 auth:: {
2829 AuthSource , LoginInfo , Password , ServerParameterProvider ,
2930 scram:: { SASLScramAuthStartupHandler , gen_salted_password} ,
@@ -35,8 +36,10 @@ use pgwire::{
3536 DescribePortalResponse , DescribeResponse , DescribeStatementResponse , Response , Tag ,
3637 } ,
3738 stmt:: StoredStatement ,
39+ store:: PortalStore ,
3840 } ,
3941 error:: { ErrorInfo , PgWireError , PgWireResult } ,
42+ messages:: PgWireBackendMessage ,
4043 tokio:: process_socket,
4144} ;
4245use pt:: {
@@ -751,13 +754,11 @@ impl NexusBackend {
751754
752755#[ async_trait]
753756impl SimpleQueryHandler for NexusBackend {
754- async fn do_query < ' a , C > (
755- & self ,
756- _client : & mut C ,
757- sql : & ' a str ,
758- ) -> PgWireResult < Vec < Response < ' a > > >
757+ async fn do_query < ' a , C > ( & self , _client : & mut C , sql : & str ) -> PgWireResult < Vec < Response < ' a > > >
759758 where
760- C : ClientInfo + Unpin + Send + Sync ,
759+ C : ClientInfo + ClientPortalStore + Sink < PgWireBackendMessage > + Unpin + Send + Sync ,
760+ C :: Error : Debug ,
761+ PgWireError : From < <C as Sink < PgWireBackendMessage > >:: Error > ,
761762 {
762763 let parsed = self . query_parser . parse_simple_sql ( sql) . await ?;
763764 let nexus_stmt = parsed. statement ;
@@ -818,11 +819,14 @@ impl ExtendedQueryHandler for NexusBackend {
818819 async fn do_query < ' a , C > (
819820 & self ,
820821 _client : & mut C ,
821- portal : & ' a Portal < Self :: Statement > ,
822+ portal : & Portal < Self :: Statement > ,
822823 _max_rows : usize ,
823824 ) -> PgWireResult < Response < ' a > >
824825 where
825- C : ClientInfo + Unpin + Send + Sync ,
826+ C : ClientInfo + ClientPortalStore + Sink < PgWireBackendMessage > + Unpin + Send + Sync ,
827+ C :: PortalStore : PortalStore < Statement = Self :: Statement > ,
828+ C :: Error : Debug ,
829+ PgWireError : From < <C as Sink < PgWireBackendMessage > >:: Error > ,
826830 {
827831 let stmt = & portal. statement . statement ;
828832 tracing:: info!( "[eqp] do_query: {}" , stmt. query) ;
@@ -1135,7 +1139,7 @@ pub async fn main() -> anyhow::Result<()> {
11351139 Arc :: new ( NexusServerParameterProvider ) ,
11361140 ) ;
11371141
1138- let tls_acceptor = setup_tls ( & args) ?. map ( Arc :: new ) ;
1142+ let tls_acceptor = setup_tls ( & args) ?;
11391143
11401144 let peer_conns = {
11411145 let conn_str = catalog_config. to_pg_connection_string ( ) ;
0 commit comments