gmr/pglifecycle ? reverse-engineered prompt
Reverse engineered prompt
Build me a command line tool for PostgreSQL schema management that lets me keep a database structure in a version controlled folder of YAML files, one file per database object, and validate those files against a schema.
I want it to be able to connect to a live PostgreSQL database and pull the schema into a project folder, or take a pg_dump archive and turn that into the same kind of project. It should also be able to build that project back into a restoreable archive that works with pg_restore, so I can recreate the database elsewhere. Include a command to create a new empty project too.
Make the user experience simple, with clear help text and sensible defaults, and include a few example files or a sample project so it’s easy to understand how the format works. If you need to check current PostgreSQL or pg_restore behavior, look up the latest docs online.
Are you gonna build this?
make sure you review the code using coderabbit