0
votes

Using pgxpool as an import for Client Side Pooling, also using RDS Proxy for pooling

Folder Structure

  • database

pghelper.go (here used singleton pgxPool.ConnectConfig(ctx, config) and returning connect instance to all the handlers

  • handler

inside handler calling the connection Pool instance to run the DB query

Note: Not closing the instance inside the handler or anywhere in the code, based on few docs in the Stackoverflow

Is this the correct way?

As the ClientConnections are closing but the Database connections are not closing even after the timeouts are recieved in RDS Proxy

Timeouts set

  1. Lambda : 1 min
  2. RDS Proxy : 5 min

How should I make pooling work as expected as I feel pooling is not happening and neither the DB connections are not closing after timeouts?