db
db copied to clipboard
Better default connection lifetime
upper overrides the driver default connection lifetime, but does so with zero, which is already the default for both database/sql and go-sql-driver/mysql:
https://github.com/upper/db/blob/master/settings.go#L185
If we're going to override this value, then could we use a more helpful default, such as 4 to 6 hours? This way, upper.io integrates better with (My)SQL servers, which tend to sever connections server-side every 8 hours of inactivity.
As far as I understand, defaulting to 0 means connections will be reused:
https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime
Do you currently have any problems with short-lived sessions?