Fork me on GitHub
#clojure
<
2024-06-29
>
ts150310:06:45

Hello guys! Is there a library for declaratively querying nested clojure collections? I know there is a great Specter library but I want something more similar to Datalog pull syntax.

phill10:06:17

Datascript (https://github.com/tonsky/datascript) offers datalog, but it manages its own collection.. For built-in data structures, especially if they are made up of vectors and keyword-indexed maps, these three core functions go a long way: get-in, assoc-in, update-in

ts150310:06:00

isn’t DataScript designed to work with triple stores (flat vectors) is it possible to query any other type of collections?

borkdude10:06:34

there's also something called meander, which may be close to what you're looking for

borkdude10:06:06

there's a couple of those libraries

ts150310:06:47

thanks, I’ll take a look

Drew Verlee17:06:21

@U19BK6W0L can you share your use case? Like, a psuedo example? Datascript supports pulling a tree of any depth, as long as the schema defines the tree ahead of time is the pull.

Drew Verlee17:06:51

What other type of collections are you trying to query?

vemv17:06:10

I've never used it but https://github.com/edn-query-language/eql seems decoupled from graphql