By using Gorm v2 with Postgres, there is no db.Close() to close the database connection.
But it was in Gorm v1, and it is already shown in the new documentation (that sqlite example).
The number of connections to database grows as new connections are made.
How to close the connection to database using new Gorm v2?
Sorry, my bad, found it here in closed issues.
sqlDB, err := DB.DB()
sqlDB.Close()
Better add it somewhere into the documentation.
Most helpful comment
Sorry, my bad, found it here in closed issues.
sqlDB, err := DB.DB()
sqlDB.Close()
Better add it somewhere into the documentation.