Skip to content

Conversation

@suddendust
Copy link
Contributor

@suddendust suddendust commented Feb 3, 2026

PR: Implement Delete Operations for Flat PostgreSQL Collections

Methods Implemented

  • delete(Key key) - Delete single document by primary key
  • delete(Set keys) - Bulk delete by multiple keys
  • delete(Filter filter) - Delete using legacy Filter (delegates to new API)
  • deleteAll() - Delete all documents from collection

Why Deprecate delete(Filter filter)?

The legacy Filter class uses hardcoded JSONB document access patterns that don't work with flat collections where fields are direct PostgreSQL columns. The parsing logic assumes nested document structure.

Why New delete(query.Filter filter)?

The new query.Filter wraps FilterTypeExpression which:

  • Works with the v1 PostgresQueryParser that supports pluggable field transformers
  • Uses FlatPostgresFieldTransformer to correctly resolve field names to PostgreSQL columns
  • Properly handles nested JSONB paths via JsonIdentifierExpression
  • Maintains consistency with other query operations that already use this API

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.65%. Comparing base (57533ac) to head (4f62ffc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...documentstore/postgres/FlatPostgresCollection.java 83.33% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #270      +/-   ##
============================================
+ Coverage     80.63%   80.65%   +0.02%     
  Complexity     1396     1396              
============================================
  Files           240      240              
  Lines          6815     6871      +56     
  Branches        636      638       +2     
============================================
+ Hits           5495     5542      +47     
- Misses          907      914       +7     
- Partials        413      415       +2     
Flag Coverage Δ
integration 80.65% <83.33%> (+0.02%) ⬆️
unit 53.26% <0.00%> (-0.44%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suddendust suddendust changed the title Implement Deletes for FlatPostgresCollection [Draft] Implement Deletes for FlatPostgresCollection Feb 5, 2026
@suddendust suddendust changed the title [Draft] Implement Deletes for FlatPostgresCollection Implement Deletes for FlatPostgresCollection Feb 6, 2026
@suddendust suddendust merged commit d112d17 into hypertrace:main Feb 10, 2026
6 checks passed
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.

2 participants