can you refactor this into a separate file in io/ ? seems useful to have this writer just like there is a reader. If you generate the ER graph above as a DirectedGraph, would be great to have this writer.