superfly / fly_postgres_elixir

Library for working with local read-replica postgres databases and performing writes through RPC calls to other nodes in the primary Fly.io region.
https://hex.pm/packages/fly_postgres
Apache License 2.0
104 stars 10 forks source link

Support flycast db urls #37

Closed tvdfly closed 1 year ago

tvdfly commented 1 year ago

We launched flycast for pg clusters earlier this year: https://community.fly.io/t/flycast-for-postgres/10628

Now DATABASE_URLs that use flycast will have the form: postgres://user:pass@app-name.flycast:5432/db_name. Before this change the host was rewritten to top1.nearest.of.app-name.flycast, which is not valid and would result in failed connections.

With this change we do not modify hostname when a flycast hostname is used.