Skip to content

query operator support in server filters#256

Merged
ChuckHend merged 15 commits intomainfrom
param-search
Oct 9, 2025
Merged

query operator support in server filters#256
ChuckHend merged 15 commits intomainfrom
param-search

Conversation

@ChuckHend
Copy link
Copy Markdown
Owner

@ChuckHend ChuckHend commented Oct 9, 2025

To search such as query=iphones&product_category=eq.electronics&price=lte.1000 for iphones in electronics less than or equal to 1000 price.

@ChuckHend ChuckHend requested review from Copilot and removed request for Copilot October 9, 2025 16:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements operators support in server filters, allowing search queries to use comparison operators like eq., gt., gte., lt., and lte. with filter values. The implementation includes comprehensive SQL injection protection, maintains backward compatibility with existing filters, and adds extensive test coverage.

  • Complete redesign of the FilterValue type system to support operators with type-safe value parsing
  • Implementation of SQL injection protection through pattern detection and input validation
  • Addition of comprehensive test suite covering normal operations, edge cases, and security scenarios

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
server/tests/util.rs Updated error handling to return Result types instead of panicking
server/tests/tests.rs Added extensive test coverage for filter operators including backward compatibility and edge cases
server/src/routes/search.rs Updated to use new FilterValue structure and handle different value types in query binding
core/src/query.rs Major refactoring with new operator system, SQL injection protection, and comprehensive test suite

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread server/tests/util.rs Outdated
Comment thread core/src/query.rs Outdated
Comment thread core/src/query.rs Outdated
Comment thread core/src/query.rs Outdated
@ChuckHend ChuckHend marked this pull request as ready for review October 9, 2025 22:38
@ChuckHend ChuckHend changed the title Operators support in server filters query operators support in server filters Oct 9, 2025
@ChuckHend ChuckHend changed the title query operators support in server filters query operator support in server filters Oct 9, 2025
@ChuckHend ChuckHend merged commit db05f15 into main Oct 9, 2025
5 checks passed
@ChuckHend ChuckHend deleted the param-search branch October 9, 2025 22:39
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