var Article = geddy.model.Article;
Article.all({featured: false}
, {"limit":50,"skip":0,"includes":["Comment","User"],"sort":{"createdAt":"desc"}}
, callback);Creates:
SELECT DISTINCT articles."id" FROM articles LEFT OUTER JOIN comments comments ON (articles."id" = comments."article_id") LEFT OUTER JOIN users users ON (articles."user_id" = articles."id") WHERE (articles."featured" = false) ORDER BY articles."created_at" DESC LIMIT 50;And throws error:
for SELECT DISTINCT, ORDER BY expressions must appear in select list
[Mon, 16 Jun 2014 20:38:22 GMT] ERROR for SELECT DISTINCT, ORDER BY expressions must appear in select list
error: for SELECT DISTINCT, ORDER BY expressions must appear in select list