ecodeclub / eorm

简单 ORM 框架
Apache License 2.0
194 stars 64 forks source link

IN and NOT IN #14

Closed flycash closed 2 years ago

flycash commented 3 years ago

English Only

Please check existing issues first to avoid duplication and answer the questions below before submitting your issue.

Use case(s)

IN and NOT IN are different from other Predicate because they take slice or array as input.

Here is a point that I am not sure: should we support map? It's similar to:


// In(m)
values := valuesFromMap(m)
In(values)

Now, we don't need to take subquery into consideration.

(Please state use cases, what problem will this feature solve?)

Proposed Solution

Define two functions:

func (p Predicate) In(val interface{})
func (p Predicate) NotIn(val interface{})

(Please describe your proposed design/solution, if any)

Alternatives Considered

(Other possible options for solving the problem?)

Additional Context

Relies on #11

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)

(If you can, link to the line of code that might be helpful to explain the context)

github-actions[bot] commented 2 years ago

This issue is inactive for a long time.

github-actions[bot] commented 2 years ago

This issue is inactive for a long time.