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

[Feature] relation filter #185

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

aknEvrnky
Copy link
Contributor

Why this PR exists?

This pull request includes a new feature which is RelationFilter for database querying. It provides us filtering the pages according to their relations.

How to use it?

Usage is quite basic. Here an example:

$database = $client->databases()->find('< DB_ID >');

$query = Query::create()
    ->changeFilter(
        CompoundFilter::and(
            DateFilter::property('delivery_date')->onOrBefore(date('Y-m-d')),
            RelationFilter::property('Project')->contains('< PAGE_ID >'),
        )
    )
    ->addSort(Sort::property("delivery_date")->ascending())
    ->changePageSize(30);

$result = $client->databases()->query($database, $query);

@codecov-commenter
Copy link

Codecov Report

Merging #185 (b2b4c93) into main (5c2a4bd) will decrease coverage by 7.93%.
The diff coverage is 96.96%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main     #185      +/-   ##
============================================
- Coverage     99.12%   91.19%   -7.93%     
- Complexity     1198     1211      +13     
============================================
  Files           129      130       +1     
  Lines          3886     3919      +33     
============================================
- Hits           3852     3574     -278     
- Misses           34      345     +311     
Impacted Files Coverage Δ
src/Databases/Query/RelationFilter.php 96.77% <96.77%> (ø)
src/Databases/Query/DateFilter.php 98.43% <100.00%> (+0.05%) ⬆️

... and 24 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mariosimao mariosimao merged commit 3d580fa into mariosimao:main Mar 24, 2023
@mariosimao mariosimao self-requested a review March 24, 2023 16:28
@mariosimao
Copy link
Owner

Hi @aknEvrnky, thanks for contributing! 😄

Your changes are now available on v1.6.0.

@aknEvrnky
Copy link
Contributor Author

Hi @aknEvrnky, thanks for contributing! 😄

Your changes are now available on v1.6.0.

Thanks, I'll be contributing if I see anything missing again.

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.

3 participants