arturo-lang / grafito

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

Simplify fetch syntax #2

Closed drkameleon closed 3 years ago

drkameleon commented 3 years ago

Do we really need 3 parameters?

A simple query could easily work with 2: node tag and filters:

Example:

; fetch all nodes tagged as 'person
fetch 'person ø 

; fetch all 'person nodes, with name "John"
fetch 'person [name: "John"] 

; fetch all 'person(s) that are "marriedTo" to a person named "Jane"
fetch 'person [marriedTo: what'person [name: "Jane"]] 

; fetch all 'person(s) named "John" that are "marriedTo" a person named "Jane"
fetch 'person [name: "John" marriedTo: what'person [name: "Jane"]]
drkameleon commented 3 years ago

Fixed with: https://github.com/arturo-lang/grafito/commit/458ef697db46d57fbeb3c4a1c507e2b3516d489e