3 ms·
I like the idea of building queries via functions with jQuery-like chaining. However, the whole idea of overloading operators to pass in Python functions that
by crazygringo 13y ago
I like the idea of building queries via functions with jQuery-like chaining.
However, the whole idea of overloading operators to pass in Python functions that somehow get converted... makes me feel uneasy, like it's too-clever-by-half -- having to keep track of which operators are actually supported, which client languages (Python, PHP, etc.) support it, if something's being messed up along the way...
Is there an alternative string syntax for such functions, written in a ReQL-specific language that can be used instead?
- coffeemug 13y agoThis is definitely a big concern -- we thought about this a lot (and still do). In practice, it turns out that most people pick ReQL up very easily and don't get confused or annoyed by these issues after getting acquainted with the language. That being said, we've toyed with the idea of having a string-based implementation, so people who are uneasy about these features could use the model they're already familiar with. (We didn't do this yet, but we likely will if there's enough demand for it)
- crazygringo 13y agoThanks. But, for example, how do you even do it in PHP pre-5.3, when anonymous functions became available? (I see PHP-RQL doesn't support pre-5.3). Or I guess the answer just is, you don't. So for now, ReQL won't really work with languages without anonymous functions. [Never mind, saw your reply about that below.]
- rogerbinns 13y agoAppengine NDB does the operator overloading too https://developers.google.com/appengine/docs/python/ndb/queries#filter_by_prop https://developers.google.com/appengine/docs/python/ndb/quer... Guido contributed to NDB.