Skip to content

Commit 1faea84

Browse files
committed
fix: rewrite simple protocol rowdescription
1 parent 678b19c commit 1faea84

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/cipherstash-proxy/src/postgresql/backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ where
578578

579579
debug!(target: PROTOCOL, client_id = self.context.client_id, RowDescription = ?description);
580580

581-
if let Some(statement) = self.context.get_statement_from_describe() {
581+
if let Some(statement) = self.context.get_statement_for_row_decription() {
582582
let projection_types = statement
583583
.projection_columns
584584
.iter()

packages/cipherstash-proxy/src/postgresql/context/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,19 @@ impl Context {
248248
}
249249
}
250250

251+
pub fn get_statement_for_row_decription(&self) -> Option<Arc<Statement>> {
252+
if let Some(statement) = self.get_statement_from_describe() {
253+
return Some(statement.clone());
254+
}
255+
256+
if let Some(Portal::Encrypted { statement, .. }) = self.get_portal_from_execute().as_deref()
257+
{
258+
return Some(statement.clone());
259+
};
260+
261+
None
262+
}
263+
251264
pub fn get_statement_from_describe(&self) -> Option<Arc<Statement>> {
252265
let queue = self.describe.read().ok()?;
253266
let describe = queue.next()?;

0 commit comments

Comments
 (0)