pgdiff icon indicating copy to clipboard operation
pgdiff copied to clipboard

pgdiff as a library

Open achew22 opened this issue 5 years ago • 3 comments

I was thinking about using pgdiff as part of my deployment and migration pipeline. The pipeline is already written in go and I was curious if there would be any appetite for making pgdiff into a library. Before I put in the effort to do it I wanted to ask, would you be receptive to making the package importable?

achew22 avatar Jun 09 '20 20:06 achew22

Hi Andrew, that would be pretty cool and I don't think it would be too hard. Create a pull request and I'll take a look at it.

joncrlsn avatar Jun 09 '20 23:06 joncrlsn

Hi Andrew, I was thinking more about this. If you fork this this into a library that you manage and maintain, I would port my front-end to use your library, and let people know that it is using your library. (Or if you wanted to maintain the command-line interface as well, I would change the README to point people to your project).

I don't have as much of a reason to maintain this code anymore, so you would actually be doing the community a favor by giving it some attention. And I'm very interested in keeping the project useful for others even if I don't have the time or energy I once had for it.

Maybe that's more than you wanted to take on, but I thought I'd suggest it for the good of the community.

joncrlsn avatar Jun 14 '20 19:06 joncrlsn

Hi,

With the same motivation as achew22, I have taken a stab at libraryfying pgdiff here, if anyone is still interested.

I'm also planning to refactor Schema object instantiation using the abstract factory pattern to allow different data sources. Eventually I'd like to be able to parse SQL create statements directly and cut the DB round-trip from the pipeline altogether.

Out of interest, joncrlsn; is the reduced reason to maintain this project you mention due to finding a better method for maintaining Postgres DB schema versions or have you just found that you don't need to do so as much any more?

Thanks!

facefunk avatar Jun 28 '22 15:06 facefunk