Skip to content

Commit c67a576

Browse files
committed
refactor(integration): use execute() for INSERTs and document SET interpolation
Switch INSERT and SET statements from query() to execute() since they don't return meaningful rows. Add comment explaining why SET uses string interpolation (parameterized values not supported).
1 parent a0c7784 commit c67a576

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • packages/cipherstash-proxy-integration/src/multitenant

packages/cipherstash-proxy-integration/src/multitenant/contention.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ mod tests {
4040
/// Returns the ready-to-use client (connection setup is excluded from timing).
4141
async fn connect_as_tenant(keyset_id: &str) -> tokio_postgres::Client {
4242
let client = connect_with_tls(PROXY).await;
43+
// SET doesn't support parameterized values; keyset_id is from trusted env vars
4344
let sql = format!("SET CIPHERSTASH.KEYSET_ID = '{keyset_id}'");
44-
client.query(&sql, &[]).await.unwrap();
45+
client.execute(&sql, &[]).await.unwrap();
4546
client
4647
}
4748

@@ -56,7 +57,7 @@ mod tests {
5657
let id = random_id();
5758
let val = random_string();
5859
client
59-
.query(
60+
.execute(
6061
"INSERT INTO encrypted (id, encrypted_text) VALUES ($1, $2)",
6162
&[&id, &val],
6263
)
@@ -256,7 +257,7 @@ mod tests {
256257
let id = random_id();
257258
let val = random_string();
258259
client_a
259-
.query(
260+
.execute(
260261
"INSERT INTO encrypted (id, encrypted_text) VALUES ($1, $2)",
261262
&[&id, &val],
262263
)

0 commit comments

Comments
 (0)