Skip to content

Commit b7feb75

Browse files
author
xff
committed
支持InnoDB不同行格式计算RowSize
1 parent 6231026 commit b7feb75

109 files changed

Lines changed: 296 additions & 177 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ goInsight/goinsight/dist
3131
.DS_Store
3232
goinsight/bin/
3333
goInsight.code-workspace
34+
github.goinsight.code-workspace

goinsight/bootstrap/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/08/14 15:45:43
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package bootstrap

goinsight/bootstrap/db.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/08/14 15:53:53
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package bootstrap
@@ -238,12 +238,13 @@ func initializeInspectParams(db *gorm.DB) {
238238
{"params": map[string]bool{"ENABLE_FOREIGN_KEY": false}, "remark": "是否启用外键"},
239239
{"params": map[string]bool{"CHECK_TABLE_AUTOINCREMENT_INIT_VALUE": true}, "remark": "检查建表是自增列初始值是否为1"},
240240
{"params": map[string]bool{"ENABLE_CREATE_VIEW": true}, "remark": "是否支持创建和使用视图"},
241+
{"params": map[string]interface{}{"INNODB_ROW_FORMAT": []string{"DYNAMIC"}}, "remark": "InnoDB表支持的行格式"},
241242
// COLUMN
242243
{"params": map[string]int{"MAX_COLUMN_NAME_LENGTH": 64}, "remark": "列名的长度"},
243244
{"params": map[string]bool{"CHECK_COLUMN_CHARSET": true}, "remark": "是否检查列的字符集"},
244245
{"params": map[string]bool{"CHECK_COLUMN_COMMENT": true}, "remark": "是否检查列的注释"},
245246
{"params": map[string]int{"COLUMN_MAX_CHAR_LENGTH": 64}, "remark": "char长度大于N的时候需要改为varchar"},
246-
{"params": map[string]int{"MAX_VARCHAR_LENGTH": 65535}, "remark": "最大允许定义的varchar长度"},
247+
{"params": map[string]int{"MAX_VARCHAR_LENGTH": 16383}, "remark": "最大允许定义的varchar长度"},
247248
{"params": map[string]bool{"ENABLE_COLUMN_BLOB_TYPE": true}, "remark": "是否允许列的类型为BLOB/TEXT"},
248249
{"params": map[string]bool{"ENABLE_COLUMN_JSON_TYPE": true}, "remark": "是否允许列的类型为JSON"},
249250
{"params": map[string]bool{"ENABLE_COLUMN_BIT_TYPE": true}, "remark": "是否允许列的类型为BIT"},
@@ -269,6 +270,7 @@ func initializeInspectParams(db *gorm.DB) {
269270
{"params": map[string]int{"PRIMARYKEY_MAX_KEY_PARTS": 1}, "remark": "组成主键索引的列数不能超过指定的个数"},
270271
{"params": map[string]int{"MAX_INDEX_KEYS": 12}, "remark": "最多有N个索引,包括唯一索引/二级索引"},
271272
{"params": map[string]bool{"ENABLE_INDEX_RENAME": false}, "remark": "是否允许rename索引名"},
273+
{"params": map[string]bool{"ENABLE_REDUNDANT_INDEX": false}, "remark": "是否允许冗余索引"},
272274
// ALTER
273275
{"params": map[string]bool{"ENABLE_DROP_COLS": true}, "remark": "是否允许DROP列"},
274276
{"params": map[string]bool{"ENABLE_DROP_INDEXES": true}, "remark": "是否允许DROP索引"},

goinsight/bootstrap/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/08/14 15:49:31
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package bootstrap

goinsight/config.yaml.template

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ database:
1818
driver: "mysql" # 数据库驱动
1919
host: "127.0.0.1" # 数据库主机
2020
port: 3306 # 数据库端口
21-
database: "goInsight" # 数据库名称
22-
username: "goInsight_rw" # 数据库用户名
23-
password: "goInsight@1234.Com" # 数据库密码
21+
database: "goinsight" # 数据库名称
22+
username: "goinsight_rw" # 数据库用户名
23+
password: "goinsight@1234.Com" # 数据库密码
2424
charset: "utf8mb4" # 数据库字符集
2525
max_idle_conns: 64 # 最大空闲连接数
2626
max_open_conns: 64 # 最大打开连接数
@@ -37,12 +37,12 @@ redis:
3737
# 远程实例DB账号,需要在目标数据库创建
3838
# 请确保通过该账号可以访问远程数据库,该账号用于工单审核、执行、数据查询、库表元信息采集等
3939
# 注意:请保管好此账号,不要泄露,否则可能会导致安全风险
40-
# create user 'goInsight_rw'@'%' identified by '复杂的密码';
41-
# grant select,insert,update,delete,Alter,Create,Create view,Drop,Index,Replication slave on *.* to 'goInsight_rw'@'%';
40+
# create user 'goinsight_admin'@'%' identified by '复杂的密码';
41+
# grant select,insert,update,delete,Alter,Create,Create view,Drop,Index,Replication slave on *.* to 'goinsight_admin'@'%';
4242
# flush privileges;
4343
remotedb:
44-
username: "goInsight_rw"
45-
password: "goInsight@1234.Com" # 建议更换为复杂的密码
44+
username: "goinsight_admin"
45+
password: "goinsight@1234.Com" # 建议更换为复杂的密码
4646

4747
# 数据查询配置
4848
das:
@@ -84,7 +84,7 @@ notify:
8484
dingtalk:
8585
enable: false
8686
webhook: "https://oapi.dingtalk.com/robot/send?access_token=1234"
87-
keywords: "goInsight"
87+
keywords: "goinsight"
8888
mail:
8989
enable: false
9090
username: "xxx@163.com"

goinsight/configs/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/08/14 15:48:49
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package config

goinsight/global/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/08/14 15:46:37
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package global

goinsight/internal/apps/common/models/base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/09/19 15:50:47
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package models

goinsight/internal/apps/common/models/time.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/09/19 15:51:05
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package models

goinsight/internal/apps/common/services/dbconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@Time : 2023/08/31 15:19:46
3-
@Author : lazzyfu
3+
@Author : xff
44
*/
55

66
package services

0 commit comments

Comments
 (0)