-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support config multiple databases (#123)
* feat: support config multiple databases
- Loading branch information
Showing
9 changed files
with
170 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
Driver: mysql # 驱动名称,目前支持 mysql,postgres,默认: 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数 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
default: | ||
Driver: mysql # 驱动名称,目前支持 mysql,postgres,默认: 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数 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
Driver: mysql # 驱动名称,目前支持: mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: localhost:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306, pg:5432 | ||
UserName: root | ||
Password: 123456 | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
default: | ||
Driver: mysql # 驱动名称,目前支持: mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: localhost:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306, pg:5432 | ||
UserName: root | ||
Password: 123456 | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
user: | ||
Driver: mysql # 驱动名称,目前支持: mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: localhost:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306, pg:5432 | ||
UserName: root | ||
Password: 123456 | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters