erleans / pgo

Erlang Postgres client and connection pool
Apache License 2.0
80 stars 16 forks source link

Handle domain socket host names #90

Closed cmkarlsson closed 2 days ago

cmkarlsson commented 1 month ago

This PR makes pgo able to connect to unix domain sockets by using a domain socket path as the hostname.

If the host name looks like an absolute path or an abstract domain socket, pgo will now use {local, Socket} alongside port 0 to connect the postgres.

This is largely done in the same way as postgrex (https://github.com/elixir-ecto/postgrex/blob/5924c181da8c7991d51bd569eb26fa4cbf4f19ed/lib/postgrex/utils.ex#L102)

This PR should also solve #66

tsloughter commented 2 days ago

Going to merge this but would love some tests.