Created
December 25, 2017 13:20
-
-
Save vrymel/57c17faf268a1e5225ce2a643aa3fce0 to your computer and use it in GitHub Desktop.
Elixir: using custom where statement with database build function calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query = from i in Intersection, | |
where: i.lat >= 100.0 or i.lat <= 200.0, | |
where: i.lng >= 200.0 or i.lng <= 400.0, | |
where: fragment("acos(sin(?) * sin(lat) + cos(?) * cos(lat) * cos(lng - (?))) <= ?", 1, 2, 3, 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment