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

Add gte and lte, and add criterion based query building. #135

Merged
merged 6 commits into from
Dec 5, 2019

Conversation

mvanderlee
Copy link

I really like the pypika query builder, so implemented a similar method.

Allows things like:

incident = Table('incident')
criterion_list = [
    Field('foo').eq('bar'), 
    incident.bar == 'foo'
]
query = str(reduce(operator.and_, criterion_list))
print(query)

>>> 'foo=bar^bar=foo'

print(str(Field('foo').eq('bar') | incident.bar == 'foo'))

>>> 'foo=bar^ORbar=foo'

@rbw
Copy link
Owner

rbw commented Nov 28, 2019

Looks like a nice feature! I'll take a look and test it out this weekend.

@rbw
Copy link
Owner

rbw commented Dec 1, 2019

I've looked through the code and done some basic testing, and it works really well.

I'll do some more testing during the coming week and have it incorporated into pysnow as soon as possible.

Big thanks!

@mvanderlee
Copy link
Author

Great :) thanks

@rbw rbw merged commit af44772 into rbw:master Dec 5, 2019
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