fix: handle in/notin operators in token search filters#1656
fix: handle in/notin operators in token search filters#1656rohilsurana wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR extends OrgTokensRepository.addFilter to support "in" and "notin" operators by parsing comma-separated values (using strings) and generating TEXT-cast SQL IN/NOT IN predicates from the resulting list. ChangesFilter Operator Extension
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e693f884-d065-4e95-abdd-bb22f50d3118
📒 Files selected for processing (1)
internal/store/postgres/org_tokens_repository.go
Coverage Report for CI Build 26504858608Coverage decreased (-0.02%) to 42.831%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary
in/notinoperator handling inOrgTokensRepository.addFilterinoperator requires splitting comma-separated string values into a slice for goqu'sIn()methodgoqu.Op{"in": "system.buy"}generates invalid SQL — it passes a raw string instead of a list toIN ()OrgBillingRepository.addRQLFiltersInQuerywhich already handles this correctlyRoot cause
The DataTable multiselect filter sends
operator: "in"withstringValue: "system.buy"(comma-separated for multiple values). TheaddFilterdefault case passes this directly to goqu asgoqu.Op{"in": filter.Value}, but goqu'sinneeds a slice, not a string. The fix splits the value by commas before passing toIn()/NotIn().Test plan
notinworks