Files
eagle/config/docker/database.yaml
Richard 8549737a46 feat: add async log and update gorm tracing (#149)
* feat: add async log and update grom tracing

* chore: fix typo
2024-08-22 17:45:30 +08:00

16 lines
912 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
default:
Driver: mysql # 驱动名称,目前支持 mysqlpostgres默认: mysql
Name: eagle # 数据库名称
Addr: db:3306 # 如果是 docker,可以替换为 对应的服务名称eg: db:3306
UserName: root
Password: root
ShowLog: true # 是否打印所有SQL日志
MaxIdleConn: 10 # 最大闲置的连接数0意味着使用默认的大小2 小于0表示不使用连接池
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数
Timeout: 3s # 数据库连接超时时间
ReadTimeout: 3s # 数据库去读超时时间, 0代表不限制
WriteTimeout: 3s # 数据库写入超时时间, 0代表不限制
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些
SlowThreshold: 500ms # 慢查询阈值设置后只打印慢查询日志默认为200ms
EnableTrace: false