by cpursley · 3y ago · 0 comments
What I really want is a state-based way to define my database. EdgeDB & Prism have made some progress here but they really only handle table changes. Really wish this were built into Postgres somehow (or any solid migration story).
I want to be able to define my tables, views, functions and everything and the engine behind it automatically figures out all the necessary changes. For example, change a table (add a column or something) and it is smart enough to update any dependent views and functions. Including handling of data migrations.
There are other notable mentions in this space:
Reshape: https://fabianlindfors.se/blog/schema-migrations-in-postgres...
Atlas: https://atlasgo.io/
A "custom" example on GitLab: https://gitlab.com/delibrium/delibrium-postgrest/-/tree/mast...
I don’t like the solution of “stop using views and functions” as I prefer to use use the full power of Postgres (everything close to the data, less application level logic, great plugins). Not sure what approach should be taken to creat a state based migration solution, but it feels like the tech around Postgres, language servers, MML, etc has matured enough to solve the issue in an automated way.
Not as advanced as you describe though, it won’t handle your data migrations.