Something like gleam's [squirrel](https://github.com/giacomocavalieri/squirrel) with queries kept in sql files. Could make use of ws4sql's stored statements. https://github.com/choonkeat/elm-auto-encoder-decoder may be helpful.