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

Missing sqlalchemy operators #85

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JakNowy
Copy link
Contributor

@JakNowy JakNowy commented May 13, 2024

This implements #79 by introducing FastCRUD._get_sqlalchemy_filter() method and a dictonary of filter mappings in FastCRUD._SUPPORTED_FILTERS. Adding new sqlalchemy opertors is as simple as extending the dictonary.

It also solves the or_() operator issue:

                    ItemCRUD.get_multi(
                        name__or={'startswith': 'foo', 'endswith': 'bar'}
                    )

There is some mypy issue which I struggle to solve, but it looks like it's not required. The tests pass with good coverage.

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (03d4a2d) to head (c53f7f0).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main       #85    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           68        70     +2     
  Lines         4819      5415   +596     
==========================================
+ Hits          4819      5415   +596     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JakNowy JakNowy changed the title [WIP] Missing sqlalchemy operators Missing sqlalchemy operators May 28, 2024
@JakNowy
Copy link
Contributor Author

JakNowy commented May 28, 2024

@igorbenav this is ready for review. I'm going to add some docs tomorrow.

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.

None yet

1 participant