←back to thread

75 points markusw | 2 comments | | HN request time: 0.414s | source
Show context
nu11ptr ◴[] No.45335239[source]
You can, just embed it in your Go app:

https://github.com/fergusstrange/embedded-postgres

replies(2): >>45335287 #>>45335384 #
tptacek ◴[] No.45335287[source]
This just runs Postgres as a process, right?
replies(2): >>45335295 #>>45336911 #
beckford ◴[] No.45336911[source]
Not OP, but I think it does run Postgres as a process. However, IMHO the general use case for SQL is for external actors (humans, machines) to get access to the underlying data in a structured way. So I see a benefit for a true in-process embedding of Postgres if the process exposed a Postgres TCP/IP port 5432, etc. (Hook your software up to a query tool, a reporting interface, etc.)

Beyond that, why care whether the "embedding" involves a spawned process? It still works great for integration tests which I suspect is the main use case, and for specialized data analysis software where a spawned process is no big deal.

replies(1): >>45345498 #
1. stuaxo ◴[] No.45345498[source]
Can you have a socket that's only shared between a parent and child process?

This sounds like it could be pretty useful.

replies(1): >>45379518 #
2. lantastic ◴[] No.45379518[source]
Sure, socketpairs on Linux.