Skip to content

Commit dff3fad

Browse files
authored
Merge pull request #269 from cipherstash/update-sqltk-0.10.0
Update sqltk 0.10.0
2 parents 31252bc + 31df7c0 commit dff3fad

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ strip = "none"
3535
debug = true
3636

3737
[workspace.dependencies]
38-
sqltk = { version = "0.9.0" }
38+
sqltk = { version = "0.10.0" }
3939
thiserror = "2.0.9"
4040
tokio = { version = "1.44.2", features = ["full"] }
4141
tracing = "0.1"

packages/cipherstash-proxy-integration/src/select/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ mod group_by;
22
mod order_by;
33
mod order_by_with_null;
44
mod pg_catalog;
5+
mod regression;
56
mod unmappable;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#[cfg(test)]
2+
mod tests {
3+
use crate::common::{insert, query_by, random_id, trace};
4+
5+
///
6+
/// IN clause subquery should be able to use ORDER BY
7+
///
8+
#[tokio::test]
9+
async fn select_with_order_by_in_subquery() {
10+
trace();
11+
12+
let id = random_id();
13+
let encrypted_text = "hello".to_string();
14+
15+
let sql = "INSERT INTO encrypted (id, encrypted_text) VALUES ($1, $2)";
16+
insert(sql, &[&id, &encrypted_text]).await;
17+
18+
let sql = "SELECT encrypted_text FROM encrypted WHERE id IN (SELECT id FROM encrypted WHERE id = $1 ORDER BY id DESC LIMIT 10 OFFSET 0) GROUP BY encrypted_text";
19+
20+
let result = query_by::<String>(sql, &id).await;
21+
22+
let expected = vec![encrypted_text];
23+
assert_eq!(expected, result);
24+
}
25+
}

0 commit comments

Comments
 (0)