Hacker News new | ask | show | jobs
by Xmd5a 77 days ago
Datalog writebacks through derived columns. Any query. Any cell. And probably any datalog-based database too, it's just a client-side trick. Works well on this:

    {:find [?title ?director ?rating ?card ?shout]
     :where [[?m :movie/title ?title]
    
             [?m :movie/vote-average ?rating]
    
             [(str ?rating) ?rating-str]
             [(concat ?title ": ") ?title-colon]
             [(concat ?title-colon ?rating-str) ?card]
    
             [(lower ?title) ?lowered]
             [(concat ?lowered "!!!") ?decorated]
             [(upper ?decorated) ?shout]
             
             ;; joints
             [?cr :crew/job "Director"]
             [?cr :crew/movie ?m]
             [?cr :crew/person ?p]
             [?p :person/name ?director]]}
You can edit a movie's ?title and ?rating through the ?card column for instance. It supports arithmetics too (to the extent that it's logically feasible of course).