What kind of queries are not working with Avram? #1153
Replies: 5 comments 5 replies
-
From @confact
|
Beta Was this translation helpful? Give feedback.
-
Bonus points if you also include an example in another library where the query would work. That way we can see how others handle it. Thank you! |
Beta Was this translation helpful? Give feedback.
-
# from rails
User.select(:name) |
Beta Was this translation helpful? Give feedback.
-
Oh, one more: SELECT COUNT(DISTINCT user_id) FROM events WHERE domain_id=#{@domain.id} AND created_at > '#{period_days}'; # from rails:
Event.where("created_at > ?", period_days).where(domain_id: @domain.id).distinct.count(:user_id) |
Beta Was this translation helpful? Give feedback.
-
Queries using joins can produce invalid sql luckyframework/avram#370 |
Beta Was this translation helpful? Give feedback.
-
SQL can get pretty wild! Sometimes Avram can’t get you what you want, but we’d like to be able to handle most queries out of the box.
Please post here with any queries that require custom SQL so we can try to get them working :D
Beta Was this translation helpful? Give feedback.
All reactions