Skip to content

Implement Deletes for FlatPostgresCollection#270

Open
suddendust wants to merge 16 commits intohypertrace:mainfrom
suddendust:pg_write_deletes
Open

Implement Deletes for FlatPostgresCollection#270
suddendust wants to merge 16 commits intohypertrace:mainfrom
suddendust:pg_write_deletes

Conversation

@suddendust
Copy link
Contributor

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)
  • delete(query.Filter filter) - Delete using new query Filter 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 84.53039% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.65%. Comparing base (6a2b05d) to head (ca5fd33).

Files with missing lines Patch % Lines
...nsformer/LegacyFilterToQueryFilterTransformer.java 85.00% 9 Missing and 9 partials ⚠️
...documentstore/postgres/FlatPostgresCollection.java 83.33% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #270      +/-   ##
============================================
+ Coverage     80.52%   80.65%   +0.13%     
  Complexity     1396     1396              
============================================
  Files           239      240       +1     
  Lines          6695     6871     +176     
  Branches        615      638      +23     
============================================
+ Hits           5391     5542     +151     
- Misses          900      914      +14     
- Partials        404      415      +11     
Flag Coverage Δ
integration 80.65% <84.53%> (+0.13%) ⬆️
unit 53.26% <0.55%> (-1.41%) ⬇️

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
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