Host strapi app on heroku and connect with a sql database hosted on a different server

System Information
  • Strapi Version: v4
  • Operating System: macOS
  • Database: sql
  • Node Version: 17.4
  • NPM Version: 5.8.8
  • Yarn Version: n/a

I have my strapi app hosted at heroku withn a postgress db, but I want to connect it with a SQL database hosted on a different machine, I am able to connect with the database locally by changing the database.js file in config folder but I am not sure how to do it on heroku.