{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/164","labels_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/164/comments","events_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/164/events","html_url":"https://github.com/balderdashy/sails-postgresql/issues/164","id":86360897,"number":164,"title":"GroupBy date parts","user":{"login":"kevinob11","id":4147929,"avatar_url":"https://avatars.githubusercontent.com/u/4147929?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinob11","html_url":"https://github.com/kevinob11","followers_url":"https://api.github.com/users/kevinob11/followers","following_url":"https://api.github.com/users/kevinob11/following{/other_user}","gists_url":"https://api.github.com/users/kevinob11/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinob11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinob11/subscriptions","organizations_url":"https://api.github.com/users/kevinob11/orgs","repos_url":"https://api.github.com/users/kevinob11/repos","events_url":"https://api.github.com/users/kevinob11/events{/privacy}","received_events_url":"https://api.github.com/users/kevinob11/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-08T22:49:01Z","updated_at":"2015-06-09T13:56:31Z","closed_at":null,"body":"I'd like to GroupBy date parts, for example:\r\n```\r\nInvoice.find().sum('total').groupBy('date').exec();\r\n```\r\nThis \"works\" but groups by each individual date and time, so you don't actually get any groups. If I want to group by month or day I need to be able to do something like:\r\n```\r\nInvoice.find().sum('total').groupBy(\"date_trunc( 'month', invoice.date)\").exec();\r\n```\r\nWhich, as expected, doesn't work. I can of course write a custom query, but then I lose all of the nice automatic where handling etc. that I get with the query builder.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/comments/110363654","html_url":"https://github.com/balderdashy/sails-postgresql/issues/164#issuecomment-110363654","issue_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/164","id":110363654,"user":{"login":"dmarcelino","id":1280446,"avatar_url":"https://avatars.githubusercontent.com/u/1280446?v=3","gravatar_id":"","url":"https://api.github.com/users/dmarcelino","html_url":"https://github.com/dmarcelino","followers_url":"https://api.github.com/users/dmarcelino/followers","following_url":"https://api.github.com/users/dmarcelino/following{/other_user}","gists_url":"https://api.github.com/users/dmarcelino/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcelino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcelino/subscriptions","organizations_url":"https://api.github.com/users/dmarcelino/orgs","repos_url":"https://api.github.com/users/dmarcelino/repos","events_url":"https://api.github.com/users/dmarcelino/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcelino/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T13:56:31Z","updated_at":"2015-06-09T13:56:31Z","body":"> What do you think about allowing for this sort of thing, @balderdashy/dmarcelino?\r\n\r\nI'd be OK with that. The same way adapters can extend waterline standard behaviour with custom methods I don't see much harm in extending the supported query syntax, assuming it's documented on the README."}}