Fork me on GitHub
Vincent Cantin03:10:05

Lately, I took a break away from the project, now I am back at it.

Vincent Cantin05:10:40

Today I am working on modeling a query language which will be used between the Vrac clients and the Vrac servers.

Vincent Cantin05:10:36

I will call it VracQL (VQL in short), it naturally stands for Vrac’s Query Language

Vincent Cantin09:10:20

I finished to decide for the format:

'{session [:session/title
           {:session/speakers [:speaker/name

'[(:session/title session)
  (:session/description session)
  (for [speakers (:session/speakers session)]
    [(:speaker/name speakers)
     (:speaker/bio speakers)])]

;; VQL - same semantic as above
'(let [{:session/keys [title description speakers]} session]
    (for [{:speaker/keys [name bio]} speakers]

; Returns values similarly to Clojure
["session title"
 "session description"

Vincent Cantin09:10:47

VracQL can include a directed graph of data computations, similarly to the Vrac templates.

; VQL - computed data
'[(- ( global)
     ( global))
  (count (:admin/users global))]

; VQL - let with computed data
'(let [{:admin/keys [users] [earning spending]} global
       benefit (- earning spending)
       nb-users (count users)]
    (/ benefit nb-users)])

Vincent Cantin09:10:38

VracQL is more verbose than EQL, but I like the fact that users won’t have to remember one more DSL syntax, as it is a subset of Clojure.

Vincent Cantin15:10:01

I pushed my VQL wip code at I am considering adding support for recursion in VQL later. Any suggestion about the syntax is welcome.