Skip to content

Commit c685a72

Browse files
committed
chore: remove comments not useful outside the context of this PR
They refer to lines in files that have been deleted, and provide no value to future maintainers.
1 parent 8601b8c commit c685a72

20 files changed

+53
-230
lines changed

tests/sqlx/fixtures/config_tables.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
-- Fixture for config tests
2-
-- Converted from src/config/config_test.sql lines 4-19
32

43
DROP TABLE IF EXISTS users CASCADE;
54
CREATE TABLE users (

tests/sqlx/fixtures/encryptindex_tables.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
-- Fixture for encryptindex tests
2-
-- Converted from src/encryptindex/functions_test.sql lines 10-17
32
-- Referenced by: tests/sqlx/tests/encryptindex_tests.rs
43
--
54
-- Creates a users table with plaintext columns for testing encrypted column

tests/sqlx/tests/aggregate_tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Aggregate function tests
22
//!
3-
//! Converted from src/encrypted/aggregates_test.sql
43
//! Tests COUNT, MAX, MIN with encrypted data
54
65
use anyhow::Result;
@@ -9,7 +8,6 @@ use sqlx::PgPool;
98
#[sqlx::test]
109
async fn count_aggregate_on_encrypted_column(pool: PgPool) -> Result<()> {
1110
// Test: COUNT works with encrypted columns
12-
// Original SQL lines 13-19 in src/encrypted/aggregates_test.sql
1311

1412
let count: i64 = sqlx::query_scalar("SELECT COUNT(*) FROM ore")
1513
.fetch_one(&pool)
@@ -23,7 +21,6 @@ async fn count_aggregate_on_encrypted_column(pool: PgPool) -> Result<()> {
2321
#[sqlx::test]
2422
async fn max_aggregate_on_encrypted_column(pool: PgPool) -> Result<()> {
2523
// Test: MAX returns highest value with ORE
26-
// Original SQL lines 21-32 in src/encrypted/aggregates_test.sql
2724

2825
let max_id: i64 = sqlx::query_scalar("SELECT MAX(id) FROM ore WHERE id <= 50")
2926
.fetch_one(&pool)
@@ -37,7 +34,6 @@ async fn max_aggregate_on_encrypted_column(pool: PgPool) -> Result<()> {
3734
#[sqlx::test]
3835
async fn min_aggregate_on_encrypted_column(pool: PgPool) -> Result<()> {
3936
// Test: MIN returns lowest value with ORE
40-
// Original SQL lines 34-45 in src/encrypted/aggregates_test.sql
4137

4238
let min_id: i64 = sqlx::query_scalar("SELECT MIN(id) FROM ore WHERE id >= 10")
4339
.fetch_one(&pool)
@@ -51,7 +47,6 @@ async fn min_aggregate_on_encrypted_column(pool: PgPool) -> Result<()> {
5147
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
5248
async fn group_by_with_encrypted_column(pool: PgPool) -> Result<()> {
5349
// Test: GROUP BY works with encrypted data
54-
// Original SQL lines 47-50 in src/encrypted/aggregates_test.sql
5550
// Fixture creates 3 distinct encrypted records, each unique
5651

5752
let group_count: i64 = sqlx::query_scalar(

tests/sqlx/tests/comparison_tests.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Comparison operator tests (< > <= >=)
22
//!
3-
//! Converted from src/operators/<_test.sql, >_test.sql, <=_test.sql, >=_test.sql
43
//! Tests EQL comparison operators with ORE (Order-Revealing Encryption)
54
65
use anyhow::{Context, Result};
@@ -47,7 +46,6 @@ async fn create_encrypted_json_with_index(
4746
async fn less_than_operator_with_ore(pool: PgPool) -> Result<()> {
4847
// Test: e < e with ORE encryption
4948
// Value 42 should have 41 records less than it (1-41)
50-
// Original SQL lines 13-20 in src/operators/<_test.sql
5149
// Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
5250

5351
// Get encrypted value for id=42 from pre-seeded ore table
@@ -67,7 +65,6 @@ async fn less_than_operator_with_ore(pool: PgPool) -> Result<()> {
6765
#[sqlx::test]
6866
async fn lt_function_with_ore(pool: PgPool) -> Result<()> {
6967
// Test: eql_v2.lt() function with ORE
70-
// Original SQL lines 30-37 in src/operators/<_test.sql
7168

7269
let ore_term = get_ore_encrypted(&pool, 42).await?;
7370

@@ -120,7 +117,6 @@ async fn less_than_operator_jsonb_less_than_encrypted(pool: PgPool) -> Result<()
120117
async fn greater_than_operator_with_ore(pool: PgPool) -> Result<()> {
121118
// Test: e > e with ORE encryption
122119
// Value 42 should have 57 records greater than it (43-99)
123-
// Original SQL lines 13-20 in src/operators/>_test.sql
124120
// Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
125121

126122
let ore_term = get_ore_encrypted(&pool, 42).await?;
@@ -138,7 +134,6 @@ async fn greater_than_operator_with_ore(pool: PgPool) -> Result<()> {
138134
#[sqlx::test]
139135
async fn gt_function_with_ore(pool: PgPool) -> Result<()> {
140136
// Test: eql_v2.gt() function with ORE
141-
// Original SQL lines 30-37 in src/operators/>_test.sql
142137

143138
let ore_term = get_ore_encrypted(&pool, 42).await?;
144139

@@ -190,7 +185,6 @@ async fn greater_than_operator_jsonb_greater_than_encrypted(pool: PgPool) -> Res
190185
async fn less_than_or_equal_operator_with_ore(pool: PgPool) -> Result<()> {
191186
// Test: e <= e with ORE encryption
192187
// Value 42 should have 42 records <= it (1-42 inclusive)
193-
// Original SQL lines 10-24 in src/operators/<=_test.sql
194188
// Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
195189

196190
let ore_term = get_ore_encrypted(&pool, 42).await?;
@@ -209,7 +203,6 @@ async fn less_than_or_equal_operator_with_ore(pool: PgPool) -> Result<()> {
209203
#[sqlx::test]
210204
async fn lte_function_with_ore(pool: PgPool) -> Result<()> {
211205
// Test: eql_v2.lte() function with ORE
212-
// Original SQL lines 32-46 in src/operators/<=_test.sql
213206

214207
let ore_term = get_ore_encrypted(&pool, 42).await?;
215208

@@ -226,7 +219,6 @@ async fn lte_function_with_ore(pool: PgPool) -> Result<()> {
226219
#[sqlx::test]
227220
async fn less_than_or_equal_with_jsonb(pool: PgPool) -> Result<()> {
228221
// Test: e <= jsonb with ORE
229-
// Original SQL lines 55-69 in src/operators/<=_test.sql
230222

231223
let json_value = get_ore_encrypted_as_jsonb(&pool, 42).await?;
232224

@@ -260,7 +252,6 @@ async fn less_than_or_equal_jsonb_lte_encrypted(pool: PgPool) -> Result<()> {
260252
async fn greater_than_or_equal_operator_with_ore(pool: PgPool) -> Result<()> {
261253
// Test: e >= e with ORE encryption
262254
// Value 42 should have 58 records >= it (42-99 inclusive)
263-
// Original SQL lines 10-24 in src/operators/>=_test.sql
264255
// Uses ore table from migrations/002_install_ore_data.sql (ids 1-99)
265256

266257
let ore_term = get_ore_encrypted(&pool, 42).await?;
@@ -278,7 +269,6 @@ async fn greater_than_or_equal_operator_with_ore(pool: PgPool) -> Result<()> {
278269
#[sqlx::test]
279270
async fn gte_function_with_ore(pool: PgPool) -> Result<()> {
280271
// Test: eql_v2.gte() function with ORE
281-
// Original SQL lines 32-46 in src/operators/>=_test.sql
282272

283273
let ore_term = get_ore_encrypted(&pool, 42).await?;
284274

@@ -295,7 +285,6 @@ async fn gte_function_with_ore(pool: PgPool) -> Result<()> {
295285
#[sqlx::test]
296286
async fn greater_than_or_equal_with_jsonb(pool: PgPool) -> Result<()> {
297287
// Test: e >= jsonb with ORE
298-
// Original SQL lines 55-85 in src/operators/>=_test.sql
299288

300289
let json_value = get_ore_encrypted_as_jsonb(&pool, 42).await?;
301290

@@ -309,7 +298,6 @@ async fn greater_than_or_equal_with_jsonb(pool: PgPool) -> Result<()> {
309298
#[sqlx::test]
310299
async fn greater_than_or_equal_jsonb_gte_encrypted(pool: PgPool) -> Result<()> {
311300
// Test: jsonb >= e with ORE (reverse direction)
312-
// Original SQL lines 77-80 in src/operators/>=_test.sql
313301

314302
let json_value = get_ore_encrypted_as_jsonb(&pool, 42).await?;
315303

tests/sqlx/tests/config_tests.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Configuration management tests
22
//!
3-
//! Converted from src/config/config_test.sql
43
//! Tests EQL configuration add/remove operations and state management
54
65
use anyhow::{Context, Result};
@@ -36,7 +35,6 @@ async fn search_config_exists(
3635
#[sqlx::test(fixtures(path = "../fixtures", scripts("config_tables")))]
3736
async fn add_and_remove_multiple_indexes(pool: PgPool) -> Result<()> {
3837
// Test: Add and remove multiple indexes (6 assertions)
39-
// Original SQL lines 42-67 in src/config/config_test.sql
4038

4139
// Truncate config
4240
sqlx::query("TRUNCATE TABLE eql_v2_configuration")
@@ -108,7 +106,6 @@ async fn add_and_remove_multiple_indexes(pool: PgPool) -> Result<()> {
108106
#[sqlx::test(fixtures(path = "../fixtures", scripts("config_tables")))]
109107
async fn add_and_remove_indexes_from_multiple_tables(pool: PgPool) -> Result<()> {
110108
// Test: Add/remove indexes from multiple tables (9 assertions)
111-
// Original SQL lines 78-116 in src/config/config_test.sql
112109

113110
sqlx::query("TRUNCATE TABLE eql_v2_configuration")
114111
.execute(&pool)
@@ -210,7 +207,6 @@ async fn add_and_remove_indexes_from_multiple_tables(pool: PgPool) -> Result<()>
210207
#[sqlx::test(fixtures(path = "../fixtures", scripts("config_tables")))]
211208
async fn add_and_modify_index(pool: PgPool) -> Result<()> {
212209
// Test: Add and modify index (6 assertions)
213-
// Original SQL lines 128-150 in src/config/config_test.sql
214210

215211
// Add match index
216212
sqlx::query("SELECT eql_v2.add_search_config('users', 'name', 'match', migrating => true)")
@@ -290,7 +286,6 @@ async fn add_and_modify_index(pool: PgPool) -> Result<()> {
290286
#[sqlx::test(fixtures(path = "../fixtures", scripts("config_tables")))]
291287
async fn add_index_with_existing_active_config(pool: PgPool) -> Result<()> {
292288
// Test: Adding index creates new pending configuration when active config exists (3 assertions)
293-
// Original SQL lines 157-196 in src/config/config_test.sql
294289

295290
sqlx::query("TRUNCATE TABLE eql_v2_configuration")
296291
.execute(&pool)
@@ -351,7 +346,6 @@ async fn add_index_with_existing_active_config(pool: PgPool) -> Result<()> {
351346
#[sqlx::test(fixtures(path = "../fixtures", scripts("config_tables")))]
352347
async fn add_column_to_nonexistent_table_fails(pool: PgPool) -> Result<()> {
353348
// Test: Adding column to nonexistent table fails (2 assertions)
354-
// Original SQL lines 204-215 in src/config/config_test.sql
355349

356350
sqlx::query("TRUNCATE TABLE eql_v2_configuration")
357351
.execute(&pool)
@@ -382,7 +376,6 @@ async fn add_column_to_nonexistent_table_fails(pool: PgPool) -> Result<()> {
382376
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
383377
async fn add_and_remove_column(pool: PgPool) -> Result<()> {
384378
// Test: Add and remove column (4 assertions)
385-
// Original SQL lines 223-248 in src/config/config_test.sql
386379

387380
sqlx::query("TRUNCATE TABLE eql_v2_configuration")
388381
.execute(&pool)
@@ -433,7 +426,6 @@ async fn add_and_remove_column(pool: PgPool) -> Result<()> {
433426
#[sqlx::test(fixtures(path = "../fixtures", scripts("config_tables")))]
434427
async fn configuration_constraint_validation(pool: PgPool) -> Result<()> {
435428
// Test: Configuration constraint validation (11 assertions)
436-
// Original SQL lines 259-334 in src/config/config_test.sql
437429

438430
sqlx::query("TRUNCATE TABLE eql_v2_configuration")
439431
.execute(&pool)

tests/sqlx/tests/constraint_tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Constraint tests
22
//!
3-
//! Converted from src/encrypted/constraints_test.sql
43
//! Tests UNIQUE, NOT NULL, CHECK constraints on encrypted columns
54
65
use anyhow::Result;
@@ -9,7 +8,6 @@ use sqlx::PgPool;
98
#[sqlx::test(fixtures(path = "../fixtures", scripts("constraint_tables")))]
109
async fn unique_constraint_on_encrypted_column(pool: PgPool) -> Result<()> {
1110
// Test: UNIQUE constraint enforced on encrypted column (3 assertions)
12-
// Original SQL lines 13-35 in src/encrypted/constraints_test.sql
1311

1412
// Insert first record (provide check_field to satisfy its constraint)
1513
sqlx::query(
@@ -52,7 +50,6 @@ async fn unique_constraint_on_encrypted_column(pool: PgPool) -> Result<()> {
5250
#[sqlx::test(fixtures(path = "../fixtures", scripts("constraint_tables")))]
5351
async fn not_null_constraint_on_encrypted_column(pool: PgPool) -> Result<()> {
5452
// Test: NOT NULL constraint enforced (2 assertions)
55-
// Original SQL lines 37-52 in src/encrypted/constraints_test.sql
5653

5754
let result = sqlx::query(
5855
"INSERT INTO constrained (unique_field)
@@ -76,7 +73,6 @@ async fn not_null_constraint_on_encrypted_column(pool: PgPool) -> Result<()> {
7673
#[sqlx::test(fixtures(path = "../fixtures", scripts("constraint_tables")))]
7774
async fn check_constraint_on_encrypted_column(pool: PgPool) -> Result<()> {
7875
// Test: CHECK constraint enforced (2 assertions)
79-
// Original SQL lines 54-72 in src/encrypted/constraints_test.sql
8076

8177
let result = sqlx::query(
8278
"INSERT INTO constrained (unique_field, not_null_field, check_field)
@@ -105,7 +101,6 @@ async fn check_constraint_on_encrypted_column(pool: PgPool) -> Result<()> {
105101
async fn foreign_key_constraint_with_encrypted(pool: PgPool) -> Result<()> {
106102
// Test: Foreign key constraints can be defined on encrypted columns
107103
// but don't provide referential integrity since each encryption is unique
108-
// Original SQL lines 74-139 in src/encrypted/constraints_test.sql
109104

110105
// Create parent table
111106
sqlx::query(

tests/sqlx/tests/containment_tests.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Containment operator tests (@> and <@)
22
//!
3-
//! Converted from src/operators/@>_test.sql and <@_test.sql
43
//! Tests encrypted JSONB containment operations
54
65
use anyhow::Result;
@@ -14,7 +13,6 @@ use sqlx::PgPool;
1413
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
1514
async fn contains_operator_self_containment(pool: PgPool) -> Result<()> {
1615
// Test: encrypted value contains itself
17-
// Original SQL lines 13-25 in src/operators/@>_test.sql
1816
// Tests that a @> b when a == b
1917

2018
let sql = "SELECT e FROM encrypted WHERE e @> e LIMIT 1";
@@ -27,7 +25,6 @@ async fn contains_operator_self_containment(pool: PgPool) -> Result<()> {
2725
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
2826
async fn contains_operator_with_extracted_term(pool: PgPool) -> Result<()> {
2927
// Test: e @> term where term is extracted from encrypted value
30-
// Original SQL lines 34-51 in src/operators/@>_test.sql
3128
// Tests containment with extracted field ($.n selector)
3229

3330
let sql = format!(
@@ -43,7 +40,6 @@ async fn contains_operator_with_extracted_term(pool: PgPool) -> Result<()> {
4340
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
4441
async fn contains_operator_term_does_not_contain_full_value(pool: PgPool) -> Result<()> {
4542
// Test: term does NOT contain full encrypted value (asymmetric containment)
46-
// Original SQL lines 48-49 in src/operators/@>_test.sql
4743
// Verifies that while e @> term is true, term @> e is false
4844

4945
let sql = format!(
@@ -60,7 +56,6 @@ async fn contains_operator_term_does_not_contain_full_value(pool: PgPool) -> Res
6056
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
6157
async fn contains_operator_with_encrypted_term(pool: PgPool) -> Result<()> {
6258
// Test: e @> encrypted_term with encrypted selector
63-
// Original SQL lines 68-90 in src/operators/@>_test.sql
6459
// Uses encrypted test data with $.hello selector
6560

6661
let term = get_encrypted_term(&pool, Selectors::HELLO).await?;
@@ -79,7 +74,6 @@ async fn contains_operator_with_encrypted_term(pool: PgPool) -> Result<()> {
7974
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
8075
async fn contains_operator_count_matches(pool: PgPool) -> Result<()> {
8176
// Test: e @> term returns correct count
82-
// Original SQL lines 84-87 in src/operators/@>_test.sql
8377
// Verifies count of records containing the term
8478

8579
let term = get_encrypted_term(&pool, Selectors::HELLO).await?;
@@ -99,7 +93,6 @@ async fn contains_operator_count_matches(pool: PgPool) -> Result<()> {
9993
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
10094
async fn contained_by_operator_with_encrypted_term(pool: PgPool) -> Result<()> {
10195
// Test: term <@ e (contained by)
102-
// Original SQL lines 19-41 in src/operators/<@_test.sql
10396
// Tests that extracted term is contained by the original encrypted value
10497

10598
let term = get_encrypted_term(&pool, Selectors::HELLO).await?;
@@ -118,7 +111,6 @@ async fn contained_by_operator_with_encrypted_term(pool: PgPool) -> Result<()> {
118111
#[sqlx::test(fixtures(path = "../fixtures", scripts("encrypted_json")))]
119112
async fn contained_by_operator_count_matches(pool: PgPool) -> Result<()> {
120113
// Test: term <@ e returns correct count
121-
// Original SQL lines 35-38 in src/operators/<@_test.sql
122114
// Verifies count of records containing the term
123115

124116
let term = get_encrypted_term(&pool, Selectors::HELLO).await?;

0 commit comments

Comments
 (0)