2 years ago
is it possible to connect with localdburl which is of postgres
by localdburl i mean the one of railway service
14 Replies
2 years ago
You want to connect to a psql DB from your local computer?
If so then yes, you just need to use the public url
if same project have two service one db and one py app both can communicate locally ?
2 years ago
The AFW-bot can connect to the postgres instance. You should use the private DB url for that though.
You can add a env variable to AFW-bot (will be something like ${{Postgres.DATABASE_PRIVATE_URL}}). Then just grab that env variable in your python application to connect to the DB.
2 years ago
Hey there, little correction needed -
For Postgres databases that are recently deployed you can simply reference DATABASE_URL as it is now the private url
2 years ago
They'll both count towards your usage. It's just better to use a private URL within your service.
2 years ago
Hey, correction again, database to service communication over the private network does not cost anything on egress
2 years ago
But they still have resource usage eh? They're not free
2 years ago
yes of course, but there will be no egress
