A simple-ish question: I'm quite in love with Pathom, but it only supports queries in EQL. Is there an easy-ish way to translate EQL into Datalog (or even into a subset of datalog)?
(I think I already asked this question on another channel, right? I my memory didn't fail me π)
are you trying to write to do EQL->datalog so that you can run the query on a database that doesn't support EQL, or are you trying to use datalog with pathom specifically?
Datalog with Pathom would be good π
To be honest, I saw this post: https://petevilter.me/post/datalog-typechecking/ The idea (on the post) was to expose some functionalities of the IDE as datalog queries
I really liked the idea of "I can configure and compose whatever I want just by writing datalog queries and maybe calling some APIs with the results" so I went by and experimented with EQL (because of Pathom) in my plug-ins Chlorine and Clover. So far, it's been a great success
But I think that EQL is harder to read, and there's also the issue that it returns data in a specific format only, so you have to re-filter it and mix-and-match with client-side code...
OK, based on that, it sounds like what you are looking for is a way to use datalog with pathom? not convert EQL to datalog
you would like to author queries in datalog and use them with pathom
I don't know of any way of writing datalog queries that leverage pathom. might be a good question for #pathom
Wouldn't you expose pathom resolvers that have datalog underneath them?
Or take queries as args?
I know that @wilkerlucio has been working on pathom3 which provides the ability to use "smart maps" instead of EQL. it might be interesting to explore datalog as a 3rd alternative interface to pathom
@lanejo01 I don't think that @mauricio.szabo is trying to figure out how to use a database inside of a pathom resolver; I think he wants to author queries in datalog and execute them against a pathom graph
unless I am misunderstanding!
> to author queries in datalog and execute them against a pathom graph Yes, exactly π
about Pathom and Datalog, if you get a datalog engine that can work with standard maps (and I believe most of them can), you could give it smart maps and ask for stuff, so pathom would do the data traversing, while datalog does the matching engine
that said, its also part of the pathom design to keep reshaping data (specially on Pathom 3 that supports nested inputs, so a resolver can do a full query and just reshape it in some other way)
> reshaping data what do you mean by this?
what Iβm thinking is a more generic version of it, you can always compress or expand some data via a resolver, this allows to βpickβ parts of a complex nested structure and re-shape into another structure (flat or nested in some other format)
makes sense?
yeah I think so