I am using golang in my application server and gorm as the ORM. I am using postgresql as the database in google cloud sql.
I created a 2 read replica's for postgres which are being used by the application server.
Previously, I used node.js and sequelize and there, I am able to define the read replicas as
read: [
{ host: '8.8.8.8', username: 'anotherusernamethanroot', password: 'lolcats!' },
{ host: 'localhost', username: 'root', password: null }
],
write: { host: 'localhost', username: 'root', password: null }
},
However for gorm, I dont see any way to do that(in the documentation).
So, is there a way that I can define read replicas and gorm takes care of it. If not, what is the best practice for this use case?