Fork me on GitHub
#off-topic
<
2019-02-04
>
souenzzo18:02:27

There is something like it for clojure https://github.com/harelba/q ? Run SQL queries on hash-maps/arrays or something like that? I know datascript. But I'm looking for SQL

souenzzo12:02:19

I'ts not about a in-memory db It's about search in colls using SQL language like datomic/datscript (d/q '[:find ?e ... :in $] [[1 2 3] [3 4 5]...] )

souenzzo12:02:09

Something like it. (data-sql "SELECT * FROM $1 WHERE name LIKE a" [{:name "a"} {:name "b"}]) ;;=> [{:name "a"}]

rutledgepaulv15:02:22

I guess I’m suggesting you could build that construct on top of an in-memory sql db. Your data-sql could add the items to a temporary db, execute the query, and return the results, close the db? I was assuming this was just for tests or something - if it’s for production code then maybe that’s a poor strategy.

souenzzo16:02:10

It's just scrapping/repl playing. performance should be OK but not a really critical thing. I'm moving some personal scripts/workflows from bash to clojure, but bash has some really cool things 😜

dominicm05:02:40

Fwiw, the tools I saw were literally just creating a sqlite db, then querying it