e.g. I have some data (represented by OCaml types), that I want to persist, for example in a database or somewhere (maybe in a json format, or protobuf, or whatever). ppx_deriving_yojson, ocaml-protoc, or atdgen all give me a reasonable way to avoid writing the serialization/deserialization code by hand. Awesome!
However, I expect that I’ll want to change the types as development goes on (it’s inevitable), and I’d love to avoid hand-writing migration scripts for that – it seems like most of that should be automatable. e.g. if a tool was given “previous type definition” and “current type definition”, and maybe some hints about default values, it should be able to generate 80% of the code involved.
Has anyone done this? I couldn’t find anything about ppx_deriving(yojson), ocaml-protoc, or atdgen handling schema migration.
Is this a bad/unreasonable thing to want in the first place?