hauleth
Ecto `or_where` "unnatural" behaviour
For me current behaviour of or_where is quite misleading and problematic. To show what I mean:
from foo in "foos",
where: foo.a == "a",
or_where. foo.b == "b",
where: foo.c == "c",
select: {foo.a, foo.b, foo.c}
Will end up as:
SELECT
foo.a,
foo.b,
foo.c
FROM foos foo
WHERE
((foo.a = "a") OR (foo.b = "b"))
AND (foo.c = "c")
Instead I would expect it to be:
SELECT
foo.a,
foo.b,
foo.c
FROM foos foo
WHERE
(foo.a = "a")
OR (foo.b = "b")
AND (foo.c = "c")
I can see why or_where was implemented how it was implemented, however I think that the second behaviour would be cleaner.
Popular in Discussions
Hi all,
I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help.
Where are they similar?
Where do they differ the m...
New
Background
This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in.
phx.gen...
New
Hey everone!
I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
New
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
If so I (and hopefully others!) might have some tips for you :slight_smile:
But first, please say which area you’re finding most challen...
New
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things.
But I don’t think this is ...
New
Other popular topics
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Hi,
I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Hi all,
I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage.
I’m trying to use Postgres...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
Hello everyone,
Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New








