-
Notifications
You must be signed in to change notification settings - Fork 138
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
Writing a query using orelse (OR) in chicagoboss #185
Comments
Indeed, this is not currently possible, and something that will need to be fixed before 1.0. |
I pretty much reach for SQL whenever I have anything remotely complicated to fetch. |
Hello @davidw and @choptastic :
Or is there also anything else? Please let me know. |
Erlang does not have operator overloading, so you can't do something like that. The best way to do a complex query is boss_db:find_by_sql or boss_db:execute, so that you can just use plain old SQL and deal with the results it returns. |
@davidw : Thanks for the reply!. But I am not agree that erlang does not have operator overloading.
Please let me know, If I understood something wrong. |
Hi, ++ concatenates lists, nothing more, nothing less. It's not overloaded. You are not writing a query with "OR", but two queries and then merging the results. That should work, but it's different than writing one query. What I meant earlier was that you can't do something like Rails' Arel where you write the queries and then it merges them before running them. Of course you can do as many queries as you want and then add up the results, but that might not be very efficient. |
@davidw : Got you now! Thanks 👍 |
you can use some like this:
|
That would only work if you're looking to find a single record that matches Row1: flag1=true, flag2=true The provided query would only return Row1 and Row2, but the proper return On Tue, Oct 28, 2014 at 4:45 PM, Orlando Jimenez [email protected]
Jesse Gumm |
I think, there is no such option in boss_db API to find a query in the format
I searched a lot and finally raised a Stackoverflow Query! And came up to a decision by suggestion to raise an issue at github.
Thanks
Stackoverflow Query.
The text was updated successfully, but these errors were encountered: