Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: override the database connection configuration (#6661)

Danny Xu1dee04a7eced
diff --git a/backend/plugin/db/mysql/mysql.go b/backend/plugin/db/mysql/mysql.go
index dade7268df..a21cc2cf7c 100644
--- a/backend/plugin/db/mysql/mysql.go
+++ b/backend/plugin/db/mysql/mysql.go
@@ -8,6 +8,7 @@ import (
"fmt"
"net"
"strings"
+ "time"
"github.com/go-sql-driver/mysql"
"github.com/pkg/errors"
@@ -115,6 +116,10 @@ func (driver *Driver) Open(ctx context.Context, dbType db.Type, connCfg db.Conne
}
driver.dbType = dbType
driver.db = db
+ // TODO(d): remove the work-around once we have clean-up the migration connection hack.
+ db.SetConnMaxLifetime(2 * time.Hour)
+ db.SetMaxOpenConns(50)
+ db.SetMaxIdleConns(15)
driver.migrationConn = conn
driver.connectionCtx = connCtx
driver.connCfg = connCfg