Skip to content

Commit 93c9980

Browse files
committed
test: order by with null
1 parent 3feaea1 commit 93c9980

File tree

5 files changed

+397
-0
lines changed

5 files changed

+397
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cipherstash-proxy-integration/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ cipherstash-config = "0.2.3"
2929
clap = "4.5.32"
3030
fake = { version = "4", features = ["chrono", "derive"] }
3131
hex = "0.4.3"
32+
tap = "1.0.1"
3233
uuid = { version = "1.11.0", features = ["serde", "v4"] }

packages/cipherstash-proxy-integration/src/common.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ where
143143
.collect()
144144
}
145145

146+
// Returns a vector of `Option<String>` for each row in the result set.
147+
// Nulls are represented as `None`, and non-null values are converted to `Some(String)`.
148+
pub async fn simple_query_with_null(sql: &str) -> Vec<Option<String>> {
149+
let client = connect_with_tls(PROXY).await;
150+
let rows = client.simple_query(sql).await.unwrap();
151+
rows.iter()
152+
.filter_map(|row| {
153+
if let tokio_postgres::SimpleQueryMessage::Row(r) = row {
154+
Some(r.get(0).map(|val| val.to_string()))
155+
} else {
156+
None
157+
}
158+
})
159+
.collect()
160+
}
161+
146162
///
147163
/// Configure the client TLS settings.
148164
/// These are the settings for connecting to the database with TLS.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
mod group_by;
22
mod order_by;
3+
mod order_by_with_null;

0 commit comments

Comments
 (0)