I found that I wanted something really specific, and built a tool in Go that lets you write, modify and use plpgsql functions as if they were regular source code files rather than database objects. You can write them as Go packages, import those packages into other Go projects, and write tests - without maintaining migration files for anything other than the tables. Combined with IDEA’s plpgsql language support it’s made me super productive.
I’ve used it very successfully in production for a few years and have been curious if anyone else would find it useful enough for me to open it up.
can you give more details, i am generating golang and js functions corresponding to plpgsql functions in somewhat hacky way. I am curious to know what approach have you taken, is it something similar to this project https://github.com/gchaincl/dotsql
hey sorry i didn't see this earlier. it's not a code generator, as such, it's really just a structured way to write PLPGSQL functions alongside Go code, and have it deployed and upgraded automagically.
It would be great to generate Go stubs from the SQL definitions and I don't do that. I'd like something a bit like dotsql but ideally where it creates actual Go funcs out of the SQL function signatures.
The bit that I've done so far lets you package up SQL functions into a schema and treat them as a Go package. you can include them in go.mod and the functions are maintained without writing migration scripts.
I'm under the pump at the moment but I'll try to write something up about it and maybe ping you on github some time. Sorry i don't have much time at the moment!
I’ve used it very successfully in production for a few years and have been curious if anyone else would find it useful enough for me to open it up.