arrdem / shelving

A toolkit for building data stores.
Eclipse Public License 1.0
38 stars 2 forks source link

Full record decomposition #22

Closed arrdem closed 6 years ago

arrdem commented 6 years ago

This finishes off the work from #9. With this changeset, spec described substructures of entered records are only serialized as "pointers" to the structure they already relate to.

This changeset has some other stuff going on which isn't great. In order to make the pointers context free, they're qualified with the spec in which they reside. This makes it convenient for them to work as EDN reader literals (also print-dup for the compiler), which begat https://github.com/arrdem/clojure/commit/bd14f3d06c116e6d9a360e5c6d090b2fff1dda86 because .... it looks like that interface was never well considered? Definitely wasn't designed for user defined types to interface with which is a shame.

For the most part swapping out the ID machinery was harmless, although it does beg some questions about the current relation notation. It's fine at the query level I think, but a bunch of the APIs are predicated on the expectation that a spec has to be passed along with the ID because it couldn't be recovered from the ID. That's now wrong which means those signatures could be cleaned up.

Some of the docs will need overhauling as well.

arrdem commented 6 years ago

And my Maven+Clojars setup is wrong so I can't push jars from my fork? Neat.

arrdem commented 6 years ago

Example of decomposed data - It's quite a bit of legwork for storing {:foo "a" :bar 1}, but it works

{:shelving.query-test/bar
 {#shelving/id [:shelving.query-test/bar #uuid "70337053-4973-4c1a-a443-26e596581ded"]
  {:foo #shelving/id [:shelving.query-test/foo #uuid "0823365a-e751-57b2-abf0-967f8bdfece2"],
   :qux #shelving/id [:shelving.query-test/qux #uuid "1b1349bd-d9c2-5f35-a58c-ee0d8495eef1"]}},

 :shelving.query-test/qux
 {#shelving/id [:shelving.query-test/qux #uuid "1b1349bd-d9c2-5f35-a58c-ee0d8495eef1"] 1},

 :shelving.query-test/foo
 {#shelving/id [:shelving.query-test/foo #uuid "0823365a-e751-57b2-abf0-967f8bdfece2"] "a"}}
arrdem commented 6 years ago

:tada: