add bazel support
ethanpailes opened this issue · 2 comments
It would be nice to have a .bzl file that people can import into their BUILD files to easily integrate pggen
into a bazel based build system.
It seems like what we would want to do is write a custom action that basically does "Is a pggen_codegen_postgres docker container running? If not, start one. Next, run the migrations on that database. Next run pggen using that database." I think the hardest thing is figuring out a good API for the "run the migrations" step because pggen can't assume that migrations will be run in any particular way. We will also have to figure out some way of depending on docker and a postgres docker image, preferably without building from source.
cc @martinxsliu
The documentation for this should be an example with a simple project that is built with bazel
@martinxsliu I'm closing this because you already did it in our internal code repo. I don't think it makes sense to have the bazel integration in the pggen repo because the integration you wrote has some opendoor specific code.