|
|
|
|
|
by tmountain
490 days ago
|
|
As someone who’s written a ton of PL/pgSQL code recently, I have been saving all my functions and their subsequent revisions in database migration files (Supabase). This feels like such a huge step backwards compared to browsing a well structured codebase with namespaces and modules. I know that Postgres provides schemas, and I am using them to a limited extent, but I am really speaking towards just having a tree oriented set of files on disk like I would with TypeScript, Golang, etc… and a way to refresh this tree against what’s currently active in my database. Had anyone else had a similar issue or better still, resolved it? |
|
Regarding stored procs/funcs in particular and managing them like a codebase using a declarative tool, I have a blog post about this at https://www.skeema.io/blog/2023/10/24/stored-proc-deployment... – and although my product is specific to MySQL, a lot of the concepts in the first half of that post are generic and apply to any declarative tool. Some FOSS solutions to look into for Postgres include sqldef and Tusker.