I am having some issues connecting to my database locally.
I have read the guide and I am able to connect that way with psql, or through a GUI tool like DBeaver.
The issue arises when I try to connect through Elixir, like so:
config :example, Example.Repo, username: System.get_env("DB_USERNAME") || "postgres", password: System.get_env("DB_PASSWORD") || "postgres", database: System.get_env("DB_NAME") || "example_dev", hostname: System.get_env("DB_HOST") || "localhost",
This gives me the following error
[error] Postgrex.Protocol (#PID<0.665.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (*omitted*-stg-db.internal:5432): non-existing domain - :nxdomain
which to me indicates Elixir for some reason is unable to resolve the hostname. Pinging that same db with
ping *omitted*-stg-db.internal doesn’t work either, only connecting directly through psql. How can I connect to the fly database instance in my local elixir environment?