Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提交pg库表元数据功能代码 #2086

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ require (
github.com/swaggo/swag v1.6.7
github.com/ungerik/go-dry v0.0.0-20210209114055-a3e162a9e62e
github.com/urfave/cli/v2 v2.8.1
github.com/vektah/gqlparser/v2 v2.5.1
github.com/lib/pq v1.10.2
golang.org/x/net v0.15.0
google.golang.org/grpc v1.50.1
gopkg.in/natefinch/lumberjack.v2 v2.0.0
Expand Down
55 changes: 38 additions & 17 deletions sqle/server/auditplan/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,27 @@ type Meta struct {
}

const (
TypeDefault = "default"
TypeMySQLSlowLog = "mysql_slow_log"
TypeMySQLMybatis = "mysql_mybatis"
TypeMySQLSchemaMeta = "mysql_schema_meta"
TypeMySQLProcesslist = "mysql_processlist"
TypeAliRdsMySQLSlowLog = "ali_rds_mysql_slow_log"
TypeAliRdsMySQLAuditLog = "ali_rds_mysql_audit_log"
TypeHuaweiRdsMySQLSlowLog = "huawei_rds_mysql_slow_log"
TypeOracleTopSQL = "oracle_top_sql"
TypeTiDBAuditLog = "tidb_audit_log"
TypeAllAppExtract = "all_app_extract"
TypeBaiduRdsMySQLSlowLog = "baidu_rds_mysql_slow_log"
TypeSQLFile = "sql_file"
TypeDefault = "default"
TypeMySQLSlowLog = "mysql_slow_log"
TypeMySQLMybatis = "mysql_mybatis"
TypeMySQLSchemaMeta = "mysql_schema_meta"
TypeMySQLProcesslist = "mysql_processlist"
TypeAliRdsMySQLSlowLog = "ali_rds_mysql_slow_log"
TypeAliRdsMySQLAuditLog = "ali_rds_mysql_audit_log"
TypeOracleTopSQL = "oracle_top_sql"
TypeTiDBAuditLog = "tidb_audit_log"
TypeAllAppExtract = "all_app_extract"
TypeBaiduRdsMySQLSlowLog = "baidu_rds_mysql_slow_log"
TypeSQLFile = "sql_file"
TypePostgreSQLSchemaMeta = "Postgresql_schema_meta"
)

const (
InstanceTypeAll = ""
InstanceTypeMySQL = "MySQL"
InstanceTypeOracle = "Oracle"
InstanceTypeTiDB = "TiDB"
InstanceTypeAll = ""
InstanceTypeMySQL = "MySQL"
InstanceTypeOracle = "Oracle"
InstanceTypeTiDB = "TiDB"
InstanceTypePostgreSQL = "PostgreSQL"
)

const (
Expand Down Expand Up @@ -371,6 +372,26 @@ var Metas = []Meta{
InstanceType: InstanceTypeAll,
CreateTask: NewDefaultTask,
},
{
Type: TypePostgreSQLSchemaMeta,
Desc: "库表元数据",
InstanceType: InstanceTypePostgreSQL,
CreateTask: NewPostgreSQLSchemaMetaTask,
Params: []*params.Param{
{
Key: paramKeyCollectIntervalMinute,
Desc: "采集周期(分钟)",
Value: "60",
Type: params.ParamTypeInt,
},
{
Key: "collect_view",
Desc: "是否采集视图信息",
Value: "0",
Type: params.ParamTypeBool,
},
},
},
}

var MetaMap = map[string]Meta{}
Expand Down
Loading