Closed mysticmind closed 1 year ago
In the Java world this is solved e.g. by https://github.com/opentable/otj-pg-embedded and https://github.com/yandex-qatools/postgresql-embedded whereas the opentable implementation is superior.
Thanks @AndreasKl I have had a look at these projects when I was starting on the implementation but had focused on using https://www.nuget.org/packages/PostgreSql.Binaries.Lite/ which only supported Windows. I will have a re-look at the opentable implementation on how the *nix PG binary files are used.
So at this point this package only works on windows right?
So at this point this package only works on windows right?
Yep!
It looks like PostgreSql.Binaries.Lite
has support for linux64 now. Any chance this library can be updated to work with linux?
I have some plans to deal with this, will keep you posted. Note that the binaries lite is also not kept upto date.
To people subscribed to this thread: I've been working over the last bit to create an up-to-date embedded postgres package similar to this one that will also include Linux support: https://github.com/atrauzzi/protoculture-dotnet-postgres
@mysticmind -- I've taken a little bit of a different approach to what you've done here, but I would still love any input or tales from the trenches you might have in creating this library.
I'm working to get through a few Windows-specific snags but once that's done, it'll be an embedded postgres that will work on linux, Windows and with the door open to add macOS support later down the line. ARM and AMD64 alike.
@atrauzzi I had a look at what you have implemented, the embedding approach look okay since you don't need to download the files on demand. But it only supports running on 14.1.
With regards to my library, the following were few goals to support (all of these are supported in the current version):
Note that for the case of running unit tests, users definitely want to use different Postgres versions and running a bunch of extensions as well according to their requirement. So just running on the highest version like 14.x many not be sufficient. If you look at cloud providers, managed Postgres also includes a bunch of popular extensions as well, this is a definite requirement as I see it.
I am still planning to enhance my library to support Linux and also handle the goals outlined above. I have been busy with my day job and also was down sick for several weeks now so couldn't spend much time on this.
All said, thanks for reaching out and being open. I am happy that you have an implementation functional on Linux using the embedded approach bundling the files which is a good thing and will be useful for end users 👍
Thank you!
I have some ideas around supporting extensions by layering dependent package outputs. I might bundle in very common ones like postgis though.
Regarding postgres version, are you aware of any really glaring backwards incompatibility scenarios? I definitely should make myself aware, but I figure the package version itself would end up abstracting the postgres version.
are there any updates on *nix support?
@murlakatam I had not been able to spend time and bandwidth on this, will see if I can spend time to get this going in March.
I spent some time today and figured out a very elegant and easy solution to solve this. Keep an eye on this, I should be able to close this by next week.
@murlakatam FYI.
Apparently, it took so long for me to commit time on this to get it done. It is done now. Fixed via https://github.com/mysticmind/mysticmind-postgresembed/commit/2c8fdefaa2e983196e01c6ff334eaa881839a779. There will be a 3.x published soon after a bit of tests. Now the lib supports running embedded postgres server on Windows, OSX (including Silicon) and Linux. It is major version bump since there are few breaking changes.
v3.0.0 is available in NuGet.
Currently, we are using minimum Postgres binaries available for Windows as NuGet package. To truly make this a cross-platform library, need to figure out a way to get minimal Postgres binaries for *nix including extensions.