mozilla / mentat

UNMAINTAINED A persistent, relational store inspired by Datomic and DataScript.
https://mozilla.github.io/mentat/
Apache License 2.0
1.65k stars 115 forks source link

Pull improvements #682

Closed rnewman closed 6 years ago

rnewman commented 6 years ago

This PR allows aliasing of pull expressions and the use of :db/id for the entity ID itself:

(pull ?person [
    [:db/id :as :person/id]
    [:person/name :as :person/fullName]])

I wanted to flatten NamespacedKeyword, but soon realized that #648 still hasn't been wrapped up and landed, so I'll do that tomorrow. I plan to merge NamespacedKeyword and Keyword, with the only difference being a non-zero division offset and a different result from a predicate; we can preserve the restriction that all attribute names are namespaced while normalizing the API. That will make aliasing more useful.

rnewman commented 6 years ago

Rebased on top of #689: rnewman/pull-keyword.

I'm about to add non-namespaced aliases, but it'll have to wait for Monday!