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

feat: add support for whereNotInUnnest #225

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

taka-oyama
Copy link
Collaborator

@taka-oyama taka-oyama commented Aug 7, 2024

Summary by CodeRabbit

  • New Features

    • Introduced whereNotInUnnest method to enhance query filtering capabilities.
    • Updated whereInUnnest method to support both inclusion and exclusion scenarios.
  • Bug Fixes

    • Improved clarity and robustness of the whereInUnnest method's parameter handling.
  • Chores

    • Cleaned up unused import statements in tests to enhance code readability.
  • Tests

    • Added a new test for the whereNotInUnnest method to ensure correct functionality.

@taka-oyama taka-oyama added the enhancement New feature or request label Aug 7, 2024
@taka-oyama taka-oyama requested a review from a team August 7, 2024 05:20
@taka-oyama taka-oyama self-assigned this Aug 7, 2024
Copy link

coderabbitai bot commented Aug 7, 2024

Walkthrough

The recent update to version 8.3.0 introduces significant enhancements to the Query Builder, including a new method whereNotInUnnest for filtering results based on exclusions. Additionally, the existing whereInUnnest method has been modified to accommodate both inclusion and exclusion functionalities with an optional parameter. These changes improve the flexibility and robustness of query handling, enabling more complex filtering scenarios.

Changes

File Change Summary
src/Query/Builder.php Modified whereInUnnest to include a bool $not parameter; added new method whereNotInUnnest.
src/Query/Grammar.php Updated whereInUnnest parameter types for clarity; improved control flow for readability.
tests/Query/BuilderTest.php Removed several unused import statements for improved readability.
tests/Query/UnnestTest.php Added new test method test_whereNotInUnnest to validate the functionality of whereNotInUnnest.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fe9776e and 5769f42.

Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • src/Query/Builder.php (1 hunks)
  • src/Query/Grammar.php (2 hunks)
  • tests/Query/BuilderTest.php (1 hunks)
  • tests/Query/UnnestTest.php (1 hunks)
Files skipped from review due to trivial changes (1)
  • tests/Query/BuilderTest.php
Additional comments not posted (5)
tests/Query/UnnestTest.php (1)

77-99: LGTM! The new test method is well-structured.

The test_whereNotInUnnest method is well-written and follows the existing patterns in the class. It effectively validates the functionality of the whereNotInUnnest method.

src/Query/Grammar.php (1)

Line range hint 124-141:
LGTM! The updates improve readability and robustness.

The changes to the whereInUnnest method enhance the clarity of the expected input structure and improve the control flow by clearly separating the conditions.

src/Query/Builder.php (2)

154-167: LGTM! The updates enhance functionality.

The addition of the bool $not parameter to the whereInUnnest method expands its functionality to handle both inclusion and exclusion scenarios. The internal logic updates are appropriate and maintain consistency.


168-177: LGTM! The new method is a valuable addition.

The whereNotInUnnest method is a straightforward and valuable addition that leverages the existing whereInUnnest method to handle exclusion scenarios, enhancing the query builder's capabilities.

CHANGELOG.md (1)

1-3: Changelog entry looks good!

The entry accurately describes the addition of the whereNotInUnnest method.

@taka-oyama taka-oyama merged commit 0547763 into master Aug 7, 2024
1 check passed
@taka-oyama taka-oyama deleted the feature/unnest-negated branch August 7, 2024 07:58
@taka-oyama
Copy link
Collaborator Author

Thank you for the review

@coderabbitai coderabbitai bot mentioned this pull request Sep 18, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants