Hacker News new | ask | show | jobs
by veqq 22 days ago
https://codeberg.org/veqq/declarative-dsls is built around a query language working on tables/dataframes, hashmaps, arrays, strings etc. in the same way. I ended up allowing things like :where :group-by etc. in `select` go in any order and then allowing you to use ->> macros to micromanage the execution order.
1 comments

    :set {:job "Engineer"}
    :where |(= ($ :job) "Developer")
What is going on there in that where syntax?
|(...) is the same as (fn ...) making an anonymous function. $ is an argument (in a 1 arity anonymous function.) $ is getting the whole row which is a hashmap and e.g. ({:key "value"} :key) is a way of retrieving from a hashmap. So it's "where value in column job is "Developer".