8000 feat: add Nil/NotNil predicates by giautm · Pull Request #2556 · ent/ent · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add Nil/NotNil predicates #2556

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

Merged
merged 2 commits into from
May 21, 2022
Merged

feat: add Nil/NotNil predicates #2556

merged 2 commits into from
May 21, 2022

Conversation

giautm
Copy link
Collaborator
@giautm giautm commented May 21, 2022

This feature allow me to write code shorter than current implement. Support entql.FieldNil and entql.FieldNotNil

-type timeNil struct {
-	entql.TimeP
-}

-func (p *timeNil) Field(name string) entql.P {
-	return entql.FieldNil(name)
-}

-		tf.WhereDeleteTime(&timeNil{})
+		tf.WhereDeleteTime(entql.TimeFunc(entql.FieldNil))

@giautm
Copy link
Collaborator Author
giautm commented May 21, 2022

Or we just support entql.TimeNil and entql.TimeNotNil?

@giautm giautm changed the title feat: add <Type>Func to allow using entgl.FieldNil feat: add Nil/NotNil predicates May 21, 2022
Copy link
Member
@a8m a8m left a comment

Choose a reason for hiding this comment

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

💯

@a8m a8m merged commit 1e05ccc into ent:master May 21, 2022
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
0