metasoarous / datview

Effortlessly compose data visualizations and controls for Datomic and DataScript data
Eclipse Public License 1.0
25 stars 5 forks source link

Serialize pull and q into datomic forms #10

Open bamarco opened 8 years ago

bamarco commented 8 years ago

pull and q expressions should be serialize-able into the database itself for later reuse.

bamarco commented 8 years ago

@metasoarous Did you want additional functionality or is something like this what you're thinking?

 {:db/id #db/id[:db.part/user -200] 
    :e/type :e.type/Pull 
    :db/ident :dat.view.pull-category-item-names 
    :e/description "Pulls all the names of entities from the given category" 
    :e/pull [{:e/_Category [:e/name]}]}

 {:db/id #db/id[:db.part/user -201] 
    :e/type :e.type/Query 
    :db/ident :dat.view.choices-by-category 
    :e/description "Pulls all the names of entities from every category"
    :e/query
     [:find (pull ?category ?pull-expr)
      :where
       [?category :db/ident :e.type/Category]
       [?pull :db/ident :dat.view.pull-category-item-names]
       [?pull :e/pull ?pull-expr]]}