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

Support for where/in queries #6

Closed
wants to merge 1 commit into from

Conversation

curi1119
Copy link
Contributor

@curi1119 curi1119 commented Jul 1, 2020

This PR fixies where in query.

If use where in in Ecto like follow,

Model.Employee
  |> where([x], x.employee_id in ^[3, 5, 7])
  |> Repo.all()

Etso build ETS qeury like this.

{{:"$1", :"$2", :"$3", :"$4", :"$5", :"$6", :"$7", :"$8", :"$9", :"$10", :"$11"},
 [{:orelse, {:==, :"$1", nil}, {:==, :"$1", 3}}],
 [
   [:"$1", :"$2", :"$3", :"$4", :"$5", :"$6", :"$7", :"$8", :"$9", :"$10",
    :"$11"]
 ]}

This :orelse query is not expected.

Expected :orelse:

{{:"$1", :"$2", :"$3", :"$4", :"$5", :"$6", :"$7", :"$8", :"$9", :"$10", :"$11"},
 [{:orelse, {:==, :"$1", 7}, {:orelse, {:==, :"$1", 5}, {:==, :"$1", 3}}}],
 [
   [:"$1", :"$2", :"$3", :"$4", :"$5", :"$6", :"$7", :"$8", :"$9", :"$10",
    :"$11"]
 ]}

@evadne
Copy link
Owner

evadne commented Oct 2, 2020

This is very good. Thank you.

@evadne evadne changed the title fix where in query Fixed where/in query Oct 3, 2020
evadne added a commit that referenced this pull request Oct 3, 2020
- Closes #6: Support for where/in queries
@evadne evadne changed the title Fixed where/in query Support for where/in queries Oct 3, 2020
@evadne
Copy link
Owner

evadne commented Oct 3, 2020

Merged & Released in Etso 0.1.2.

Thank you for your contribution.

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