Created
July 22, 2015 11:28
-
-
Save bcardarella/106e158c2a7aaa6f65f8 to your computer and use it in GitHub Desktop.
This file contains 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
#Ecto.Query<from e in SogApi.Event, | |
where: fragment("extract(month from ?) = ?", e.start_time, type(^"1", :integer)), | |
where: fragment("extract(year from ?) = ?", e.start_time, type(^"2015", :integer))> | |
{"SELECT e0.\"id\", e0.\"title\", e0.\"description\", e0.\"slug\", e0.\"price\", e0.\"total_spots\", e0.\"start_time\", e0.\"end_time\", e0.\"track\", e0.\"status\", e0.\"banner_image\", e0.\"overview\", e0.\"come_prepared\", e0.\"takeaways\", e0.\"teachers\", e0.\"guest | |
s\", e0.\"inserted_at\", e0.\"updated_at\", e0.\"location_id\", e0.\"category_id\" FROM \"events\" AS e0 WHERE (extract(month from e0.\"start_time\") = $1::integer) AND (extract(year from e0.\"start_time\") = $1::integer)", | |
[1, 2015]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment