Skip to content

Commit

Permalink
pgwire
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 10, 2024
1 parent fa01cc6 commit bf02cf6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 56 deletions.
100 changes: 46 additions & 54 deletions nexus/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions nexus/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ use pgwire::{
AuthSource, LoginInfo, Password, ServerParameterProvider,
},
copy::NoopCopyHandler,
NoopErrorHandler,
portal::Portal,
query::{ExtendedQueryHandler, SimpleQueryHandler},
results::{
DescribePortalResponse, DescribeResponse, DescribeStatementResponse, Response, Tag,
},
stmt::StoredStatement,
ClientInfo, PgWireHandlerFactory, Type,
ClientInfo, PgWireServerHandlers, Type,
},
error::{ErrorInfo, PgWireError, PgWireResult},
tokio::process_socket,
Expand Down Expand Up @@ -1048,12 +1049,13 @@ pub struct Handlers {
nexus: Arc<NexusBackend>,
}

impl PgWireHandlerFactory for Handlers {
impl PgWireServerHandlers for Handlers {
type StartupHandler =
SASLScramAuthStartupHandler<FixedPasswordAuthSource, NexusServerParameterProvider>;
type SimpleQueryHandler = NexusBackend;
type ExtendedQueryHandler = NexusBackend;
type CopyHandler = NoopCopyHandler;
type ErrorHandler = NoopErrorHandler;

fn simple_query_handler(&self) -> Arc<Self::SimpleQueryHandler> {
self.nexus.clone()
Expand All @@ -1073,6 +1075,10 @@ impl PgWireHandlerFactory for Handlers {
fn copy_handler(&self) -> Arc<Self::CopyHandler> {
Arc::new(NoopCopyHandler)
}

fn error_handler(&self) -> Arc<Self::ErrorHandler> {
Arc::new(NoopErrorHandler)
}
}

#[tokio::main]
Expand Down

0 comments on commit bf02cf6

Please sign in to comment.