Skip to content

Conversation

@tobyhede
Copy link
Contributor

Add Rust/SQLx tests covering JSONB functionality in encrypted payloads.

JSONB Array Tests

  • jsonb_array_elements_text - array element extraction
  • jsonb_array_length - array size validation

JSONB Path Query Tests

  • jsonb_path_query - complex path expressions
  • jsonb_path_query_first - single result queries
  • jsonb_path_exists - path existence checks
  • Array-specific path operations

JSONB Structure Tests

  • Encrypted selector validation (ct, k, i, p, ob fields)
  • JSONB field type verification
  • Payload structure correctness

Test Helpers

  • Function call tracking verification
  • Test framework meta-tests

Migration Progress

Progress: 24/40 SQL assertions ported

  • ✅ JSONB functions: 24/24 (arrays, paths, structure validation, encrypted selectors)
  • ⏳ Equality operators: 0/16 (pending)

Test Count: 20 tests (19 functional + 1 helper)

These tests migrate all JSONB-related assertions from the original SQL test suite to the new Rust/SQLx framework, ensuring consistent behavior across PostgreSQL versions 14-17.


Depends on: #138 (infrastructure)
Next: Equality operator tests

Add Rust/SQLx tests covering JSONB functionality in encrypted payloads:

**JSONB Array Tests:**
- jsonb_array_elements_text - array element extraction
- jsonb_array_length - array size validation

**JSONB Path Query Tests:**
- jsonb_path_query - complex path expressions
- jsonb_path_query_first - single result queries
- jsonb_path_exists - path existence checks
- Array-specific path operations

**JSONB Structure Tests:**
- Encrypted selector validation (ct, k, i, p, ob fields)
- JSONB field type verification
- Payload structure correctness

**Test Helpers:**
- Function call tracking verification
- Test framework meta-tests

These tests migrate all JSONB-related assertions from the original SQL
test suite to the new Rust/SQLx framework, ensuring consistent behavior
across PostgreSQL versions 14-17.
@tobyhede tobyhede force-pushed the feature/sqlx-jsonb-tests branch from fe685f5 to 28a0eb9 Compare October 27, 2025 00:44
@tobyhede tobyhede changed the base branch from feature/sqlx-infrastructure to main October 27, 2025 02:58
Copy link
Contributor

@freshtonic freshtonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@tobyhede tobyhede merged commit ba218d3 into main Oct 27, 2025
4 checks passed
@tobyhede tobyhede deleted the feature/sqlx-jsonb-tests branch October 27, 2025 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants