arturo-lang / grafito

Portable, Serverless & Lightweight SQLite-based Graph Database in Arturo
MIT License
145 stars 8 forks source link

Better syntax for node creation/query helpers? #43

Open drkameleon opened 11 months ago

drkameleon commented 11 months ago

Right now, we have (let's say the "helper" is: person)

I don't particularly dislike this person.new thing, but it still looks quite verbose. To be honest, I would prefer something like person! (for creating) and person for querying, or person (for creating) and person? for querying. That's just an example.

Both make sense, but both have their own issues. 🤔

For example:

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... if person.new looks verbose to me, I can't start to explain why this looks like an... encyclopedia).

So, so, so... Open for discussion! :)