Skip to content

Commit

Permalink
mysql describe
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Apr 26, 2024
1 parent 74fa074 commit e1e5451
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions nexus/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl NexusBackend {
Ok(vec![res])
}
QueryOutput::Cursor(cm) => {
tracing::info!("cursor modification: {:?}", cm);
tracing::info!("cursor modification: {:?} {}", cm, peer_holder.is_some());
let mut peer_cursors = self.peer_cursors.lock().await;
match cm {
peer_cursor::CursorModification::Created(cursor_name) => {
Expand Down Expand Up @@ -985,7 +985,6 @@ impl ExtendedQueryHandler for NexusBackend {
NexusStatement::PeerQuery { stmt, assoc } => {
let schema: Option<Schema> = match assoc {
QueryAssociation::Peer(peer) => {
// if the peer is of type bigquery, let us route the query to bq.
match &peer.config {
Some(Config::BigqueryConfig(_)) => {
let executor =
Expand All @@ -997,6 +996,16 @@ impl ExtendedQueryHandler for NexusBackend {
})?;
executor.describe(stmt).await?
}
Some(Config::MysqlConfig(_)) => {
let executor =
self.get_peer_executor(peer).await.map_err(|err| {
PgWireError::ApiError(
format!("unable to get peer executor: {:?}", err)
.into(),
)
})?;
executor.describe(stmt).await?
}
Some(Config::PostgresConfig(_)) => {
let executor =
self.get_peer_executor(peer).await.map_err(|err| {
Expand All @@ -1017,10 +1026,7 @@ impl ExtendedQueryHandler for NexusBackend {
})?;
executor.describe(stmt).await?
}
Some(_peer) => {
panic!("peer type not supported: {:?}", peer)
}
None => {
_ => {
panic!("peer type not supported: {:?}", peer)
}
}
Expand Down

0 comments on commit e1e5451

Please sign in to comment.