Better syntax for node creation/query helpers? #43
Labels
core functions
Issues related to the main Grafito functions
enhancement
New feature or request
open discussion
Let's all talk about it! ;-)
syntax
Issues & PRs related to our query DSL
Right now, we have (let's say the "helper" is:
person
)person.new "John"
person.new [name: "John" surname: "Doe"]
person "John"
person [surname: "Doe"]
I don't particularly dislike this
person.new
thing, but it still looks quite verbose. To be honest, I would prefer something likeperson!
(for creating) andperson
for querying, orperson
(for creating) andperson?
for querying. That's just an example.Both make sense, but both have their own issues. 🤔
For example:
!
cannot be part of an identifier (it's the only really reserved character in Arturo - it's an accepted symbol actually - but I have managed to "keep it for later"; mainly the idea would probably be to use it as a preprocessor symbol, but that's a different story...)?
in Arturo mean: "do that and expect a boolean value will be returned" (= "predicate"). So, it would kind of break our own - not too bad - rule.Another issue is that we may actually - in practice I mean - need more complicated queries.
For instance, in the different experiments I've done, I usually need something along the lines of: "get this node or create it if it doesn't exist". This can be done right now with:
person.new.unique [name: "John" surname: "Doe"]
, but well... ifperson.new
looks verbose to me, I can't start to explain why this looks like an... encyclopedia).So, so, so... Open for discussion! :)
The text was updated successfully, but these errors were encountered: