On Fri, 11 Sep 2015 21:40:58 +0200, Martin Nowak
<code+news.digitalm...@dawg.eu> wrote:
Does anyone have a different idea how to make a nice query language?
db.get!Person.where!(p => p.age > 21 && p.name == "Peter")
Django's approach is, IMO, the cleverest and least magical one while
keeping it expressive and efficient:
Person.objects.filter(age__gt=21, name__eq='peter')
The input of `filter` is keyword argument style. So, filter can
access the dynamic argument names, in addition to their values. This
makes it easy to understand user's intent without the need to
overloaded operators or black magic (like repeated reflections
Hibernate uses) and the syntax stays clean from user's perspective as
well.
--
--
Bahman Movaqar