Skip to content

Conversation

@omer-topal
Copy link
Contributor

@omer-topal omer-topal commented Jan 21, 2026

Fixes #2735

Summary by CodeRabbit

  • Chores
    • Enhanced internal database query handling for improved PostgreSQL compatibility and system stability.

✏️ Tip: You can customize this high-level summary in your review settings.

@omer-topal omer-topal requested a review from ucatbas January 21, 2026 12:57
@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

This fix addresses a PostgreSQL compatibility issue in garbage collection by replacing generic ? placeholders with PostgreSQL-specific $1, $2, ... placeholder format in two query-building functions and their corresponding test expectations.

Changes

Cohort / File(s) Summary
PostgreSQL Placeholder Format Fix for Garbage Collection
internal/storage/postgres/utils/common.go, internal/storage/postgres/utils/common_test.go
Updated GenerateGCQuery and GenerateGCQueryForTenant to use squirrel.StatementBuilder.PlaceholderFormat(squirrel.Dollar) instead of generic squirrel.Delete(), replacing ? placeholders with PostgreSQL-compatible $1, $2, ... format. Test expectations updated to reflect the new placeholder style in generated DELETE queries.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A dollar sign fixes the day,
Question marks fade away,
PostgreSQL's syntax now clean,
Garbage collection runs keen! ✨
Expired records take flight,
With placeholders done right! 💚

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: replacing incorrect ? placeholders with PostgreSQL-compatible $1, $2... placeholders in GC queries.
Linked Issues check ✅ Passed The code changes directly address the issue #2735 by replacing ? placeholders with PostgreSQL-style $1, $2... placeholders in GenerateGCQuery and GenerateGCQueryForTenant functions, fixing the syntax errors in DELETE statements.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the GC query placeholder issue with no unrelated modifications to other functionality or files outside the targeted scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.65%. Comparing base (6bec092) to head (bc4d35d).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2736      +/-   ##
==========================================
+ Coverage   82.56%   82.65%   +0.09%     
==========================================
  Files          74       74              
  Lines        8125     8125              
==========================================
+ Hits         6708     6715       +7     
+ Misses        902      892      -10     
- Partials      515      518       +3     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@omer-topal omer-topal closed this Jan 21, 2026
@omer-topal omer-topal removed the request for review from ucatbas January 21, 2026 16:10
@omer-topal omer-topal deleted the fix/postgres-gc-placeholders branch January 21, 2026 16:29
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.

[BUG] Garbage Collection fails on PostgreSQL with syntax error

2 participants