Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Join Condition Parsing for Complex Queries #69

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

ZaidMaslouhi
Copy link

Description

Enhance the join condition parsing mechanism to support more complex query scenarios, particularly those involving array-like values such as date ranges.

Key Changes

  • Modified join condition parsing to use '&' as a delimiter
  • Implemented robust handling of array values in join conditions
  • Updated documentation to reflect new parsing approach
  • Added comprehensive test coverage

Detailed Improvements

  1. Parsing Mechanism

    • Replaced existing query string parsing approach
    • Introduced '&' symbol as a new delimiter for join conditions
    • Improved support for array values in on clauses
  2. Testing

    • Added new test cases covering join conditions with array values
    • Verified parsing of complex query strings, including date range examples
  3. Documentation

    • Updated documentation to explain new join condition syntax
    • Provided clear examples of using join conditions with array values

Example Usage

# New syntax for join conditions with array values
join[]=events||id,name||on[0]=event.status||$eq||active&on[1]=event.date||$between||16-12-2023,23-12-2023

Impact

  • Increased flexibility in constructing complex join conditions
  • Better support for range-based and multi-value filters
  • More intuitive query string parsing

Related Issues

Closes #68 (if applicable)

Type of Changes

  • Bug Fix
  • Query String Parsing Improvement
  • Documentation Update

Testing

  • Comprehensive test suite added
  • Verified parsing of various join condition scenarios

@ZaidMaslouhi
Copy link
Author

@zaro

@zaro
Copy link
Member

zaro commented Dec 21, 2024

@ZaidMaslouhi I struggle to understand what is the point of this? There are two places where you change something that is configurable with hardcoded value . What is the purpose of that?

@ZaidMaslouhi
Copy link
Author

@zaro Thank you for the feedback.
You're absolutely right about preserving configurability. I'll revise the PR to:

  1. Add the '&' symbol as an optional delimiter in the configuration rather than hardcoding it
  2. Keep the existing configuration options intact
  3. Update the documentation to explain how to use different delimiters for array values in join conditions

The goal is to solve the array parsing issue while maintaining the library's flexibility.

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.

Join Condition Parsing Fails for Array Values (e.g. Date Ranges)
2 participants