Similarly, this crate defines an abstract representation of a SQL query as understood by Mentat. This crate defines the structs and enums that are the output of the query parser and used by the translator and algebrizer. 4. To allow for reuse (e.g., the EDN parser is essentially a separate library). Our EDN parser. It uses rust-peg to parse EDN, which is Clojure/Datomic's richer alternative to JSON. Conversion to and from EDN types (e.g., Adalat : Contrôle Hypertensif à Libération Prolongée par Nifédipine edn::Keyword to TypedValue::Keyword). In addition, this crate turns a stream of EDN values into a representation suitable to be transacted.
This simple crate turns those data structures into SQL text and bindings that can later be executed by rusqlite. Fundamental domain-specific data structures like ValueType and TypedValue. A Datalog query projects some of the variables in the query into data structures in the output. Just like DataScript, Mentat speaks Datalog for querying and takes additions and retractions as input to a transaction. Common utilities (some in the util module, and others that should be moved there or broken out) like Either, InternSet, and RcCounter.
This crate takes an algebrized query and a projection list and figures out how to get values out of the running SQL query and into the right format for the consumer.
And as I've pointed out . It takes a parsed query, which at this point is independent of a database, and combines it with the current state of the schema and data. This code is a work in progress