Experiment -- Generating Graph DBs (Stoat)
Created on 2022-01-24T03:44:14-06:00
Lesson learned: sometimes its best to let one set of models produce a newer set of less abstract models.
A definition of vertices, edges and indexed fields gets procsesed in to separate models which just define the objects to store a single record (of which a vertex and edge is just a type of.)
That lower model can generate all the necessary boilerplate for the records. The graph layer above's abstractions are lost but they were not particularly relevant to the lower level at all.
This is basically how compilers work anyway.
Vertex -> Record
Edge -> Record
Records -> bookkeeping code
Parts which still need the graph data have to be generated at that higher layer.
Trying to fuse this in to one script ends up with having to do a lot of extra checks and edge cases.