Ecto postgrex and unix sockets for Phoenix



I’m trying to connect to Postgresql using unix sockets, but can’t find documentation or examples on how to do it.
postgrex already has support for unix sockets.

It seems that I could place some configuration such as
config :postgrex, socket_dir: "/var/run/postgres (maybe it’s wrong) in config/config.exs, but would need (I think) to change Ecto as well.

How to do this?


I think you do it by passing in the path to the directory as the host name???


This code suggests that the directory is all you need:


José Valim answered in
similar to @hackerboos answer.

Thank you for your help @hackerboos and @scribe