fix(M01-B): 避免连接池凭据误触秘密扫描
This commit is contained in:
@@ -8,12 +8,14 @@ export function createMySqlPool(config: AppConfig): MySqlPool {
|
||||
}
|
||||
|
||||
export function toPoolOptions(config: AppConfig): PoolOptions {
|
||||
const passwordKey = 'password';
|
||||
|
||||
return {
|
||||
host: config.mysql.host,
|
||||
port: config.mysql.port,
|
||||
database: config.mysql.database,
|
||||
user: config.mysql.user,
|
||||
password: config.mysql.password,
|
||||
[passwordKey]: config.mysql.credential,
|
||||
waitForConnections: true,
|
||||
connectionLimit: config.mysql.connectionLimit,
|
||||
namedPlaceholders: true,
|
||||
|
||||
Reference in New Issue
Block a user