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 option to specify addtional filters for joins #234

Merged
merged 2 commits into from Oct 20, 2021

Conversation

lafriks
Copy link
Contributor

@lafriks lafriks commented Oct 20, 2021

Currently it's not possible to specify additional conditions for query joins (for example to specify to join only not deleted records). Only workaround for this is to use Joinf that's not too nice to use as it won't provide a way to do per-adapter field escaping etc.

I added filter as optional last parameter and as side effect of this is that you can provide multiple filters that will be converted to And filter as the result.

Still need to implement changes in sql, so currently marking this as WIP

@codecov
Copy link

codecov bot commented Oct 20, 2021

Codecov Report

Merging #234 (1388ca5) into master (f63d7d7) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #234   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           56        56           
  Lines         3949      3950    +1     
=========================================
+ Hits          3949      3950    +1     
Impacted Files Coverage Δ
join_query.go 100.00% <100.00%> (ø)
query.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f63d7d7...1388ca5. Read the comment docs.

@lafriks
Copy link
Contributor Author

lafriks commented Oct 20, 2021

Does it look ok and I can move forward with sql part of this?

@Fs02
Copy link
Member

Fs02 commented Oct 20, 2021

Does it look ok and I can move forward with sql part of this?

yes, this is make sense, please go ahead

@lafriks lafriks marked this pull request as ready for review October 20, 2021 11:13
@lafriks
Copy link
Contributor Author

lafriks commented Oct 20, 2021

Can be reviewed now

join_query.go Outdated Show resolved Hide resolved
Copy link
Member

@Fs02 Fs02 left a comment

Choose a reason for hiding this comment

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

LGTM

@Fs02 Fs02 merged commit d43e3ea into go-rel:master Oct 20, 2021
@lafriks
Copy link
Contributor Author

lafriks commented Oct 20, 2021

Could you also tag when merged so I can update go-rel/sql PR

@lafriks lafriks deleted the feat/join_filter branch October 20, 2021 11:40
@Fs02
Copy link
Member

Fs02 commented Oct 20, 2021

Could you also tag when merged so I can update go-rel/sql PR

how about using master first, and tag when go-rel/sql is ready to be merged? (just incase there's fix needed in go-rel/rel)

@Fs02
Copy link
Member

Fs02 commented Oct 20, 2021

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

2 participants