Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: superfluous advisor type (#17320)

p0nye3861d41dff9
diff --git a/backend/plugin/advisor/advisor.go b/backend/plugin/advisor/advisor.go
index fbf95c51e5..4c5b290d9c 100644
--- a/backend/plugin/advisor/advisor.go
+++ b/backend/plugin/advisor/advisor.go
@@ -66,13 +66,13 @@ type Advisor interface {
var (
advisorMu sync.RWMutex
- advisors = make(map[storepb.Engine]map[Type]Advisor)
+ advisors = make(map[storepb.Engine]map[SQLReviewRuleType]Advisor)
)
// Register makes a advisor available by the provided id.
// If Register is called twice with the same name or if advisor is nil,
// it panics.
-func Register(dbType storepb.Engine, advType Type, f Advisor) {
+func Register(dbType storepb.Engine, ruleType SQLReviewRuleType, f Advisor) {
advisorMu.Lock()
defer advisorMu.Unlock()
if f == nil {
@@ -80,26 +80,26 @@ func Register(dbType storepb.Engine, advType Type, f Advisor) {
}
dbAdvisors, ok := advisors[dbType]
if !ok {
- advisors[dbType] = map[Type]Advisor{
- advType: f,
+ advisors[dbType] = map[SQLReviewRuleType]Advisor{
+ ruleType: f,
}
} else {
- if _, dup := dbAdvisors[advType]; dup {
- panic(fmt.Sprintf("advisor: Register called twice for advisor %v for %v", advType, dbType))
+ if _, dup := dbAdvisors[ruleType]; dup {
+ panic(fmt.Sprintf("advisor: Register called twice for advisor %v for %v", ruleType, dbType))
}
- dbAdvisors[advType] = f
+ dbAdvisors[ruleType] = f
}
}
// Check runs the advisor and returns the advices.
-func Check(ctx context.Context, dbType storepb.Engine, advType Type, checkCtx Context) (adviceList []*storepb.Advice, err error) {
+func Check(ctx context.Context, dbType storepb.Engine, ruleType SQLReviewRuleType, checkCtx Context) (adviceList []*storepb.Advice, err error) {
defer func() {
if panicErr := recover(); panicErr != nil {
panicErr, ok := panicErr.(error)
if !ok {
panicErr = errors.Errorf("%v", panicErr)
}
- err = errors.Errorf("advisor check PANIC RECOVER, type: %v, err: %v", advType, panicErr)
+ err = errors.Errorf("advisor check PANIC RECOVER, type: %v, err: %v", ruleType, panicErr)
slog.Error("advisor check PANIC RECOVER", log.BBError(panicErr), log.BBStack("panic-stack"))
}
@@ -112,9 +112,9 @@ func Check(ctx context.Context, dbType storepb.Engine, advType Type, checkCtx Co
return nil, errors.Errorf("advisor: unknown db advisor type %v", dbType)
}
- f, ok := dbAdvisors[advType]
+ f, ok := dbAdvisors[ruleType]
if !ok {
- return nil, errors.Errorf("advisor: unknown advisor %v for %v", advType, dbType)
+ return nil, errors.Errorf("advisor: unknown advisor %v for %v", ruleType, dbType)
}
return f.Check(ctx, checkCtx)
diff --git a/backend/plugin/advisor/code.go b/backend/plugin/advisor/code.go
index e5a9a37692..340c8692e5 100644
--- a/backend/plugin/advisor/code.go
+++ b/backend/plugin/advisor/code.go
@@ -216,652 +216,3 @@ func (c Code) Int() int {
func (c Code) Int32() int32 {
return int32(c)
}
-
-// Type is the type of advisor.
-// nolint
-type Type string
-
-const (
- // MySQL Advisor.
-
- // MySQLSyntax is an advisor type for MySQL syntax.
- MySQLSyntax Type = "bb.plugin.advisor.mysql.syntax"
-
- // MySQLUseInnoDB is an advisor type for MySQL InnoDB Engine.
- MySQLUseInnoDB Type = "bb.plugin.advisor.mysql.use-innodb"
-
- // MySQLOnlineMigration is an advisor type for MySQL using online migration to migrate large tables.
- MySQLOnlineMigration Type = "bb.plugin.advisor.mysql.online-migration"
-
- // MySQLMigrationCompatibility is an advisor type for MySQL migration compatibility.
- MySQLMigrationCompatibility Type = "bb.plugin.advisor.mysql.migration-compatibility"
-
- // MySQLWhereRequirement is an advisor type for MySQL WHERE clause requirement.
- MySQLWhereRequirement Type = "bb.plugin.advisor.mysql.where.require"
-
- // MySQLWhereRequirementForSelect is an advisor type for MySQL WHERE clause requirement in SELECT statements.
- MySQLWhereRequirementForSelect Type = "bb.plugin.advisor.mysql.where.require.select"
-
- // MySQLWhereRequirementForUpdateDelete is an advisor type for MySQL WHERE clause requirement in UPDATE/DELETE statements.
- MySQLWhereRequirementForUpdateDelete Type = "bb.plugin.advisor.mysql.where.require.update-delete"
-
- // MySQLNoLeadingWildcardLike is an advisor type for MySQL no leading wildcard LIKE.
- MySQLNoLeadingWildcardLike Type = "bb.plugin.advisor.mysql.where.no-leading-wildcard-like"
-
- // MySQLNamingTableConvention is an advisor type for MySQL table naming convention.
- MySQLNamingTableConvention Type = "bb.plugin.advisor.mysql.naming.table"
-
- // MySQLNamingIndexConvention is an advisor type for MySQL index key naming convention.
- MySQLNamingIndexConvention Type = "bb.plugin.advisor.mysql.naming.index"
-
- // MySQLNamingUKConvention is an advisor type for MySQL unique key naming convention.
- MySQLNamingUKConvention Type = "bb.plugin.advisor.mysql.naming.uk"
-
- // MySQLNamingFKConvention is an advisor type for MySQL foreign key naming convention.
- MySQLNamingFKConvention Type = "bb.plugin.advisor.mysql.naming.fk"
-
- // MySQLNamingColumnConvention is an advisor type for MySQL column naming convention.
- MySQLNamingColumnConvention Type = "bb.plugin.advisor.mysql.naming.column"
-
- // MySQLNamingAutoIncrementColumnConvention is an advisor type for MySQL auto-increment naming convention.
- MySQLNamingAutoIncrementColumnConvention Type = "bb.plugin.advisor.mysql.naming.auto-increment-column"
-
- // MySQLIdentifierNamingNoKeyword is an advisor type for MySQL identifier naming convention without keyword.
- MySQLIdentifierNamingNoKeyword Type = "bb.plugin.advisor.mysql.naming.identifier-no-keyword"
-
- // MySQLColumnRequirement is an advisor type for MySQL column requirement.
- MySQLColumnRequirement Type = "bb.plugin.advisor.mysql.column.require"
-
- // MySQLColumnNoNull is an advisor type for MySQL column no NULL value.
- MySQLColumnNoNull Type = "bb.plugin.advisor.mysql.column.no-null"
-
- // MySQLColumnDisallowChangingType is an advisor type for MySQL disallow changing column type.
- MySQLColumnDisallowChangingType Type = "bb.plugin.advisor.mysql.column.disallow-changing-type"
-
- // MySQLColumnSetDefaultForNotNull is an advisor type for MySQL set default value for not null column.
- MySQLColumnSetDefaultForNotNull Type = "bb.plugin.advisor.mysql.column.set-default-for-not-null"
-
- // MySQLColumnDisallowChanging is an advisor type for MySQL disallow CHANGE COLUMN statement.
- MySQLColumnDisallowChanging Type = "bb.plugin.advisor.mysql.column.disallow-change"
-
- // MySQLColumnDisallowDrop is an advisor type for MySQL disallow DROP COLUMN statement.
- MySQLColumnDisallowDrop Type = "bb.plugin.advisor.mysql.column.disallow-drop"
-
- // MySQLColumnDisallowDropInIndex is an advisor type for MySQL disallow DROP COLUMN in index.
- MySQLColumnDisallowDropInIndex Type = "bb.plugin.advisor.mysql.column.disallow-drop-in-index"
-
- // MySQLColumnDisallowChangingOrder is an advisor type for MySQL disallow changing column order.
- MySQLColumnDisallowChangingOrder Type = "bb.plugin.advisor.mysql.column.disallow-changing-order"
-
- // MySQLColumnCommentConvention is an advisor type for MySQL column comment convention.
- MySQLColumnCommentConvention Type = "bb.plugin.advisor.mysql.column.comment"
-
- // MySQLAutoIncrementColumnMustInteger is an advisor type for auto-increment column.
- MySQLAutoIncrementColumnMustInteger Type = "bb.plugin.advisor.mysql.column.auto-increment-must-integer"
-
- // MySQLDisallowSetColumnCharset is an advisor type for MySQL disallow set column charset.
- MySQLDisallowSetColumnCharset Type = "bb.plugin.advisor.mysql.column.disallow-set-charset"
-
- // MySQLColumnTypeDisallowList is an advisor type for MySQL column type disallow list.
- MySQLColumnTypeDisallowList Type = "bb.plugin.advisor.mysql.column.type-disallow-list"
-
- // MySQLColumnMaximumCharacterLength is an advisor type for MySQL maximum character length.
- MySQLColumnMaximumCharacterLength Type = "bb.plugin.advisor.mysql.column.maximum-character-length"
-
- // MySQLColumnMaximumVarcharLength is an advisor type for MySQL maximum varchar length.
- MySQLColumnMaximumVarcharLength Type = "bb.plugin.advisor.mysql.column.maximum-varchar-length"
-
- // MySQLColumnRequireCharset is an advisor type for MySQL column require charset.
- MySQLColumnRequireCharset Type = "bb.plugin.advisor.mysql.column.require-charset"
-
- // MySQLColumnRequireCollation is an advisor type for MySQL column require collation.
- MySQLColumnRequireCollation Type = "bb.plugin.advisor.mysql.column.require-collation"
-
- // MySQLAutoIncrementColumnInitialValue is an advisor type for MySQL auto-increment column initial value.
- MySQLAutoIncrementColumnInitialValue Type = "bb.plugin.advisor.mysql.column.auto-increment-initial-value"
-
- // MySQLAutoIncrementColumnMustUnsigned is an advisor type for MySQL unsigned auto-increment column.
- MySQLAutoIncrementColumnMustUnsigned Type = "bb.plugin.advisor.mysql.column.auto-increment-must-unsigned"
-
- // MySQLCurrentTimeColumnCountLimit is an advisor type for MySQL current time column count limit.
- MySQLCurrentTimeColumnCountLimit Type = "bb.plugin.advisor.mysql.column.current-time-count-limit"
-
- // MySQLRequireColumnDefault is an advisor type for MySQL column default requirement.
- MySQLRequireColumnDefault Type = "bb.plugin.advisor.mysql.column.require-default"
-
- // MySQLNoSelectAll is an advisor type for MySQL no select all.
- MySQLNoSelectAll Type = "bb.plugin.advisor.mysql.select.no-select-all"
-
- // MySQLTableRequirePK is an advisor type for MySQL table require primary key.
- MySQLTableRequirePK Type = "bb.plugin.advisor.mysql.table.require-pk"
-
- // MySQLTableNoFK is an advisor type for MySQL table disallow foreign key.
- MySQLTableNoFK Type = "bb.plugin.advisor.mysql.table.no-foreign-key"
-
- // MySQLTableDropNamingConvention is an advisor type for MySQL table drop with naming convention.
- MySQLTableDropNamingConvention Type = "bb.plugin.advisor.mysql.table.drop-naming-convention"
-
- // MySQLTableCommentConvention is an advisor for MySQL table comment convention.
- MySQLTableCommentConvention Type = "bb.plugin.advisor.mysql.table.comment"
-
- // MySQLTableDisallowPartition is an advisor type for MySQL disallow table partition.
- MySQLTableDisallowPartition Type = "bb.plugin.advisor.mysql.table.disallow-partition"
-
- // MySQLTableDisallowTrigger is an advisor type for MySQL disallow table trigger.
- MySQLTableDisallowTrigger Type = "bb.plugin.advisor.mysql.table.disallow-trigger"
-
- // MySQLTableNoDuplicateIndex is an advisor type for MySQL no duplicate index.
- MySQLTableNoDuplicateIndex Type = "bb.plugin.advisor.mysql.table.no-duplicate-index"
-
- // MySQLTableTextFieldsTotalLength is an advisor type for MySQL table text fields total length.
- MySQLTableTextFieldsTotalLength Type = "bb.plugin.advisor.mysql.table.text-fields-total-length"
-
- // MySQLTableFieldsMaximumCount is an advisor type for MySQL table fields maximum count.
- MySQLTableDisallowSetCharset Type = "bb.plugin.advisor.mysql.table.disallow-set-charset"
-
- // MySQLTableFieldsMaximumCount is an advisor type for limiting MySQL table size.
- MySQLTableLimitSize Type = "bb.plugin.advisor.mysql.table.limit-size"
-
- // MySQLTableRequireCharset is an advisor type for MySQL table require charset.
- MySQLTableRequireCharset Type = "bb.plugin.advisor.mysql.table.require-charset"
-
- // MySQLTableRequireCollation is an advisor type for MySQL table require collation.
- MySQLTableRequireCollation Type = "bb.plugin.advisor.mysql.table.require-collation"
-
- // MySQLTableDisallowDML is an advisor type for MySQL disallow DML.
- MySQLTableDisallowDML Type = "bb.plugin.advisor.mysql.table.disallow-dml"
-
- // MySQLTableDisallowDDL is an advisor type for MySQL disallow DDL.
- MySQLTableDisallowDDL Type = "bb.plugin.advisor.mysql.table.disallow-ddl"
-
- // MySQLDatabaseAllowDropIfEmpty is an advisor type for MySQL only allow drop empty database.
- MySQLDatabaseAllowDropIfEmpty Type = "bb.plugin.advisor.mysql.database.drop-empty-database"
-
- // MySQLIndexNoDuplicateColumn is an advisor type for MySQL no duplicate columns in index.
- MySQLIndexNoDuplicateColumn Type = "bb.plugin.advisor.mysql.index.no-duplicate-column"
-
- // MySQLIndexPKType is an advisor type for MySQL correct type of PK.
- MySQLIndexPKType Type = "bb.plugin.advisor.mysql.index.pk-type"
-
- // MySQLPrimaryKeyTypeAllowlist is an advisor type for MySQL primary key type allowlist.
- MySQLPrimaryKeyTypeAllowlist Type = "bb.plugin.advisor.mysql.index.primary-key-type-allowlist"
-
- // MySQLIndexKeyNumberLimit is an advisor type for MySQL index key number limit.
- MySQLIndexKeyNumberLimit Type = "bb.plugin.advisor.mysql.index.key-number-limit"
-
- // MySQLIndexTotalNumberLimit is an advisor type for MySQL index total number limit.
- MySQLIndexTotalNumberLimit Type = "bb.plugin.advisor.mysql.index.total-number-limit"
-
- // MySQLIndexTypeAllowList is an advisor type for MySQL index type allowlist.
- MySQLIndexTypeAllowList Type = "bb.plugin.advisor.mysql.index.type-allow-list"
-
- // MySQLCharsetAllowlist is an advisor type for MySQL charset allowlist.
- MySQLCharsetAllowlist Type = "bb.plugin.advisor.mysql.charset.allowlist"
-
- // MySQLCollationAllowlist is an advisor type for MySQL collation allowlist.
- MySQLCollationAllowlist Type = "bb.plugin.advisor.mysql.collation.allowlist"
-
- // MySQLIndexTypeNoBlob is an advisor type for MySQL index type no blob.
- MySQLIndexTypeNoBlob Type = "bb.plugin.advisor.mysql.index.type-no-blob"
-
- // MySQLStatementDisallowCommit is an advisor type for MySQL to disallow commit.
- MySQLStatementDisallowCommit Type = "bb.plugin.advisor.mysql.statement.disallow-commit"
-
- // MySQLStatementDisallowLimit is an advisor type for MySQL no LIMIT clause in INSERT/UPDATE/DELETE statement.
- MySQLStatementDisallowLimit Type = "bb.plugin.advisor.mysql.statement.disallow-limit"
-
- // MySQLStatementDisallowUsingFilesort is an advisor type for MySQL disallow using filesort in execution plan.
- MySQLStatementDisallowUsingFilesort Type = "bb.plugin.advisor.mysql.statement.disallow-using-filesort"
-
- // MySQLStatementDisallowUsingTemporary is an advisor type for MySQL disallow using temporary in execution plan.
- MySQLStatementDisallowUsingTemporary Type = "bb.plugin.advisor.mysql.statement.disallow-using-temporary"
-
- // MySQLInsertRowLimit is an advisor type for MySQL to limit INSERT rows.
- MySQLInsertRowLimit Type = "bb.plugin.advisor.mysql.insert.row-limit"
-
- // MySQLInsertMustSpecifyColumn is an advisor type for MySQL to enforce column specified.
- MySQLInsertMustSpecifyColumn Type = "bb.plugin.advisor.mysql.insert.must-specify-column"
-
- // MySQLInsertDisallowOrderByRand is an advisor type for MySQL to disallow order by rand in INSERT statements.
- MySQLInsertDisallowOrderByRand Type = "bb.plugin.advisor.mysql.insert.disallow-order-by-rand"
-
- // MySQLDisallowOrderBy is an advisor type for MySQL no ORDER BY clause in DELETE/UPDATE statement.
- MySQLDisallowOrderBy Type = "bb.plugin.advisor.mysql.statement.disallow-order-by"
-
- // MySQLMergeAlterTable is an advisor type for MySQL no redundant ALTER TABLE statements.
- MySQLMergeAlterTable Type = "bb.plugin.advisor.mysql.statement.merge-alter-table"
-
- // MySQLStatementAffectedRowLimit is an advisor type for MySQL UPDATE/DELETE affected row limit.
- MySQLStatementAffectedRowLimit Type = "bb.plugin.advisor.mysql.statement.affected-row-limit"
-
- // MySQLStatementDMLDryRun is an advisor type for MySQL DML dry run.
- MySQLStatementDMLDryRun Type = "bb.plugin.advisor.mysql.statement.dml-dry-run"
-
- // MySQLStatementSelectFullTableScan is an advisor type for checking MySQL select full table scan or not.
- MySQLStatementSelectFullTableScan Type = "bb.plugin.advisor.mysql.statement.select-full-table-scan"
-
- // MySQLStatementWhereNoEqualNull is an advisor type for checking MySQL no equal null in WHERE clause.
- MySQLStatementWhereNoEqualNull Type = "bb.plugin.advisor.mysql.statement.where.no-equal-null"
-
- // MySQLStatementWhereDisallowUsingFunction is an advisor type for checking MySQL disallow using function in WHERE clause.
- MySQLStatementWhereDisallowUsingFunction Type = "bb.plugin.advisor.mysql.statement.query.disallow-using-function"
-
- // MySQLStatementQueryMinumumPlanLevel is an advisor type for checking MySQL query minimum plan level.
- MySQLStatementQueryMinumumPlanLevel Type = "bb.plugin.advisor.mysql.statement.query.minimum-plan-level"
-
- // MySQLStatementWhereMaximumLogicalOperatorCount is an advisor type for checking MySQL statement maximum logical operator count in WHERE clause.
- MySQLStatementWhereMaximumLogicalOperatorCount Type = "bb.plugin.advisor.mysql.statement.where.maximum-logical-operator-count"
-
- // MySQLStatementMaximumLimitValue is an advisor type for MySQL statement maximum limit value.
- MySQLStatementMaximumLimitValue Type = "bb.plugin.advisor.mysql.statement.maximum-limit-value"
-
- // MySQLStatementMaximumJoinTableCount is an advisor type for MySQL statement maximum join table count.
- MySQLStatementMaximumJoinTableCount Type = "bb.plugin.advisor.mysql.statement.maximum-join-table-count"
-
- // MySQLStatementMaximumStatementsInTransaction is an advisor type for MySQL maximum statements in transaction.
- MySQLStatementMaximumStatementsInTransaction Type = "bb.plugin.advisor.mysql.statement.maximum-statements-in-transaction"
-
- // MySQLStatementJoinStrictColumnAttrs is an advisor type for MySQL statement strict column attrs(type, charset) in join.
- MySQLStatementJoinStrictColumnAttrs Type = "bb.plugin.advisor.mysql.statement.join-strict-column-attrs"
-
- // MySQLStatementDisallowMixInDDL is the advisor for MySQL that checks no DML statements are mixed in the DDL statements.
- MySQLStatementDisallowMixInDDL Type = "bb.plugin.advisor.mysql.statement.disallow-mix-in-ddl"
- // MySQLStatementDisallowMixInDML is the advisor for MySQL that checks no DDL statements are mixed in the DML statements.
- MySQLStatementDisallowMixInDML Type = "bb.plugin.advisor.mysql.statement.disallow-mix-in-dml"
-
- // MySQLBuiltinPriorBackupCheck is an advisor type for MySQL prior backup check.
- MySQLBuiltinPriorBackupCheck Type = "bb.plugin.advisor.mysql.builtin.prior-backup-check"
-
- // MySQLStatementAddColumnWithoutPosition is an advisor type for MySQL checking no position in ADD COLUMN clause.
- MySQLStatementAddColumnWithoutPosition Type = "bb.plugin.advisor.mysql.statement.add-column-without-position"
-
- // MySQLStatementMaxExecutionTime is an advisor type for MySQL statement max execution time.
- MySQLStatementMaxExecutionTime Type = "bb.plugin.advisor.mysql.statement.max-execution-time"
-
- // MySQLStatementRequireAlgorithmOption is an advisor type for MySQL statement require algorithm option for online DDL.
- MySQLStatementRequireAlgorithmOption Type = "bb.plugin.advisor.mysql.statement.require-algorithm-option"
-
- // MySQLStatementRequireLockOption is an advisor type for MySQL statement require lock option for online DDL.
- MySQLStatementRequireLockOption Type = "bb.plugin.advisor.mysql.statement.require-lock-option"
-
- // MySQLProcedureDisallowCreate is an advisor type for MySQL disallow create procedure.
- MySQLProcedureDisallowCreate Type = "bb.plugin.advisor.mysql.procedure.disallow-create"
-
- // MySQLEventDisallowCreate is an advisor type for MySQL disallow create event.
- MySQLEventDisallowCreate Type = "bb.plugin.advisor.mysql.event.disallow-create"
-
- // MySQLViewDisallowCreate is an advisor type for MySQL disallow create view.
- MySQLViewDisallowCreate Type = "bb.plugin.advisor.mysql.view.disallow-create"
-
- // MySQLFunctionDisallowCreate is an advisor type for MySQL disallow create function.
- MySQLFunctionDisallowCreate Type = "bb.plugin.advisor.mysql.function.disallow-create"
-
- // MySQLFunctionDisallowedList is an advisor type for MySQL disallowed function list.
- MySQLFunctionDisallowedList Type = "bb.plugin.advisor.mysql.function.disallowed-list"
-
- // MySQLDisallowOfflineDDL is an advisor type for MySQL disallow Offline DDL.
- MySQLDisallowOfflineDDL Type = "bb.plugin.advisor.mysql.disallow-offline-ddl"
-
- // PostgreSQL Advisor.
-
- // PostgreSQLSyntax is an advisor type for PostgreSQL syntax.
- PostgreSQLSyntax Type = "bb.plugin.advisor.postgresql.syntax"
-
- // PostgreSQLNamingFullyQualifiedObjectName is an advisor type for enforing full qualified object name.
- PostgreSQLNamingFullyQualifiedObjectName Type = "bb.plugin.advisor.postgresql.naming.fully-qualified"
-
- // PostgreSQLNamingTableConvention is an advisor type for PostgreSQL table naming convention.
- PostgreSQLNamingTableConvention Type = "bb.plugin.advisor.postgresql.naming.table"
-
- // PostgreSQLNamingColumnConvention is an advisor type for PostgreSQL column naming convention.
- PostgreSQLNamingColumnConvention Type = "bb.plugin.advisor.postgresql.naming.column"
-
- // PostgreSQLNamingPKConvention is an advisor type for PostgreSQL primary key naming convention.
- PostgreSQLNamingPKConvention Type = "bb.plugin.advisor.postgresql.naming.pk"
-
- // PostgreSQLNamingIndexConvention is an advisor type for PostgreSQL index naming convention.
- PostgreSQLNamingIndexConvention Type = "bb.plugin.advisor.postgresql.naming.index"
-
- // PostgreSQLNamingUKConvention is an advisor type for PostgreSQL unique key naming convention.
- PostgreSQLNamingUKConvention Type = "bb.plugin.advisor.postgresql.naming.uk"
-
- // PostgreSQLNamingFKConvention is an advisor type for PostgreSQL foreign key naming convention.
- PostgreSQLNamingFKConvention Type = "bb.plugin.advisor.postgresql.naming.fk"
-
- // PostgreSQLColumnNoNull is an advisor type for PostgreSQL column no NULL value.
- PostgreSQLColumnNoNull Type = "bb.plugin.advisor.postgresql.column.no-null"
-
- // PostgreSQLColumnRequirement is an advisor type for PostgreSQL column requirement.
- PostgreSQLColumnRequirement Type = "bb.plugin.advisor.postgresql.column.require"
-
- // PostgreSQLColumnCommentConvention is an advisor type for PostgreSQL column comment convention.
- PostgreSQLColumnCommentConvention Type = "bb.plugin.advisor.postgresql.column.comment"
-
- // PostgreSQLCommentConvention is an advisor type for PostgreSQL comment convention.
- PostgreSQLCommentConvention Type = "bb.plugin.advisor.postgresql.comment"
-
- // PostgreSQLTableRequirePK is an advisor type for PostgreSQL table require primary key.
- PostgreSQLTableRequirePK Type = "bb.plugin.advisor.postgresql.table.require-pk"
-
- // PostgreSQLNoLeadingWildcardLike is an advisor type for PostgreSQL no leading wildcard LIKE.
- PostgreSQLNoLeadingWildcardLike Type = "bb.plugin.advisor.postgresql.where.no-leading-wildcard-like"
-
- // PostgreSQLWhereRequirementForSelect is an advisor type for PostgreSQL WHERE clause requirement for SELECT statements.
- PostgreSQLWhereRequirementForSelect Type = "bb.plugin.advisor.postgresql.where.require.select"
-
- // PostgreSQLWhereRequirementForUpdateDelete is an advisor type for PostgreSQL WHERE clause requirement for UPDATE/DELETE statements.
- PostgreSQLWhereRequirementForUpdateDelete Type = "bb.plugin.advisor.postgresql.where.require.update-delete"
-
- // PostgreSQLNoSelectAll is an advisor type for PostgreSQL no select all.
- PostgreSQLNoSelectAll Type = "bb.plugin.advisor.postgresql.select.no-select-all"
-
- // PostgreSQLMigrationCompatibility is an advisor type for PostgreSQL migration compatibility.
- PostgreSQLMigrationCompatibility Type = "bb.plugin.advisor.postgresql.migration-compatibility"
-
- // PostgreSQLTableNoFK is an advisor type for PostgreSQL table disallow foreign key.
- PostgreSQLTableNoFK Type = "bb.plugin.advisor.postgresql.table.no-foreign-key"
-
- // PostgreSQLTableDisallowPartition is an advisor type for PostgreSQL disallow table partition.
- PostgreSQLTableDisallowPartition Type = "bb.plugin.advisor.postgresql.table.disallow-partition"
-
- // PostgreSQLInsertRowLimit is an advisor type for PostgreSQL to limit INSERT rows.
- PostgreSQLInsertRowLimit Type = "bb.plugin.advisor.postgresql.insert.row-limit"
-
- // PostgreSQLInsertMustSpecifyColumn is an advisor type for PostgreSQL to enforce column specified.
- PostgreSQLInsertMustSpecifyColumn Type = "bb.plugin.advisor.postgresql.insert.must-specify-column"
-
- // PostgreSQLInsertDisallowOrderByRand is an advisor type for PostgreSQL to disallow order by rand in INSERT statements.
- PostgreSQLInsertDisallowOrderByRand Type = "bb.plugin.advisor.postgresql.insert.disallow-order-by-rand"
-
- // PostgreSQLIndexKeyNumberLimit is an advisor type for postgresql index key number limit.
- PostgreSQLIndexKeyNumberLimit Type = "bb.plugin.advisor.postgresql.index.key-number-limit"
-
- // PostgreSQLPrimaryKeyTypeAllowlist is an advisor type for postgresql primary key type allowlist.
- PostgreSQLPrimaryKeyTypeAllowlist Type = "bb.plugin.advisor.postgresql.index.primary-key-type-allowlist"
-
- // PostgreSQLIndexTotalNumberLimit is an advisor type for PostgreSQL index total number limit.
- PostgreSQLIndexTotalNumberLimit Type = "bb.plugin.advisor.postgresql.index.total-number-limit"
-
- // PostgreSQLEncodingAllowlist is an advisor type for PostgreSQL encoding allowlist.
- PostgreSQLEncodingAllowlist Type = "bb.plugin.advisor.postgresql.charset.allowlist"
-
- // PostgreSQLIndexNoDuplicateColumn is an advisor type for Postgresql no duplicate columns in index.
- PostgreSQLIndexNoDuplicateColumn Type = "bb.plugin.advisor.postgresql.index.no-duplicate-column"
-
- // PostgreSQLIndexConcurrently is an advisor type for PostgreSQL to create or drop index concurrently.
- PostgreSQLIndexConcurrently Type = "bb.plugin.advisor.postgresql.index.create-concurrently"
-
- // PostgreSQLColumnTypeDisallowList is an advisor type for Postgresql column type disallow list.
- PostgreSQLColumnTypeDisallowList Type = "bb.plugin.advisor.postgresql.column.type-disallow-list"
-
- // PostgreSQLColumnDisallowChangingType is an advisor type for PostgreSQL disallow changing column type.
- PostgreSQLColumnDisallowChangingType Type = "bb.plugin.advisor.postgresql.column.disallow-changing-type"
-
- // PostgreSQLColumnMaximumCharacterLength is an advisor type for PostgreSQL maximum character length.
- PostgreSQLColumnMaximumCharacterLength Type = "bb.plugin.advisor.postgresql.column.maximum-character-length"
-
- // PostgreSQLRequireColumnDefault is an advisor type for PostgreSQL column default requirement.
- PostgreSQLRequireColumnDefault Type = "bb.plugin.advisor.postgresql.column.require-default"
-
- // PostgreSQLColumnDefaultDisallowVolatile is an advisor type for PostgreSQL column default disallow volatile.
- PostgreSQLColumnDefaultDisallowVolatile Type = "bb.plugin.advisor.postgresql.column.default-disallow-volatile"
-
- // PostgreSQLStatementDisallowCommit is an advisor type for PostgreSQL to disallow commit.
- PostgreSQLStatementDisallowCommit Type = "bb.plugin.advisor.postgresql.statement.disallow-commit"
-
- // PostgreSQLStatementDMLDryRun is an advisor type for PostgreSQL DML dry run.
- PostgreSQLStatementDMLDryRun Type = "bb.plugin.advisor.postgresql.statement.dml-dry-run"
-
- // PostgreSQLStatementAffectedRowLimit is an advisor type for PostgreSQL UPDATE/DELETE affected row limit.
- PostgreSQLStatementAffectedRowLimit Type = "bb.plugin.advisor.postgresql.statement.affected-row-limit"
-
- // PostgreSQLMergeAlterTable is an advisor type for PostgreSQL no redundant ALTER TABLE statements.
- PostgreSQLMergeAlterTable Type = "bb.plugin.advisor.postgresql.statement.merge-alter-table"
-
- // PostgreSQLAddCheckNotValid is an advisor type for PostgreSQL to add check not valid.
- PostgreSQLAddCheckNotValid Type = "bb.plugin.advisor.postgresql.statement.add-check-not-valid"
-
- // PostgreSQLAddFKNotValid is a PostgreSQL advisor type requiring add foreign key not valid.
- PostgreSQLAddFKNotValid Type = "bb.plugin.advisor.postgresql.statement.add-foreign-key-not-valid"
-
- // PostgreSQLDisallowAddColumnWithDefault is an advisor type for PostgreSQL to disallow add column with default.
- PostgreSQLDisallowAddColumnWithDefault Type = "bb.plugin.advisor.postgresql.statement.disallow-add-column-with-default"
-
- // PostgreSQLDisallowAddNotNull is an advisor type for PostgreSQl to disallow add not null.
- PostgreSQLDisallowAddNotNull Type = "bb.plugin.advisor.postgresql.statement.disallow-add-not-null"
-
- // PostgreSQLNonTransactional is an advisor type for PostgreSQL to disallow non-transactional statements.
- PostgreSQLNonTransactional Type = "bb.plugin.advisor.postgresql.statement.non-transactional"
-
- // PostgreSQLTableDropNamingConvention is an advisor type for PostgreSQL table drop with naming convention.
- PostgreSQLTableDropNamingConvention Type = "bb.plugin.advisor.postgresql.table.drop-naming-convention"
-
- // PostgreSQLCollationAllowlist is an advisor type for PostgreSQL collation allowlist.
- PostgreSQLCollationAllowlist Type = "bb.plugin.advisor.postgresql.collation.allowlist"
-
- // PostgreSQLStatementDisallowRemoveTblCascade is an advisor type for PostgreSQL to disallow CASCADE when removing a table.
- PostgreSQLStatementDisallowRemoveTblCascade Type = "bb.plugin.advisor.postgresql.statement.disallow-rm-tbl-cascade"
-
- // PostgreSQLStatementDisallowOnDelCascade is an advisor type for PostgreSQL to disallow ON DELETE CASCADE clauses.
- PostgreSQLStatementDisallowOnDelCascade Type = "bb.plugin.advisor.postgresql.statement.disallow-on-del-cascade"
-
- // PostgreSQLStatementCreateSpecifySchema is an advisor type for PostgreSQL to specify schema when creating.
- PostgreSQLStatementCreateSpecifySchema Type = "bb.plugin.advisor.postgresql.statement.create-specify-schema"
-
- // PostgreSQLStatementCheckSetRoleVariable is an advisor type for PostgreSQL to check set role variable.
- PostgreSQLStatementCheckSetRoleVariable Type = "bb.plugin.advisor.postgresql.statement.check-set-role-variable"
-
- PostgreSQLStatementDisallowMixInDDL Type = "bb.plugin.advisor.postgresql.statement.disallow-mix-in-ddl"
- PostgreSQLStatementDisallowMixInDML Type = "bb.plugin.advisor.postgresql.statement.disallow-mix-in-dml"
-
- // PostgreSQLBuiltinPriorBackupCheck is an advisor type for PostgreSQL do prior backup check.
- PostgreSQLBuiltinPriorBackupCheck Type = "bb.plugin.advisor.postgresql.builtin.prior-backup-check"
-
- // PostgreSQLStatementObjectOwnerCheck is an advisor type for PostgreSQL do object owner check.
- PostgreSQLStatementObjectOwnerCheck Type = "bb.plugin.advisor.postgresql.statement.object-owner-check"
-
- // PostgreSQLStatementMaximumLimitValue is an advisor type for PostgreSQL statement maximum limit value.
- PostgreSQLStatementMaximumLimitValue Type = "bb.plugin.advisor.postgresql.statement.maximum-limit-value"
-
- // PostgreSQLTableCommentConvention is an advisor type for PostgreSQL table comment convention.
- PostgreSQLTableCommentConvention Type = "bb.plugin.advisor.postgresql.table.comment"
-
- // Oracle Advisor.
-
- // OracleSyntax is an advisor type for Oracle syntax.
- OracleSyntax Type = "bb.plugin.advisor.oracle.syntax"
-
- // OracleBuiltinPriorBackupCheck is an advisor type for Oracle prior backup check.
- OracleBuiltinPriorBackupCheck Type = "bb.plugin.advisor.oracle.builtin.prior-backup-check"
-
- // OracleTableRequirePK is an advisor type for Oracle table require primary key.
- OracleTableRequirePK Type = "bb.plugin.advisor.oracle.table.require-pk"
-
- // OracleTableNoFK is an advisor type for Oracle table disallow foreign key.
- OracleTableNoFK Type = "bb.plugin.advisor.oracle.table.no-foreign-key"
-
- // OracleNamingTableConvention is an advisor type for Oracle table naming convention.
- OracleNamingTableConvention Type = "bb.plugin.advisor.oracle.naming.table"
-
- // OracleColumnRequirement is an advisor type for Oracle column requirement.
- OracleColumnRequirement Type = "bb.plugin.advisor.oracle.column.require"
-
- // OracleColumnTypeDisallowList is an advisor type for Oracle column type disallow list.
- OracleColumnTypeDisallowList Type = "bb.plugin.advisor.oracle.column.type-disallow-list"
-
- // OracleColumnMaximumCharacterLength is an advisor type for Oracle maximum character length.
- OracleColumnMaximumCharacterLength Type = "bb.plugin.advisor.oracle.column.maximum-character-length"
-
- // OracleColumnMaximumVarcharLength is an advisor type for Oracle maximum varchar length.
- OracleColumnMaximumVarcharLength Type = "bb.plugin.advisor.oracle.column.maximum-varchar-length"
-
- // OracleNoSelectAll is an advisor type for Oracle no select all.
- OracleNoSelectAll Type = "bb.plugin.advisor.oracle.select.no-select-all"
-
- // OracleNoLeadingWildcardLike is an advisor type for Oracle no leading wildcard LIKE.
- OracleNoLeadingWildcardLike Type = "bb.plugin.advisor.oracle.where.no-leading-wildcard-like"
-
- // OracleWhereRequirementForSelect is an advisor type for Oracle WHERE clause requirement in SELECT statements.
- OracleWhereRequirementForSelect Type = "bb.plugin.advisor.oracle.where.require.select"
-
- // OracleWhereRequirementForUpdateDelete is an advisor type for Oracle WHERE clause requirement in UPDATE/DELETE statements.
- OracleWhereRequirementForUpdateDelete Type = "bb.plugin.advisor.oracle.where.require.update-delete"
-
- // OracleInsertMustSpecifyColumn is an advisor type for Oracle to enforce column specified.
- OracleInsertMustSpecifyColumn Type = "bb.plugin.advisor.oracle.insert.must-specify-column"
-
- // OracleIndexKeyNumberLimit is an advisor type for Oracle index key number limit.
- OracleIndexKeyNumberLimit Type = "bb.plugin.advisor.oracle.index.key-number-limit"
-
- // OracleColumnNoNull is an advisor type for Oracle column no NULL value.
- OracleColumnNoNull Type = "bb.plugin.advisor.oracle.column.no-null"
-
- // OracleRequireColumnDefault is an advisor type for Oracle column default requirement.
- OracleRequireColumnDefault Type = "bb.plugin.advisor.oracle.column.require-default"
-
- // OracleAddNotNullColumnRequireDefault is an advisor type for Oracle adding not null column requires default.
- OracleAddNotNullColumnRequireDefault Type = "bb.plugin.advisor.oracle.column.add-not-null-column-require-default"
-
- // OracleTableNamingNoKeyword is an advisor type for Oracle table naming convention without keyword.
- OracleTableNamingNoKeyword Type = "bb.plugin.advisor.oracle.naming.table-no-keyword"
-
- // OracleIdentifierNamingNoKeyword is an advisor type for Oracle identifier naming convention without keyword.
- OracleIdentifierNamingNoKeyword Type = "bb.plugin.advisor.oracle.naming.identifier-no-keyword"
-
- // OracleIdentifierCase is an advisor type for Oracle identifier case.
- OracleIdentifierCase Type = "bb.plugin.advisor.oracle.naming.identifier-case"
-
- // OracleStatementDMLDryRun is an advisor type for Oracle DML dry run.
- OracleStatementDMLDryRun Type = "bb.plugin.advisor.oracle.statement.dml-dry-run"
-
- OracleStatementDisallowMixInDDL Type = "bb.plugin.advisor.oracle.statement.disallow-mix-in-ddl"
- OracleStatementDisallowMixInDML Type = "bb.plugin.advisor.oracle.statement.disallow-mix-in-dml"
-
- // OracleTableCommentConvention is an advisor type for Oracle table comment convention.
- OracleTableCommentConvention Type = "bb.plugin.advisor.oracle.table.comment"
- // OracleColumnCommentConvention is an advisor type for Oracle column comment convention.
- OracleColumnCommentConvention Type = "bb.plugin.advisor.oracle.column.comment"
-
- // Snowflake Advisor.
-
- // SnowflakeSyntax is an advisor type for Snowflake syntax.
- SnowflakeSyntax Type = "bb.plugin.advisor.snowflake.syntax"
-
- // SnowflakeNamingTableConvention is an advisor type for Snowflake table naming convention.
- SnowflakeNamingTableConvention Type = "bb.plugin.advisor.snowflake.naming.table"
-
- // SnowflakeTableRequirePK is an advisor type for Snowflake table require primary key.
- SnowflakeTableRequirePK Type = "bb.plugin.advisor.snowflake.table.require-pk"
-
- // SnowflakeTableNoFK is an advisor type for Snowflake table disallow foreign key.
- SnowflakeTableNoFK Type = "bb.plugin.advisor.snowflake.table.no-foreign-key"
-
- // SnowflakeColumnMaximumVarcharLength is an advisor type for Snowflake maximum varchar length.
- SnowflakeColumnMaximumVarcharLength Type = "bb.plugin.advisor.snowflake.column.maximum-varchar-length"
-
- // SnowflakeTableNamingNoKeyword is an advisor type for Snowflake table naming convention without keyword.
- SnowflakeTableNamingNoKeyword Type = "bb.plugin.advisor.snowflake.naming.table-no-keyword"
-
- // SnowflakeWhereRequirement is an advisor type for Snowflake WHERE clause requirement.
- SnowflakeWhereRequirement Type = "bb.plugin.advisor.snowflake.where.require"
-
- // SnowflakeWhereRequirementForSelect is an advisor type for Snowflake WHERE clause requirement for SELECT statements.
- SnowflakeWhereRequirementForSelect Type = "bb.plugin.advisor.snowflake.where.require.select"
-
- // SnowflakeWhereRequirementForUpdateDelete is an advisor type for Snowflake WHERE clause requirement for UPDATE/DELETE statements.
- SnowflakeWhereRequirementForUpdateDelete Type = "bb.plugin.advisor.snowflake.where.require.update-delete"
-
- // SnowflakeIdentifierNamingNoKeyword is an advisor type for Snowflake identifier naming convention without keyword.
- SnowflakeIdentifierNamingNoKeyword Type = "bb.plugin.advisor.snowflake.naming.identifier-no-keyword"
-
- // SnowflakeColumnRequirement is an advisor type for Snowflake column requirement.
- SnowflakeColumnRequirement Type = "bb.plugin.advisor.snowflake.column.require"
-
- // SnowflakeIdentifierCase is an advisor type for Snowflake identifier case.
- SnowflakeIdentifierCase Type = "bb.plugin.advisor.snowflake.naming.identifier-case"
-
- // SnowflakeColumnNoNull is an advisor type for Snowflake column no NULL value.
- SnowflakeColumnNoNull Type = "bb.plugin.advisor.snowflake.column.no-null"
-
- // SnowflakeNoSelectAll is an advisor type for Snowflake no select all.
- SnowflakeNoSelectAll Type = "bb.plugin.advisor.snowflake.select.no-select-all"
-
- // SnowflakeTableDropNamingConvention is an advisor type for Snowflake table drop with naming convention.
- SnowflakeTableDropNamingConvention Type = "bb.plugin.advisor.snowflake.table.drop-naming-convention"
-
- // SnowflakeMigrationCompatibility is an advisor type for Snowflake migration compatibility.
- SnowflakeMigrationCompatibility Type = "bb.plugin.advisor.snowflake.migration-compatibility"
-
- // MSSQL Advisor.
-
- // MSSQLSyntax is an advisor type for MSSQL syntax.
- MSSQLSyntax Type = "bb.plugin.advisor.mssql.syntax"
-
- // MSSQLBuiltinPriorBackupCheck is an advisor type for MSSQL prior backup check.
- MSSQLBuiltinPriorBackupCheck Type = "bb.plugin.advisor.mssql.builtin.prior-backup-check"
-
- // MSSQLNoSelectAll is an advisor type for MSSQL no select all.
- MSSQLNoSelectAll Type = "bb.plugin.advisor.mssql.select.no-select-all"
-
- // MSSQLNamingTableConvention is an advisor type for MSSQL table naming convention.
- MSSQLNamingTableConvention Type = "bb.plugin.advisor.mssql.naming.table"
-
- // MSSQLTableNamingNoKeyword is an advisor type for MSSQL table naming convention without keyword.
- MSSQLTableNamingNoKeyword Type = "bb.plugin.advisor.mssql.naming.table-no-keyword"
-
- // MSSQLIdentifierNamingNoKeyword is an advisor type for MSSQL identifier naming convention without keyword.
- MSSQLIdentifierNamingNoKeyword Type = "bb.plugin.advisor.mssql.naming.identifier-no-keyword"
-
- // MSSQLWhereRequirementForSelect is an advisor type for MySQL WHERE clause requirement in SELECT statements.
- MSSQLWhereRequirementForSelect Type = "bb.plugin.advisor.mssql.where.require.select"
-
- // MSSQLWhereRequirementForUpdateDelete is an advisor type for MySQL WHERE clause requirement in UPDATE/DELETE statements.
- MSSQLWhereRequirementForUpdateDelete Type = "bb.plugin.advisor.mssql.where.require.update-delete"
-
- // MSSQLColumnMaximumVarcharLength is an advisor type for MSSQL maximum varchar length.
- MSSQLColumnMaximumVarcharLength Type = "bb.plugin.advisor.mssql.column.maximum-varchar-length"
-
- // MSSQLTableDropNamingConvention is an advisor type for MSSQL table drop with naming convention.
- MSSQLTableDropNamingConvention Type = "bb.plugin.advisor.mssql.table.drop-naming-convention"
-
- // MSSQLTableRequirePK is an advisor type for MSSQL table require primary key.
- MSSQLTableRequirePK Type = "bb.plugin.advisor.mssql.table.require-pk"
-
- // MSSQLColumnNoNull is an advisor type for MSSQL column no NULL value.
- MSSQLColumnNoNull Type = "bb.plugin.advisor.mssql.column.no-null"
-
- // MSSQLTableNoFK is an advisor type for MSSQL table disallow foreign key.
- MSSQLTableNoFK Type = "bb.plugin.advisor.mssql.table.no-foreign-key"
-
- // MSSQLMigrationCompatibility is an advisor type for MSSQL migration compatibility.
- MSSQLMigrationCompatibility Type = "bb.plugin.advisor.mssql.migration-compatibility"
-
- // MSSQLColumnRequirement is an advisor type for MSSQL column requirement.
- MSSQLColumnRequirement Type = "bb.plugin.advisor.mssql.column.require"
-
- // MSSQLColumnTypeDisallowList is an advisor type for MSSQL column type disallow list.
- MSSQLColumnTypeDisallowList Type = "bb.plugin.advisor.mssql.column.type-disallow-list"
-
- // MSSQLTableDisallowDDL is an advisor type for MSSQL disallow DDL for specific tables.
- MSSQLTableDisallowDDL = "bb.plugin.advisor.mssql.table.disallow-ddl"
-
- // MSSQLTableDisallowDML is an advisor type for MSSQL disallow DML for specific tables.
- MSSQLTableDisallowDML = "bb.plugin.advisor.mssql.table.disallow-dml"
-
- // MSSQLFuctionDisallowCreate restricts the creation of functions.
- MSSQLFunctionDisallowCreateOrAlter Type = "bb.plugin.advisor.mssql.function.disallow-create-or-alter"
-
- // MSSQLProcedureDisallowCreateOrAlter restricts the creation of procedures.
- MSSQLProcedureDisallowCreateOrAlter Type = "bb.plugin.advisor.mssql.procedure.disallow-create-or-alter"
-
- // MSSQLStatementDisallowCrossDBQueries prohibits cross database queries.
- MSSQLStatementDisallowCrossDBQueries Type = "bb.plugin.advisor.mssql.statement.disallow-cross-db-queries"
-
- // MSSQLStatementWhereDisallowFunctionsAndCalculations prohibit using functions or performing calculation in the where clause.
- MSSQLStatementWhereDisallowFunctionsAndCalculations Type = "bb.plugin.advisor.mssql.statement.disallow-functions-and-calculations"
-
- MSSQLIndexNotRedundant Type = "bb.plugin.advisor.mssql.index.not-redundant"
-
- MSSQLStatementDisallowMixInDDL Type = "bb.plugin.advisor.mssql.statement.disallow-mix-in-ddl"
- MSSQLStatementDisallowMixInDML Type = "bb.plugin.advisor.mssql.statement.disallow-mix-in-dml"
-)
diff --git a/backend/plugin/advisor/mssql/mssql_rules_test.go b/backend/plugin/advisor/mssql/mssql_rules_test.go
index 5bb3db521c..9423cd20ed 100644
--- a/backend/plugin/advisor/mssql/mssql_rules_test.go
+++ b/backend/plugin/advisor/mssql/mssql_rules_test.go
@@ -29,7 +29,7 @@ func TestMSSQLRules(t *testing.T) {
advisor.SchemaRuleFunctionDisallowCreate,
advisor.SchemaRuleProcedureDisallowCreate,
advisor.SchemaRuleStatementDisallowCrossDBQueries,
- advisor.SchemaRuleStatementWhereDisallowFunctionsAndCaculations,
+ advisor.SchemaRuleStatementWhereDisallowFunctionsAndCalculations,
advisor.SchemaRuleIndexNotRedundant,
advisor.SchemaRuleStatementDisallowMixInDDL,
advisor.SchemaRuleStatementDisallowMixInDML,
diff --git a/backend/plugin/advisor/mssql/rule_builtin_prior_backup_check.go b/backend/plugin/advisor/mssql/rule_builtin_prior_backup_check.go
index a5fc7712a7..a052fdb772 100644
--- a/backend/plugin/advisor/mssql/rule_builtin_prior_backup_check.go
+++ b/backend/plugin/advisor/mssql/rule_builtin_prior_backup_check.go
@@ -26,7 +26,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLBuiltinPriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.BuiltinRulePriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
}
type StatementPriorBackupCheckAdvisor struct {
diff --git a/backend/plugin/advisor/mssql/rule_column_maximum_varchar_length.go b/backend/plugin/advisor/mssql/rule_column_maximum_varchar_length.go
index 0b1ed28971..aa87e845bf 100644
--- a/backend/plugin/advisor/mssql/rule_column_maximum_varchar_length.go
+++ b/backend/plugin/advisor/mssql/rule_column_maximum_varchar_length.go
@@ -23,7 +23,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
}
// ColumnMaximumVarcharLengthAdvisor is the advisor checking for maximum varchar length..
diff --git a/backend/plugin/advisor/mssql/rule_column_no_null.go b/backend/plugin/advisor/mssql/rule_column_no_null.go
index 3b78515eae..d1f331de5d 100644
--- a/backend/plugin/advisor/mssql/rule_column_no_null.go
+++ b/backend/plugin/advisor/mssql/rule_column_no_null.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLColumnNoNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
}
// ColumnNoNullAdvisor is the advisor checking for column no NULL value..
diff --git a/backend/plugin/advisor/mssql/rule_column_require.go b/backend/plugin/advisor/mssql/rule_column_require.go
index 755d89c5b2..c5c264d074 100644
--- a/backend/plugin/advisor/mssql/rule_column_require.go
+++ b/backend/plugin/advisor/mssql/rule_column_require.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLColumnRequirement, &ColumnRequireAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleRequiredColumn, &ColumnRequireAdvisor{})
}
// ColumnRequireAdvisor is the advisor checking for column requirement..
diff --git a/backend/plugin/advisor/mssql/rule_column_type_disallow_list.go b/backend/plugin/advisor/mssql/rule_column_type_disallow_list.go
index 261337b70b..35c7aba97a 100644
--- a/backend/plugin/advisor/mssql/rule_column_type_disallow_list.go
+++ b/backend/plugin/advisor/mssql/rule_column_type_disallow_list.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
}
// ColumnTypeDisallowListAdvisor is the advisor checking for disallowed types for column.
diff --git a/backend/plugin/advisor/mssql/rule_function_disallow_create_or_alter.go b/backend/plugin/advisor/mssql/rule_function_disallow_create_or_alter.go
index c575daac52..0023db3a22 100644
--- a/backend/plugin/advisor/mssql/rule_function_disallow_create_or_alter.go
+++ b/backend/plugin/advisor/mssql/rule_function_disallow_create_or_alter.go
@@ -13,7 +13,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLFunctionDisallowCreateOrAlter, &FunctionDisallowCreateOrAlterAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleFunctionDisallowCreate, &FunctionDisallowCreateOrAlterAdvisor{})
}
type FunctionDisallowCreateOrAlterAdvisor struct{}
diff --git a/backend/plugin/advisor/mssql/rule_index_not_redundant.go b/backend/plugin/advisor/mssql/rule_index_not_redundant.go
index 951900d387..f7103315f4 100644
--- a/backend/plugin/advisor/mssql/rule_index_not_redundant.go
+++ b/backend/plugin/advisor/mssql/rule_index_not_redundant.go
@@ -16,7 +16,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLIndexNotRedundant, &IndexNotRedundantAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleIndexNotRedundant, &IndexNotRedundantAdvisor{})
}
var dftMSSQLSchemaName = "dbo"
diff --git a/backend/plugin/advisor/mssql/rule_migration_compatibility.go b/backend/plugin/advisor/mssql/rule_migration_compatibility.go
index 6037b57e9b..3bf6b5c732 100644
--- a/backend/plugin/advisor/mssql/rule_migration_compatibility.go
+++ b/backend/plugin/advisor/mssql/rule_migration_compatibility.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLMigrationCompatibility, &MigrationCompatibilityAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleSchemaBackwardCompatibility, &MigrationCompatibilityAdvisor{})
}
// MigrationCompatibilityAdvisor is the advisor checking for migration compatibility.
diff --git a/backend/plugin/advisor/mssql/rule_naming_identifier_no_keyword.go b/backend/plugin/advisor/mssql/rule_naming_identifier_no_keyword.go
index 49ff947e09..bd2aaee749 100644
--- a/backend/plugin/advisor/mssql/rule_naming_identifier_no_keyword.go
+++ b/backend/plugin/advisor/mssql/rule_naming_identifier_no_keyword.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLIdentifierNamingNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleIdentifierNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
}
// NamingIdentifierNoKeywordAdvisor is the advisor checking for identifier naming convention without keyword.
diff --git a/backend/plugin/advisor/mssql/rule_naming_table.go b/backend/plugin/advisor/mssql/rule_naming_table.go
index 9286788a53..e1a27f16ab 100644
--- a/backend/plugin/advisor/mssql/rule_naming_table.go
+++ b/backend/plugin/advisor/mssql/rule_naming_table.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLNamingTableConvention, &NamingTableAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleTableNaming, &NamingTableAdvisor{})
}
// NamingTableAdvisor is the advisor checking for table naming convention..
diff --git a/backend/plugin/advisor/mssql/rule_naming_table_no_keyword.go b/backend/plugin/advisor/mssql/rule_naming_table_no_keyword.go
index 79dd978ced..fd04b27c8e 100644
--- a/backend/plugin/advisor/mssql/rule_naming_table_no_keyword.go
+++ b/backend/plugin/advisor/mssql/rule_naming_table_no_keyword.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLTableNamingNoKeyword, &NamingTableNoKeywordAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleTableNameNoKeyword, &NamingTableNoKeywordAdvisor{})
}
// NamingTableNoKeywordAdvisor is the advisor checking for table naming convention without keyword.
diff --git a/backend/plugin/advisor/mssql/rule_procedure_disallow_create_or_alter.go b/backend/plugin/advisor/mssql/rule_procedure_disallow_create_or_alter.go
index 6656842a05..729c41878b 100644
--- a/backend/plugin/advisor/mssql/rule_procedure_disallow_create_or_alter.go
+++ b/backend/plugin/advisor/mssql/rule_procedure_disallow_create_or_alter.go
@@ -13,7 +13,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLProcedureDisallowCreateOrAlter, &ProcedureDisallowCreateOrAlterAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleProcedureDisallowCreate, &ProcedureDisallowCreateOrAlterAdvisor{})
}
type ProcedureDisallowCreateOrAlterAdvisor struct{}
diff --git a/backend/plugin/advisor/mssql/rule_select_no_select_all.go b/backend/plugin/advisor/mssql/rule_select_no_select_all.go
index 1a384ed408..f1007eb965 100644
--- a/backend/plugin/advisor/mssql/rule_select_no_select_all.go
+++ b/backend/plugin/advisor/mssql/rule_select_no_select_all.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLNoSelectAll, &SelectNoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleStatementNoSelectAll, &SelectNoSelectAllAdvisor{})
}
// SelectNoSelectAllAdvisor is the advisor checking for no select all.
diff --git a/backend/plugin/advisor/mssql/rule_statement_disallow_cross_db_queries.go b/backend/plugin/advisor/mssql/rule_statement_disallow_cross_db_queries.go
index eb2d3c8a0f..c862820542 100644
--- a/backend/plugin/advisor/mssql/rule_statement_disallow_cross_db_queries.go
+++ b/backend/plugin/advisor/mssql/rule_statement_disallow_cross_db_queries.go
@@ -16,7 +16,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLStatementDisallowCrossDBQueries, &DisallowCrossDBQueriesAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleStatementDisallowCrossDBQueries, &DisallowCrossDBQueriesAdvisor{})
}
type DisallowCrossDBQueriesAdvisor struct{}
diff --git a/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_ddl.go b/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_ddl.go
index 352b0ad4a8..2ddfa83c3e 100644
--- a/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_ddl.go
+++ b/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_ddl.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
}
type StatementDisallowMixInDDLAdvisor struct {
diff --git a/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_dml.go b/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_dml.go
index 2e27fd7984..fbcff210ef 100644
--- a/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_dml.go
+++ b/backend/plugin/advisor/mssql/rule_statement_disallow_mix_in_dml.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
}
type StatementDisallowMixInDMLAdvisor struct {
diff --git a/backend/plugin/advisor/mssql/rule_statement_where_disallow_functions_and_calculations.go b/backend/plugin/advisor/mssql/rule_statement_where_disallow_functions_and_calculations.go
index a79bc19276..9a0d339867 100644
--- a/backend/plugin/advisor/mssql/rule_statement_where_disallow_functions_and_calculations.go
+++ b/backend/plugin/advisor/mssql/rule_statement_where_disallow_functions_and_calculations.go
@@ -14,7 +14,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLStatementWhereDisallowFunctionsAndCalculations, &DisallowFuncAndCalculationsAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleStatementWhereDisallowFunctionsAndCalculations, &DisallowFuncAndCalculationsAdvisor{})
}
type DisallowFuncAndCalculationsAdvisor struct{}
diff --git a/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_select.go b/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_select.go
index 8c69f86262..f3f7277cdb 100644
--- a/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_select.go
+++ b/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_select.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLWhereRequirementForSelect, &WhereRequirementForSelectAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequirementForSelectAdvisor{})
}
// WhereRequirementForSelectAdvisor is the advisor checking for WHERE clause requirement for SELECT statements.
diff --git a/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_update_delete.go b/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_update_delete.go
index 7369a67b0c..db6deea9fe 100644
--- a/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_update_delete.go
+++ b/backend/plugin/advisor/mssql/rule_statement_where_requirement_for_update_delete.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLWhereRequirementForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
}
// WhereRequirementForUpdateDeleteAdvisor is the advisor checking for WHERE clause requirement for UPDATE/DELETE statements.
diff --git a/backend/plugin/advisor/mssql/rule_table_disallow_ddl.go b/backend/plugin/advisor/mssql/rule_table_disallow_ddl.go
index 0d9bac51fc..71ca7045f9 100644
--- a/backend/plugin/advisor/mssql/rule_table_disallow_ddl.go
+++ b/backend/plugin/advisor/mssql/rule_table_disallow_ddl.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLTableDisallowDDL, &TableDisallowDDLAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleTableDisallowDDL, &TableDisallowDDLAdvisor{})
}
// TableDisallowDDLAdvisor is the advisor checking for disallow DDL on specific tables.
diff --git a/backend/plugin/advisor/mssql/rule_table_disallow_dml.go b/backend/plugin/advisor/mssql/rule_table_disallow_dml.go
index 25eb54bd13..cf843dda01 100644
--- a/backend/plugin/advisor/mssql/rule_table_disallow_dml.go
+++ b/backend/plugin/advisor/mssql/rule_table_disallow_dml.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLTableDisallowDML, &TableDisallowDMLAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleTableDisallowDML, &TableDisallowDMLAdvisor{})
}
// TableDisallowDMLAdvisor is the advisor checking for disallow DML on specific tables.
diff --git a/backend/plugin/advisor/mssql/rule_table_drop_naming_convention.go b/backend/plugin/advisor/mssql/rule_table_drop_naming_convention.go
index 30760ec280..670179f18d 100644
--- a/backend/plugin/advisor/mssql/rule_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/mssql/rule_table_drop_naming_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
}
// TableDropNamingConventionAdvisor is the advisor checking for table drop with naming convention.
diff --git a/backend/plugin/advisor/mssql/rule_table_no_foreign_key.go b/backend/plugin/advisor/mssql/rule_table_no_foreign_key.go
index 95d0ae747f..65c32dfb4b 100644
--- a/backend/plugin/advisor/mssql/rule_table_no_foreign_key.go
+++ b/backend/plugin/advisor/mssql/rule_table_no_foreign_key.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLTableNoFK, &TableNoForeignKeyAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleTableNoFK, &TableNoForeignKeyAdvisor{})
}
// TableNoForeignKeyAdvisor is the advisor checking for table disallow foreign key..
diff --git a/backend/plugin/advisor/mssql/rule_table_require_pk.go b/backend/plugin/advisor/mssql/rule_table_require_pk.go
index 867b8ca65d..94f2cf154c 100644
--- a/backend/plugin/advisor/mssql/rule_table_require_pk.go
+++ b/backend/plugin/advisor/mssql/rule_table_require_pk.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MSSQL, advisor.MSSQLTableRequirePK, &TableRequirePkAdvisor{})
+ advisor.Register(storepb.Engine_MSSQL, advisor.SchemaRuleTableRequirePK, &TableRequirePkAdvisor{})
}
// TableRequirePkAdvisor is the advisor checking for table require primary key..
diff --git a/backend/plugin/advisor/mysql/mysql_rules_test.go b/backend/plugin/advisor/mysql/mysql_rules_test.go
index 3293bee14f..b6b90c1d0d 100644
--- a/backend/plugin/advisor/mysql/mysql_rules_test.go
+++ b/backend/plugin/advisor/mysql/mysql_rules_test.go
@@ -62,7 +62,7 @@ func TestMySQLRules(t *testing.T) {
// advisor.SchemaRuleStatementMaximumJoinTableCount enforces maximum of tables in the joins.
advisor.SchemaRuleStatementMaximumJoinTableCount,
// advisor.SchemaRuleStatementWhereDisallowUsingFunction disallow using function in where clause.
- advisor.SchemaRuleStatementWhereDisallowFunctionsAndCaculations,
+ advisor.SchemaRuleStatementWhereDisallowFunctionsAndCalculations,
// advisor.SchemaRuleStatementWhereMaximumLogicalOperatorCount enforces maximum number of logical operators in the where clause.
advisor.SchemaRuleStatementWhereMaximumLogicalOperatorCount,
// advisor.SchemaRuleStatementMaxExecutionTime enforce the maximum execution time.
diff --git a/backend/plugin/advisor/mysql/rule_builtin_prior_backup_check.go b/backend/plugin/advisor/mysql/rule_builtin_prior_backup_check.go
index 0f526ae09c..4844b333cd 100644
--- a/backend/plugin/advisor/mysql/rule_builtin_prior_backup_check.go
+++ b/backend/plugin/advisor/mysql/rule_builtin_prior_backup_check.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLBuiltinPriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.BuiltinRulePriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
}
type StatementPriorBackupCheckAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_charset_allowlist.go b/backend/plugin/advisor/mysql/rule_charset_allowlist.go
index 235dafdf37..decf543be8 100644
--- a/backend/plugin/advisor/mysql/rule_charset_allowlist.go
+++ b/backend/plugin/advisor/mysql/rule_charset_allowlist.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLCharsetAllowlist, &CharsetAllowlistAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLCharsetAllowlist, &CharsetAllowlistAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLCharsetAllowlist, &CharsetAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleCharsetAllowlist, &CharsetAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleCharsetAllowlist, &CharsetAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleCharsetAllowlist, &CharsetAllowlistAdvisor{})
}
// CharsetAllowlistAdvisor is the advisor checking for charset allowlist.
diff --git a/backend/plugin/advisor/mysql/rule_collation_allowlist.go b/backend/plugin/advisor/mysql/rule_collation_allowlist.go
index 84b3492b72..89aa449d85 100644
--- a/backend/plugin/advisor/mysql/rule_collation_allowlist.go
+++ b/backend/plugin/advisor/mysql/rule_collation_allowlist.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLCollationAllowlist, &CollationAllowlistAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLCollationAllowlist, &CollationAllowlistAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLCollationAllowlist, &CollationAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleCollationAllowlist, &CollationAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleCollationAllowlist, &CollationAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleCollationAllowlist, &CollationAllowlistAdvisor{})
}
// CollationAllowlistAdvisor is the advisor checking for collation allowlist.
diff --git a/backend/plugin/advisor/mysql/rule_column_auto_increment_initial_value.go b/backend/plugin/advisor/mysql/rule_column_auto_increment_initial_value.go
index c9da999904..67fa603698 100644
--- a/backend/plugin/advisor/mysql/rule_column_auto_increment_initial_value.go
+++ b/backend/plugin/advisor/mysql/rule_column_auto_increment_initial_value.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLAutoIncrementColumnInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLAutoIncrementColumnInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLAutoIncrementColumnInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnAutoIncrementInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnAutoIncrementInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnAutoIncrementInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
}
// ColumnAutoIncrementInitialValueAdvisor is the advisor checking for auto-increment column initial value.
diff --git a/backend/plugin/advisor/mysql/rule_column_auto_increment_must_integer.go b/backend/plugin/advisor/mysql/rule_column_auto_increment_must_integer.go
index 6d4875a5dd..48f5e01062 100644
--- a/backend/plugin/advisor/mysql/rule_column_auto_increment_must_integer.go
+++ b/backend/plugin/advisor/mysql/rule_column_auto_increment_must_integer.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLAutoIncrementColumnMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLAutoIncrementColumnMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLAutoIncrementColumnMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnAutoIncrementMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnAutoIncrementMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnAutoIncrementMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
}
// ColumnAutoIncrementMustIntegerAdvisor is the advisor checking for auto-increment column type.
diff --git a/backend/plugin/advisor/mysql/rule_column_auto_increment_must_unsigned.go b/backend/plugin/advisor/mysql/rule_column_auto_increment_must_unsigned.go
index 2ecd621582..04b42e28ca 100644
--- a/backend/plugin/advisor/mysql/rule_column_auto_increment_must_unsigned.go
+++ b/backend/plugin/advisor/mysql/rule_column_auto_increment_must_unsigned.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLAutoIncrementColumnMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLAutoIncrementColumnMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLAutoIncrementColumnMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnAutoIncrementMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnAutoIncrementMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnAutoIncrementMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
}
// ColumnAutoIncrementMustUnsignedAdvisor is the advisor checking for unsigned auto-increment column.
diff --git a/backend/plugin/advisor/mysql/rule_column_comment_convention.go b/backend/plugin/advisor/mysql/rule_column_comment_convention.go
index c2c0653d1f..146b526f0a 100644
--- a/backend/plugin/advisor/mysql/rule_column_comment_convention.go
+++ b/backend/plugin/advisor/mysql/rule_column_comment_convention.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnCommentConvention, &ColumnCommentConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnCommentConvention, &ColumnCommentConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnCommentConvention, &ColumnCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnCommentConvention, &ColumnCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnCommentConvention, &ColumnCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnCommentConvention, &ColumnCommentConventionAdvisor{})
}
// ColumnCommentConventionAdvisor is the advisor checking for column comment convention.
diff --git a/backend/plugin/advisor/mysql/rule_column_current_time_count_limit.go b/backend/plugin/advisor/mysql/rule_column_current_time_count_limit.go
index ba01ec7ded..eaf7543208 100644
--- a/backend/plugin/advisor/mysql/rule_column_current_time_count_limit.go
+++ b/backend/plugin/advisor/mysql/rule_column_current_time_count_limit.go
@@ -26,9 +26,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
}
// ColumnCurrentTimeCountLimitAdvisor is the advisor checking for current time column count limit.
diff --git a/backend/plugin/advisor/mysql/rule_column_disallow_changing.go b/backend/plugin/advisor/mysql/rule_column_disallow_changing.go
index e97ed82d29..5efab3bff6 100644
--- a/backend/plugin/advisor/mysql/rule_column_disallow_changing.go
+++ b/backend/plugin/advisor/mysql/rule_column_disallow_changing.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnDisallowChanging, &ColumnDisallowChangingAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnDisallowChanging, &ColumnDisallowChangingAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnDisallowChanging, &ColumnDisallowChangingAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnDisallowChange, &ColumnDisallowChangingAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnDisallowChange, &ColumnDisallowChangingAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnDisallowChange, &ColumnDisallowChangingAdvisor{})
}
// ColumnDisallowChangingAdvisor is the advisor checking for disallow CHANGE COLUMN statement.
diff --git a/backend/plugin/advisor/mysql/rule_column_disallow_changing_order.go b/backend/plugin/advisor/mysql/rule_column_disallow_changing_order.go
index af2fbd6397..71228a6899 100644
--- a/backend/plugin/advisor/mysql/rule_column_disallow_changing_order.go
+++ b/backend/plugin/advisor/mysql/rule_column_disallow_changing_order.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
}
// ColumnDisallowChangingOrderAdvisor is the advisor checking for disallow changing column order.
diff --git a/backend/plugin/advisor/mysql/rule_column_disallow_changing_type.go b/backend/plugin/advisor/mysql/rule_column_disallow_changing_type.go
index 7bfaf86d62..390dfd1be2 100644
--- a/backend/plugin/advisor/mysql/rule_column_disallow_changing_type.go
+++ b/backend/plugin/advisor/mysql/rule_column_disallow_changing_type.go
@@ -22,9 +22,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnDisallowChangingType, &ColumnDisallowChangingTypeAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnDisallowChangingType, &ColumnDisallowChangingTypeAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnDisallowChangingType, &ColumnDisallowChangingTypeAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnDisallowChangeType, &ColumnDisallowChangingTypeAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnDisallowChangeType, &ColumnDisallowChangingTypeAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnDisallowChangeType, &ColumnDisallowChangingTypeAdvisor{})
}
// ColumnDisallowChangingTypeAdvisor is the advisor checking for disallow changing column type.
diff --git a/backend/plugin/advisor/mysql/rule_column_disallow_drop.go b/backend/plugin/advisor/mysql/rule_column_disallow_drop.go
index 97cfd330f1..32f29b3673 100644
--- a/backend/plugin/advisor/mysql/rule_column_disallow_drop.go
+++ b/backend/plugin/advisor/mysql/rule_column_disallow_drop.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnDisallowDrop, &ColumnDisallowDropAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnDisallowDrop, &ColumnDisallowDropAdvisor{})
}
// ColumnDisallowDropAdvisor is the advisor checking for disallow DROP COLUMN statement.
diff --git a/backend/plugin/advisor/mysql/rule_column_disallow_drop_in_index.go b/backend/plugin/advisor/mysql/rule_column_disallow_drop_in_index.go
index 917d80da70..c95e706290 100644
--- a/backend/plugin/advisor/mysql/rule_column_disallow_drop_in_index.go
+++ b/backend/plugin/advisor/mysql/rule_column_disallow_drop_in_index.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
}
// ColumnDisallowDropInIndexAdvisor is the advisor checking for disallow DROP COLUMN in index.
diff --git a/backend/plugin/advisor/mysql/rule_column_disallow_set_charset.go b/backend/plugin/advisor/mysql/rule_column_disallow_set_charset.go
index 980d03f09e..757f70465b 100644
--- a/backend/plugin/advisor/mysql/rule_column_disallow_set_charset.go
+++ b/backend/plugin/advisor/mysql/rule_column_disallow_set_charset.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLDisallowSetColumnCharset, &ColumnDisallowSetCharsetAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLDisallowSetColumnCharset, &ColumnDisallowSetCharsetAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLDisallowSetColumnCharset, &ColumnDisallowSetCharsetAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnDisallowSetCharset, &ColumnDisallowSetCharsetAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnDisallowSetCharset, &ColumnDisallowSetCharsetAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnDisallowSetCharset, &ColumnDisallowSetCharsetAdvisor{})
}
// ColumnDisallowSetCharsetAdvisor is the advisor checking for disallow set column charset.
diff --git a/backend/plugin/advisor/mysql/rule_column_maximum_character_length.go b/backend/plugin/advisor/mysql/rule_column_maximum_character_length.go
index 910b699686..08f870e9ea 100644
--- a/backend/plugin/advisor/mysql/rule_column_maximum_character_length.go
+++ b/backend/plugin/advisor/mysql/rule_column_maximum_character_length.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
}
// ColumnMaximumCharacterLengthAdvisor is the advisor checking for max character length.
diff --git a/backend/plugin/advisor/mysql/rule_column_maximum_varchar_length.go b/backend/plugin/advisor/mysql/rule_column_maximum_varchar_length.go
index 1bfe4aa1b4..9537fc1955 100644
--- a/backend/plugin/advisor/mysql/rule_column_maximum_varchar_length.go
+++ b/backend/plugin/advisor/mysql/rule_column_maximum_varchar_length.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
}
// ColumnMaximumVarcharLengthAdvisor is the advisor checking for max varchar length.
diff --git a/backend/plugin/advisor/mysql/rule_column_no_null.go b/backend/plugin/advisor/mysql/rule_column_no_null.go
index 43fc9fe9d1..9c795b5674 100644
--- a/backend/plugin/advisor/mysql/rule_column_no_null.go
+++ b/backend/plugin/advisor/mysql/rule_column_no_null.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnNoNull, &ColumnNoNullAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnNoNull, &ColumnNoNullAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnNoNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
}
// ColumnNoNullAdvisor is the advisor checking for column no NULL value.
diff --git a/backend/plugin/advisor/mysql/rule_column_require_charset.go b/backend/plugin/advisor/mysql/rule_column_require_charset.go
index 6a021078c0..fd2e423eec 100644
--- a/backend/plugin/advisor/mysql/rule_column_require_charset.go
+++ b/backend/plugin/advisor/mysql/rule_column_require_charset.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnRequireCharset, &ColumnRequireCharsetAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnRequireCharset, &ColumnRequireCharsetAdvisor{})
}
// ColumnRequireCharsetAdvisor is the advisor checking for require charset.
diff --git a/backend/plugin/advisor/mysql/rule_column_require_collation.go b/backend/plugin/advisor/mysql/rule_column_require_collation.go
index dcc4d5f150..1e5eba5363 100644
--- a/backend/plugin/advisor/mysql/rule_column_require_collation.go
+++ b/backend/plugin/advisor/mysql/rule_column_require_collation.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnRequireCollation, &ColumnRequireCollationAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnRequireCollation, &ColumnRequireCollationAdvisor{})
}
// ColumnRequireCollationAdvisor is the advisor checking for require collation.
diff --git a/backend/plugin/advisor/mysql/rule_column_require_default.go b/backend/plugin/advisor/mysql/rule_column_require_default.go
index d123505b6d..16cb71eb15 100644
--- a/backend/plugin/advisor/mysql/rule_column_require_default.go
+++ b/backend/plugin/advisor/mysql/rule_column_require_default.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLRequireColumnDefault, &ColumnRequireDefaultAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLRequireColumnDefault, &ColumnRequireDefaultAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLRequireColumnDefault, &ColumnRequireDefaultAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnRequireDefault, &ColumnRequireDefaultAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnRequireDefault, &ColumnRequireDefaultAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnRequireDefault, &ColumnRequireDefaultAdvisor{})
}
// ColumnRequireDefaultAdvisor is the advisor checking for column default requirement.
diff --git a/backend/plugin/advisor/mysql/rule_column_required.go b/backend/plugin/advisor/mysql/rule_column_required.go
index a731e86c2e..e3adbcaaa7 100644
--- a/backend/plugin/advisor/mysql/rule_column_required.go
+++ b/backend/plugin/advisor/mysql/rule_column_required.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnRequirement, &ColumnRequirementAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnRequirement, &ColumnRequirementAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnRequirement, &ColumnRequirementAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleRequiredColumn, &ColumnRequirementAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleRequiredColumn, &ColumnRequirementAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleRequiredColumn, &ColumnRequirementAdvisor{})
}
// ColumnRequirementAdvisor is the advisor checking for column requirement.
diff --git a/backend/plugin/advisor/mysql/rule_column_set_default_for_not_null.go b/backend/plugin/advisor/mysql/rule_column_set_default_for_not_null.go
index 24f3ba69b2..ba0d3408fd 100644
--- a/backend/plugin/advisor/mysql/rule_column_set_default_for_not_null.go
+++ b/backend/plugin/advisor/mysql/rule_column_set_default_for_not_null.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
}
// ColumnSetDefaultForNotNullAdvisor is the advisor checking for set default value for not null column.
diff --git a/backend/plugin/advisor/mysql/rule_column_type_disallow_list.go b/backend/plugin/advisor/mysql/rule_column_type_disallow_list.go
index bc01b41428..10a1a5efed 100644
--- a/backend/plugin/advisor/mysql/rule_column_type_disallow_list.go
+++ b/backend/plugin/advisor/mysql/rule_column_type_disallow_list.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
}
// ColumnTypeDisallowListAdvisor is the advisor checking for column type restriction.
diff --git a/backend/plugin/advisor/mysql/rule_database_drop_empty_db.go b/backend/plugin/advisor/mysql/rule_database_drop_empty_db.go
index a62948ead6..fb56e4a93d 100644
--- a/backend/plugin/advisor/mysql/rule_database_drop_empty_db.go
+++ b/backend/plugin/advisor/mysql/rule_database_drop_empty_db.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLDatabaseAllowDropIfEmpty, &DatabaseAllowDropIfEmptyAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLDatabaseAllowDropIfEmpty, &DatabaseAllowDropIfEmptyAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLDatabaseAllowDropIfEmpty, &DatabaseAllowDropIfEmptyAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleDropEmptyDatabase, &DatabaseAllowDropIfEmptyAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleDropEmptyDatabase, &DatabaseAllowDropIfEmptyAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleDropEmptyDatabase, &DatabaseAllowDropIfEmptyAdvisor{})
}
// DatabaseAllowDropIfEmptyAdvisor is the advisor checking the MySQLDatabaseAllowDropIfEmpty rule.
diff --git a/backend/plugin/advisor/mysql/rule_disallow_procedure.go b/backend/plugin/advisor/mysql/rule_disallow_procedure.go
index d6d3e3ec61..e9e0e4192a 100644
--- a/backend/plugin/advisor/mysql/rule_disallow_procedure.go
+++ b/backend/plugin/advisor/mysql/rule_disallow_procedure.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLProcedureDisallowCreate, &ProcedureDisallowCreateAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleProcedureDisallowCreate, &ProcedureDisallowCreateAdvisor{})
}
// ProcedureDisallowCreateAdvisor is the advisor checking for disallow create procedure.
diff --git a/backend/plugin/advisor/mysql/rule_event_disallow_create.go b/backend/plugin/advisor/mysql/rule_event_disallow_create.go
index bc29eb1483..51f3ecf56a 100644
--- a/backend/plugin/advisor/mysql/rule_event_disallow_create.go
+++ b/backend/plugin/advisor/mysql/rule_event_disallow_create.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLEventDisallowCreate, &EventDisallowCreateAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleEventDisallowCreate, &EventDisallowCreateAdvisor{})
}
// EventDisallowCreateAdvisor is the advisor checking for disallow creating event.
diff --git a/backend/plugin/advisor/mysql/rule_function_disallow_create.go b/backend/plugin/advisor/mysql/rule_function_disallow_create.go
index 1ee146271f..b54b9021c9 100644
--- a/backend/plugin/advisor/mysql/rule_function_disallow_create.go
+++ b/backend/plugin/advisor/mysql/rule_function_disallow_create.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLFunctionDisallowCreate, &FunctionDisallowCreateAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleFunctionDisallowCreate, &FunctionDisallowCreateAdvisor{})
}
// FunctionDisallowCreateAdvisor is the advisor checking for disallow creating function.
diff --git a/backend/plugin/advisor/mysql/rule_function_disallowed_list.go b/backend/plugin/advisor/mysql/rule_function_disallowed_list.go
index 91cbc4b25f..760503d75b 100644
--- a/backend/plugin/advisor/mysql/rule_function_disallowed_list.go
+++ b/backend/plugin/advisor/mysql/rule_function_disallowed_list.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLFunctionDisallowedList, &FunctionDisallowedListAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleFunctionDisallowList, &FunctionDisallowedListAdvisor{})
}
// FunctionDisallowedListAdvisor is the advisor checking for disallowed function list.
diff --git a/backend/plugin/advisor/mysql/rule_index_key_number_limit.go b/backend/plugin/advisor/mysql/rule_index_key_number_limit.go
index b03a4238eb..04d23d2768 100644
--- a/backend/plugin/advisor/mysql/rule_index_key_number_limit.go
+++ b/backend/plugin/advisor/mysql/rule_index_key_number_limit.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
}
// IndexKeyNumberLimitAdvisor is the advisor checking for index key number limit.
diff --git a/backend/plugin/advisor/mysql/rule_index_no_duplicate_column.go b/backend/plugin/advisor/mysql/rule_index_no_duplicate_column.go
index 2b37ba25ea..eaf8279cd6 100644
--- a/backend/plugin/advisor/mysql/rule_index_no_duplicate_column.go
+++ b/backend/plugin/advisor/mysql/rule_index_no_duplicate_column.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
}
// IndexNoDuplicateColumnAdvisor is the advisor checking for no duplicate columns in index.
diff --git a/backend/plugin/advisor/mysql/rule_index_pk_type.go b/backend/plugin/advisor/mysql/rule_index_pk_type.go
index 182e91efc2..136ec56485 100644
--- a/backend/plugin/advisor/mysql/rule_index_pk_type.go
+++ b/backend/plugin/advisor/mysql/rule_index_pk_type.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLIndexPKType, &IndexPkTypeAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLIndexPKType, &IndexPkTypeAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLIndexPKType, &IndexPkTypeAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIndexPKTypeLimit, &IndexPkTypeAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleIndexPKTypeLimit, &IndexPkTypeAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleIndexPKTypeLimit, &IndexPkTypeAdvisor{})
}
// IndexPkTypeAdvisor is the advisor checking for correct type of PK.
diff --git a/backend/plugin/advisor/mysql/rule_index_primary_key_type_allowlist.go b/backend/plugin/advisor/mysql/rule_index_primary_key_type_allowlist.go
index 21eb232ad2..7cbb5dadcc 100644
--- a/backend/plugin/advisor/mysql/rule_index_primary_key_type_allowlist.go
+++ b/backend/plugin/advisor/mysql/rule_index_primary_key_type_allowlist.go
@@ -21,8 +21,8 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIndexPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleIndexPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
}
// IndexPrimaryKeyTypeAllowlistAdvisor is the advisor checking for primary key type allowlist.
diff --git a/backend/plugin/advisor/mysql/rule_index_total_number_limit.go b/backend/plugin/advisor/mysql/rule_index_total_number_limit.go
index d9473244f1..59bc035596 100644
--- a/backend/plugin/advisor/mysql/rule_index_total_number_limit.go
+++ b/backend/plugin/advisor/mysql/rule_index_total_number_limit.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
}
// IndexTotalNumberLimitAdvisor is the advisor checking for index total number limit.
diff --git a/backend/plugin/advisor/mysql/rule_index_type_allow_list.go b/backend/plugin/advisor/mysql/rule_index_type_allow_list.go
index 2bc8c26773..936bac3064 100644
--- a/backend/plugin/advisor/mysql/rule_index_type_allow_list.go
+++ b/backend/plugin/advisor/mysql/rule_index_type_allow_list.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLIndexTypeAllowList, &IndexTypeAllowListAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIndexTypeAllowList, &IndexTypeAllowListAdvisor{})
}
// IndexTypeAllowListAdvisor is the advisor checking for index types.
diff --git a/backend/plugin/advisor/mysql/rule_index_type_no_blob.go b/backend/plugin/advisor/mysql/rule_index_type_no_blob.go
index 3138debf6b..70bc75a2c3 100644
--- a/backend/plugin/advisor/mysql/rule_index_type_no_blob.go
+++ b/backend/plugin/advisor/mysql/rule_index_type_no_blob.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
}
// IndexTypeNoBlobAdvisor is the advisor checking for index type no blob.
diff --git a/backend/plugin/advisor/mysql/rule_insert_disallow_order_by_rand.go b/backend/plugin/advisor/mysql/rule_insert_disallow_order_by_rand.go
index d02c237fa9..fb62bac9a7 100644
--- a/backend/plugin/advisor/mysql/rule_insert_disallow_order_by_rand.go
+++ b/backend/plugin/advisor/mysql/rule_insert_disallow_order_by_rand.go
@@ -22,9 +22,9 @@ var (
const RandFn = "rand()"
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
}
// InsertDisallowOrderByRandAdvisor is the advisor checking for to disallow order by rand in INSERT statements.
diff --git a/backend/plugin/advisor/mysql/rule_insert_must_specify_column.go b/backend/plugin/advisor/mysql/rule_insert_must_specify_column.go
index e3876a1492..ddd884755e 100644
--- a/backend/plugin/advisor/mysql/rule_insert_must_specify_column.go
+++ b/backend/plugin/advisor/mysql/rule_insert_must_specify_column.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
}
// InsertMustSpecifyColumnAdvisor is the advisor checking for to enforce column specified.
diff --git a/backend/plugin/advisor/mysql/rule_insert_row_limit.go b/backend/plugin/advisor/mysql/rule_insert_row_limit.go
index 3d6b825882..7fd55221c3 100644
--- a/backend/plugin/advisor/mysql/rule_insert_row_limit.go
+++ b/backend/plugin/advisor/mysql/rule_insert_row_limit.go
@@ -21,8 +21,8 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLInsertRowLimit, &InsertRowLimitAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLInsertRowLimit, &InsertRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementInsertRowLimit, &InsertRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementInsertRowLimit, &InsertRowLimitAdvisor{})
}
// InsertRowLimitAdvisor is the advisor checking for insert row limit.
diff --git a/backend/plugin/advisor/mysql/rule_migration_compatibility.go b/backend/plugin/advisor/mysql/rule_migration_compatibility.go
index b6b6180dc5..23fb351159 100644
--- a/backend/plugin/advisor/mysql/rule_migration_compatibility.go
+++ b/backend/plugin/advisor/mysql/rule_migration_compatibility.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLMigrationCompatibility, &CompatibilityAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLMigrationCompatibility, &CompatibilityAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLMigrationCompatibility, &CompatibilityAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleSchemaBackwardCompatibility, &CompatibilityAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleSchemaBackwardCompatibility, &CompatibilityAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleSchemaBackwardCompatibility, &CompatibilityAdvisor{})
}
// CompatibilityAdvisor is the advisor checking for schema backward compatibility.
diff --git a/backend/plugin/advisor/mysql/rule_naming_auto_increment_column.go b/backend/plugin/advisor/mysql/rule_naming_auto_increment_column.go
index 972390b24b..a613bde206 100644
--- a/backend/plugin/advisor/mysql/rule_naming_auto_increment_column.go
+++ b/backend/plugin/advisor/mysql/rule_naming_auto_increment_column.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNamingAutoIncrementColumnConvention, &NamingAutoIncrementColumnAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNamingAutoIncrementColumnConvention, &NamingAutoIncrementColumnAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNamingAutoIncrementColumnConvention, &NamingAutoIncrementColumnAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleAutoIncrementColumnNaming, &NamingAutoIncrementColumnAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleAutoIncrementColumnNaming, &NamingAutoIncrementColumnAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleAutoIncrementColumnNaming, &NamingAutoIncrementColumnAdvisor{})
}
// NamingAutoIncrementColumnAdvisor is the advisor checking for auto-increment naming convention.
diff --git a/backend/plugin/advisor/mysql/rule_naming_column.go b/backend/plugin/advisor/mysql/rule_naming_column.go
index c4d8634ac9..2d55237069 100644
--- a/backend/plugin/advisor/mysql/rule_naming_column.go
+++ b/backend/plugin/advisor/mysql/rule_naming_column.go
@@ -18,9 +18,9 @@ import (
var _ advisor.Advisor = (*NamingColumnConventionAdvisor)(nil)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNamingColumnConvention, &NamingColumnConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNamingColumnConvention, &NamingColumnConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNamingColumnConvention, &NamingColumnConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleColumnNaming, &NamingColumnConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleColumnNaming, &NamingColumnConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleColumnNaming, &NamingColumnConventionAdvisor{})
}
// NamingColumnConventionAdvisor is the advisor checking for column naming convention.
diff --git a/backend/plugin/advisor/mysql/rule_naming_foreign_key_convention.go b/backend/plugin/advisor/mysql/rule_naming_foreign_key_convention.go
index 3d76498ad3..b03e387cf6 100644
--- a/backend/plugin/advisor/mysql/rule_naming_foreign_key_convention.go
+++ b/backend/plugin/advisor/mysql/rule_naming_foreign_key_convention.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNamingFKConvention, &NamingFKConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNamingFKConvention, &NamingFKConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNamingFKConvention, &NamingFKConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleFKNaming, &NamingFKConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleFKNaming, &NamingFKConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleFKNaming, &NamingFKConventionAdvisor{})
}
// NamingFKConventionAdvisor is the advisor checking for foreign key naming convention.
diff --git a/backend/plugin/advisor/mysql/rule_naming_identifier_no_keyword.go b/backend/plugin/advisor/mysql/rule_naming_identifier_no_keyword.go
index 11577e5a03..cdef595e57 100644
--- a/backend/plugin/advisor/mysql/rule_naming_identifier_no_keyword.go
+++ b/backend/plugin/advisor/mysql/rule_naming_identifier_no_keyword.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLIdentifierNamingNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIdentifierNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
}
// NamingIdentifierNoKeywordAdvisor is the advisor checking for identifier naming convention without keyword.
diff --git a/backend/plugin/advisor/mysql/rule_naming_index_convention.go b/backend/plugin/advisor/mysql/rule_naming_index_convention.go
index efba9ee2af..32a10b837a 100644
--- a/backend/plugin/advisor/mysql/rule_naming_index_convention.go
+++ b/backend/plugin/advisor/mysql/rule_naming_index_convention.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNamingIndexConvention, &NamingIndexConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNamingIndexConvention, &NamingIndexConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNamingIndexConvention, &NamingIndexConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleIDXNaming, &NamingIndexConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleIDXNaming, &NamingIndexConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleIDXNaming, &NamingIndexConventionAdvisor{})
}
// indexMetaData is the metadata for index.
diff --git a/backend/plugin/advisor/mysql/rule_naming_table.go b/backend/plugin/advisor/mysql/rule_naming_table.go
index 5294982f14..9e22ac9ca5 100644
--- a/backend/plugin/advisor/mysql/rule_naming_table.go
+++ b/backend/plugin/advisor/mysql/rule_naming_table.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNamingTableConvention, &NamingTableConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNamingTableConvention, &NamingTableConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNamingTableConvention, &NamingTableConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableNaming, &NamingTableConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleTableNaming, &NamingTableConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleTableNaming, &NamingTableConventionAdvisor{})
}
// NamingTableConventionAdvisor is the advisor checking for table naming convention.
diff --git a/backend/plugin/advisor/mysql/rule_naming_unique_key_convention.go b/backend/plugin/advisor/mysql/rule_naming_unique_key_convention.go
index 572aa22d14..a430540070 100644
--- a/backend/plugin/advisor/mysql/rule_naming_unique_key_convention.go
+++ b/backend/plugin/advisor/mysql/rule_naming_unique_key_convention.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNamingUKConvention, &NamingUKConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNamingUKConvention, &NamingUKConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNamingUKConvention, &NamingUKConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleUKNaming, &NamingUKConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleUKNaming, &NamingUKConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleUKNaming, &NamingUKConventionAdvisor{})
}
// NamingUKConventionAdvisor is the advisor checking for unique key naming convention.
diff --git a/backend/plugin/advisor/mysql/rule_online_migration.go b/backend/plugin/advisor/mysql/rule_online_migration.go
index 64166c0612..ba9d00ab0e 100644
--- a/backend/plugin/advisor/mysql/rule_online_migration.go
+++ b/backend/plugin/advisor/mysql/rule_online_migration.go
@@ -24,8 +24,8 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLOnlineMigration, &OnlineMigrationAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLOnlineMigration, &OnlineMigrationAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleOnlineMigration, &OnlineMigrationAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleOnlineMigration, &OnlineMigrationAdvisor{})
}
// OnlineMigrationAdvisor is the advisor checking for using gh-ost to migrate large tables.
diff --git a/backend/plugin/advisor/mysql/rule_statement_add_column_without_position.go b/backend/plugin/advisor/mysql/rule_statement_add_column_without_position.go
index a00117b82c..4a7bf8fe41 100644
--- a/backend/plugin/advisor/mysql/rule_statement_add_column_without_position.go
+++ b/backend/plugin/advisor/mysql/rule_statement_add_column_without_position.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLStatementAddColumnWithoutPosition, &StatementAddColumnWithoutPositionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementAddColumnWithoutPosition, &StatementAddColumnWithoutPositionAdvisor{})
}
// StatementAddColumnWithoutPositionAdvisor is the advisor checking for checking no position in ADD COLUMN clause.
diff --git a/backend/plugin/advisor/mysql/rule_statement_affected_row_limit.go b/backend/plugin/advisor/mysql/rule_statement_affected_row_limit.go
index abcb3b0990..781d6a6c3c 100644
--- a/backend/plugin/advisor/mysql/rule_statement_affected_row_limit.go
+++ b/backend/plugin/advisor/mysql/rule_statement_affected_row_limit.go
@@ -21,8 +21,8 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
}
// StatementAffectedRowLimitAdvisor is the advisor checking for UPDATE/DELETE affected row limit.
diff --git a/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_ddl.go b/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_ddl.go
index 9a93bb89e6..c4eb5166b2 100644
--- a/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_ddl.go
+++ b/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_ddl.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
}
type StatementDisallowMixInDDLAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_dml.go b/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_dml.go
index 23c4d56c05..d885c4d542 100644
--- a/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_dml.go
+++ b/backend/plugin/advisor/mysql/rule_statement_disallow_mix_in_dml.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
}
type StatementDisallowMixInDMLAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_disallow_using_filesort.go b/backend/plugin/advisor/mysql/rule_statement_disallow_using_filesort.go
index 4f3b585650..ab618d3934 100644
--- a/backend/plugin/advisor/mysql/rule_statement_disallow_using_filesort.go
+++ b/backend/plugin/advisor/mysql/rule_statement_disallow_using_filesort.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDisallowUsingFilesort, &StatementDisallowUsingFilesortAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDisallowUsingFilesort, &StatementDisallowUsingFilesortAdvisor{})
}
// StatementDisallowUsingFilesortAdvisor is the advisor checking for using filesort.
diff --git a/backend/plugin/advisor/mysql/rule_statement_disallow_using_temporary.go b/backend/plugin/advisor/mysql/rule_statement_disallow_using_temporary.go
index b9e45e75a1..db1ea6f333 100644
--- a/backend/plugin/advisor/mysql/rule_statement_disallow_using_temporary.go
+++ b/backend/plugin/advisor/mysql/rule_statement_disallow_using_temporary.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDisallowUsingTemporary, &StatementDisallowUsingTemporaryAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDisallowUsingTemporary, &StatementDisallowUsingTemporaryAdvisor{})
}
// StatementDisallowUsingTemporaryAdvisor is the advisor checking for using temporary.
diff --git a/backend/plugin/advisor/mysql/rule_statement_dml_dry_run.go b/backend/plugin/advisor/mysql/rule_statement_dml_dry_run.go
index 4f95c8e7bf..7c8d31077f 100644
--- a/backend/plugin/advisor/mysql/rule_statement_dml_dry_run.go
+++ b/backend/plugin/advisor/mysql/rule_statement_dml_dry_run.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
}
// StatementDmlDryRunAdvisor is the advisor checking for DML dry run.
diff --git a/backend/plugin/advisor/mysql/rule_statement_join_strict_column_attrs.go b/backend/plugin/advisor/mysql/rule_statement_join_strict_column_attrs.go
index f42c11387f..bbfa53793e 100644
--- a/backend/plugin/advisor/mysql/rule_statement_join_strict_column_attrs.go
+++ b/backend/plugin/advisor/mysql/rule_statement_join_strict_column_attrs.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementJoinStrictColumnAttrs, &StatementJoinStrictColumnAttrsAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementJoinStrictColumnAttrs, &StatementJoinStrictColumnAttrsAdvisor{})
}
type StatementJoinStrictColumnAttrsAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_maximum_join_table_count.go b/backend/plugin/advisor/mysql/rule_statement_maximum_join_table_count.go
index 6bce398018..8e745c6f9a 100644
--- a/backend/plugin/advisor/mysql/rule_statement_maximum_join_table_count.go
+++ b/backend/plugin/advisor/mysql/rule_statement_maximum_join_table_count.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementMaximumJoinTableCount, &StatementMaximumJoinTableCountAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementMaximumJoinTableCount, &StatementMaximumJoinTableCountAdvisor{})
}
type StatementMaximumJoinTableCountAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_maximum_limit_value.go b/backend/plugin/advisor/mysql/rule_statement_maximum_limit_value.go
index 840e5ffb80..e216b3fae0 100644
--- a/backend/plugin/advisor/mysql/rule_statement_maximum_limit_value.go
+++ b/backend/plugin/advisor/mysql/rule_statement_maximum_limit_value.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
}
type StatementMaximumLimitValueAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_maximum_statements_in_transaction.go b/backend/plugin/advisor/mysql/rule_statement_maximum_statements_in_transaction.go
index 31296beb31..68fb0a87f4 100644
--- a/backend/plugin/advisor/mysql/rule_statement_maximum_statements_in_transaction.go
+++ b/backend/plugin/advisor/mysql/rule_statement_maximum_statements_in_transaction.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementMaximumStatementsInTransaction, &StatementMaximumStatementsInTransactionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementMaximumStatementsInTransaction, &StatementMaximumStatementsInTransactionAdvisor{})
}
type StatementMaximumStatementsInTransactionAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_merge_alter_table.go b/backend/plugin/advisor/mysql/rule_statement_merge_alter_table.go
index 2f96889549..1362f26406 100644
--- a/backend/plugin/advisor/mysql/rule_statement_merge_alter_table.go
+++ b/backend/plugin/advisor/mysql/rule_statement_merge_alter_table.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLMergeAlterTable, &StatementMergeAlterTableAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLMergeAlterTable, &StatementMergeAlterTableAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLMergeAlterTable, &StatementMergeAlterTableAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementMergeAlterTable, &StatementMergeAlterTableAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementMergeAlterTable, &StatementMergeAlterTableAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementMergeAlterTable, &StatementMergeAlterTableAdvisor{})
}
// StatementMergeAlterTableAdvisor is the advisor checking for merging ALTER TABLE statements.
diff --git a/backend/plugin/advisor/mysql/rule_statement_query_minimum_plan_level.go b/backend/plugin/advisor/mysql/rule_statement_query_minimum_plan_level.go
index d9d94ac858..e29a02612a 100644
--- a/backend/plugin/advisor/mysql/rule_statement_query_minimum_plan_level.go
+++ b/backend/plugin/advisor/mysql/rule_statement_query_minimum_plan_level.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementQueryMinumumPlanLevel, &StatementQueryMinumumPlanLevelAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementQueryMinumumPlanLevel, &StatementQueryMinumumPlanLevelAdvisor{})
}
type StatementQueryMinumumPlanLevelAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_select_full_table_scan.go b/backend/plugin/advisor/mysql/rule_statement_select_full_table_scan.go
index e527aba7e0..51e09ca80b 100644
--- a/backend/plugin/advisor/mysql/rule_statement_select_full_table_scan.go
+++ b/backend/plugin/advisor/mysql/rule_statement_select_full_table_scan.go
@@ -22,9 +22,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementSelectFullTableScan, &StatementSelectFullTableScanAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementSelectFullTableScan, &StatementSelectFullTableScanAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLStatementSelectFullTableScan, &StatementSelectFullTableScanAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementSelectFullTableScan, &StatementSelectFullTableScanAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementSelectFullTableScan, &StatementSelectFullTableScanAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementSelectFullTableScan, &StatementSelectFullTableScanAdvisor{})
}
type StatementSelectFullTableScanAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_where_disallow_using_function.go b/backend/plugin/advisor/mysql/rule_statement_where_disallow_using_function.go
index 0585d6deef..f9bf30aeae 100644
--- a/backend/plugin/advisor/mysql/rule_statement_where_disallow_using_function.go
+++ b/backend/plugin/advisor/mysql/rule_statement_where_disallow_using_function.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementWhereDisallowUsingFunction, &StatementWhereDisallowUsingFunctionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementWhereDisallowFunctionsAndCalculations, &StatementWhereDisallowUsingFunctionAdvisor{})
}
type StatementWhereDisallowUsingFunctionAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_where_maximum_logical_operator_count.go b/backend/plugin/advisor/mysql/rule_statement_where_maximum_logical_operator_count.go
index 334ebe24be..c798c51664 100644
--- a/backend/plugin/advisor/mysql/rule_statement_where_maximum_logical_operator_count.go
+++ b/backend/plugin/advisor/mysql/rule_statement_where_maximum_logical_operator_count.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementWhereMaximumLogicalOperatorCount, &StatementWhereMaximumLogicalOperatorCountAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementWhereMaximumLogicalOperatorCount, &StatementWhereMaximumLogicalOperatorCountAdvisor{})
}
type StatementWhereMaximumLogicalOperatorCountAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_statement_where_no_equal_null.go b/backend/plugin/advisor/mysql/rule_statement_where_no_equal_null.go
index 51b9c9246f..0cd7c7392b 100644
--- a/backend/plugin/advisor/mysql/rule_statement_where_no_equal_null.go
+++ b/backend/plugin/advisor/mysql/rule_statement_where_no_equal_null.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementWhereNoEqualNull, &StatementWhereNoEqualNullAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementWhereNoEqualNull, &StatementWhereNoEqualNullAdvisor{})
}
type StatementWhereNoEqualNullAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_stmt_disallow_commit.go b/backend/plugin/advisor/mysql/rule_stmt_disallow_commit.go
index 12f2439b75..23c5e44d98 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_disallow_commit.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_disallow_commit.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
}
// StatementDisallowCommitAdvisor is the advisor checking for disallowing commit.
diff --git a/backend/plugin/advisor/mysql/rule_stmt_disallow_limit.go b/backend/plugin/advisor/mysql/rule_stmt_disallow_limit.go
index d084e4db11..df3ac58dc2 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_disallow_limit.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_disallow_limit.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
}
// StatementDisallowLimitAdvisor is the advisor checking for no LIMIT clause in INSERT/UPDATE statement.
diff --git a/backend/plugin/advisor/mysql/rule_stmt_disallow_order_by.go b/backend/plugin/advisor/mysql/rule_stmt_disallow_order_by.go
index 5bfd760671..bf2330f2b4 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_disallow_order_by.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_disallow_order_by.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLDisallowOrderBy, &DisallowOrderByAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLDisallowOrderBy, &DisallowOrderByAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLDisallowOrderBy, &DisallowOrderByAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementDisallowOrderBy, &DisallowOrderByAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementDisallowOrderBy, &DisallowOrderByAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementDisallowOrderBy, &DisallowOrderByAdvisor{})
}
// DisallowOrderByAdvisor is the advisor checking for no ORDER BY clause in DELETE/UPDATE statements.
diff --git a/backend/plugin/advisor/mysql/rule_stmt_max_execution_time.go b/backend/plugin/advisor/mysql/rule_stmt_max_execution_time.go
index 1aff37ca93..2896ddaf8b 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_max_execution_time.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_max_execution_time.go
@@ -20,8 +20,8 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementMaxExecutionTime, &MaxExecutionTimeAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementMaxExecutionTime, &MaxExecutionTimeAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementMaxExecutionTime, &MaxExecutionTimeAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementMaxExecutionTime, &MaxExecutionTimeAdvisor{})
}
// MaxExecutionTimeAdvisor is the advisor checking for the max execution time.
diff --git a/backend/plugin/advisor/mysql/rule_stmt_no_leading_wildcard_like.go b/backend/plugin/advisor/mysql/rule_stmt_no_leading_wildcard_like.go
index d39fcb3ef4..d32c913786 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_no_leading_wildcard_like.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_no_leading_wildcard_like.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
}
// NoLeadingWildcardLikeAdvisor is the advisor checking for no leading wildcard LIKE.
diff --git a/backend/plugin/advisor/mysql/rule_stmt_no_select_all.go b/backend/plugin/advisor/mysql/rule_stmt_no_select_all.go
index d3592eb414..f657c7c4d2 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_no_select_all.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_no_select_all.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLNoSelectAll, &NoSelectAllAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLNoSelectAll, &NoSelectAllAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLNoSelectAll, &NoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementNoSelectAll, &NoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementNoSelectAll, &NoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementNoSelectAll, &NoSelectAllAdvisor{})
}
// NoSelectAllAdvisor is the advisor checking for no "select *".
diff --git a/backend/plugin/advisor/mysql/rule_stmt_require_algorithm_or_lock_options.go b/backend/plugin/advisor/mysql/rule_stmt_require_algorithm_or_lock_options.go
index d0ca30eb65..8367863ccc 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_require_algorithm_or_lock_options.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_require_algorithm_or_lock_options.go
@@ -18,11 +18,11 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementRequireAlgorithmOption, &RequireAlgorithmOrLockOptionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementRequireAlgorithmOption, &RequireAlgorithmOrLockOptionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementRequireAlgorithmOption, &RequireAlgorithmOrLockOptionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementRequireAlgorithmOption, &RequireAlgorithmOrLockOptionAdvisor{})
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementRequireLockOption, &RequireAlgorithmOrLockOptionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLStatementRequireLockOption, &RequireAlgorithmOrLockOptionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementRequireLockOption, &RequireAlgorithmOrLockOptionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementRequireLockOption, &RequireAlgorithmOrLockOptionAdvisor{})
}
// RequireAlgorithmOrLockOptionAdvisor is the advisor checking for the max execution time.
diff --git a/backend/plugin/advisor/mysql/rule_stmt_where_required.go b/backend/plugin/advisor/mysql/rule_stmt_where_required.go
deleted file mode 100644
index 8a4000b11b..0000000000
--- a/backend/plugin/advisor/mysql/rule_stmt_where_required.go
+++ /dev/null
@@ -1,140 +0,0 @@
-package mysql
-
-import (
- "context"
- "fmt"
-
- "github.com/antlr4-go/antlr/v4"
- mysql "github.com/bytebase/mysql-parser"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- storepb "github.com/bytebase/bytebase/backend/generated-go/store"
- "github.com/bytebase/bytebase/backend/plugin/advisor"
- mysqlparser "github.com/bytebase/bytebase/backend/plugin/parser/mysql"
-)
-
-var (
- _ advisor.Advisor = (*WhereRequirementAdvisor)(nil)
-)
-
-func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLWhereRequirement, &WhereRequirementAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLWhereRequirement, &WhereRequirementAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLWhereRequirement, &WhereRequirementAdvisor{})
-}
-
-// WhereRequirementAdvisor is the advisor checking for the WHERE clause requirement.
-type WhereRequirementAdvisor struct {
-}
-
-// Check checks for the WHERE clause requirement.
-func (*WhereRequirementAdvisor) Check(_ context.Context, checkCtx advisor.Context) ([]*storepb.Advice, error) {
- root, ok := checkCtx.AST.([]*mysqlparser.ParseResult)
- if !ok {
- return nil, errors.Errorf("failed to convert to StmtNode")
- }
-
- level, err := advisor.NewStatusBySQLReviewRuleLevel(checkCtx.Rule.Level)
- if err != nil {
- return nil, err
- }
-
- // Create the rule
- rule := NewWhereRequirementRule(level, string(checkCtx.Rule.Type))
-
- // Create the generic checker with the rule
- checker := NewGenericChecker([]Rule{rule})
-
- for _, stmtNode := range root {
- rule.SetBaseLine(stmtNode.BaseLine)
- checker.SetBaseLine(stmtNode.BaseLine)
- antlr.ParseTreeWalkerDefault.Walk(checker, stmtNode.Tree)
- }
-
- return checker.GetAdviceList(), nil
-}
-
-// WhereRequirementRule checks for the WHERE clause requirement.
-type WhereRequirementRule struct {
- BaseRule
- text string
-}
-
-// NewWhereRequirementRule creates a new WhereRequirementRule.
-func NewWhereRequirementRule(level storepb.Advice_Status, title string) *WhereRequirementRule {
- return &WhereRequirementRule{
- BaseRule: BaseRule{
- level: level,
- title: title,
- },
- }
-}
-
-// Name returns the rule name.
-func (*WhereRequirementRule) Name() string {
- return "WhereRequirementRule"
-}
-
-// OnEnter is called when entering a parse tree node.
-func (r *WhereRequirementRule) OnEnter(ctx antlr.ParserRuleContext, nodeType string) error {
- switch nodeType {
- case NodeTypeQuery:
- queryCtx, ok := ctx.(*mysql.QueryContext)
- if !ok {
- return nil
- }
- r.text = queryCtx.GetParser().GetTokenStream().GetTextFromRuleContext(queryCtx)
- case NodeTypeDeleteStatement:
- r.checkDeleteStatement(ctx.(*mysql.DeleteStatementContext))
- case NodeTypeUpdateStatement:
- r.checkUpdateStatement(ctx.(*mysql.UpdateStatementContext))
- case NodeTypeQuerySpecification:
- r.checkQuerySpecification(ctx.(*mysql.QuerySpecificationContext))
- default:
- }
- return nil
-}
-
-// OnExit is called when exiting a parse tree node.
-func (*WhereRequirementRule) OnExit(_ antlr.ParserRuleContext, _ string) error {
- return nil
-}
-
-func (r *WhereRequirementRule) checkDeleteStatement(ctx *mysql.DeleteStatementContext) {
- if !mysqlparser.IsTopMySQLRule(&ctx.BaseParserRuleContext) {
- return
- }
- if ctx.WhereClause() == nil || ctx.WhereClause().WHERE_SYMBOL() == nil {
- r.handleWhereClause(ctx.GetStart().GetLine())
- }
-}
-
-func (r *WhereRequirementRule) checkUpdateStatement(ctx *mysql.UpdateStatementContext) {
- if !mysqlparser.IsTopMySQLRule(&ctx.BaseParserRuleContext) {
- return
- }
- if ctx.WhereClause() == nil || ctx.WhereClause().WHERE_SYMBOL() == nil {
- r.handleWhereClause(ctx.GetStart().GetLine())
- }
-}
-
-func (r *WhereRequirementRule) checkQuerySpecification(ctx *mysql.QuerySpecificationContext) {
- // Allow SELECT queries without a FROM clause to proceed, e.g. SELECT 1.
- if ctx.FromClause() == nil {
- return
- }
- if ctx.WhereClause() == nil || ctx.WhereClause().WHERE_SYMBOL() == nil {
- r.handleWhereClause(ctx.GetStart().GetLine())
- }
-}
-
-func (r *WhereRequirementRule) handleWhereClause(lineNumber int) {
- r.AddAdvice(&storepb.Advice{
- Status: r.level,
- Code: advisor.StatementNoWhere.Int32(),
- Title: r.title,
- Content: fmt.Sprintf("\"%s\" requires WHERE clause", r.text),
- StartPosition: common.ConvertANTLRLineToPosition(r.baseLine + lineNumber),
- })
-}
diff --git a/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_select.go b/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_select.go
index c1b8561ba8..47b3fd438c 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_select.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_select.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLWhereRequirementForSelect, &WhereRequirementForSelectAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLWhereRequirementForSelect, &WhereRequirementForSelectAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLWhereRequirementForSelect, &WhereRequirementForSelectAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequirementForSelectAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequirementForSelectAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequirementForSelectAdvisor{})
}
// WhereRequirementForSelectAdvisor is the advisor checking for the WHERE clause requirement for SELECT statements.
diff --git a/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_update_delete.go b/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_update_delete.go
index 0b53d34fc8..94586bd54a 100644
--- a/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_update_delete.go
+++ b/backend/plugin/advisor/mysql/rule_stmt_where_requirement_for_update_delete.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLWhereRequirementForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLWhereRequirementForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLWhereRequirementForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
}
// WhereRequirementForUpdateDeleteAdvisor is the advisor checking for the WHERE clause requirement for SELECT statements.
diff --git a/backend/plugin/advisor/mysql/rule_table_comment_convention.go b/backend/plugin/advisor/mysql/rule_table_comment_convention.go
index 4b478293f5..1ecd951500 100644
--- a/backend/plugin/advisor/mysql/rule_table_comment_convention.go
+++ b/backend/plugin/advisor/mysql/rule_table_comment_convention.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableCommentConvention, &TableCommentConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLTableCommentConvention, &TableCommentConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLTableCommentConvention, &TableCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableCommentConvention, &TableCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleTableCommentConvention, &TableCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleTableCommentConvention, &TableCommentConventionAdvisor{})
}
// TableCommentConventionAdvisor is the advisor checking for table comment convention.
diff --git a/backend/plugin/advisor/mysql/rule_table_disallow_ddl.go b/backend/plugin/advisor/mysql/rule_table_disallow_ddl.go
index f507019c4d..61f4ebde51 100644
--- a/backend/plugin/advisor/mysql/rule_table_disallow_ddl.go
+++ b/backend/plugin/advisor/mysql/rule_table_disallow_ddl.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableDisallowDDL, &TableDisallowDDLAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableDisallowDDL, &TableDisallowDDLAdvisor{})
}
// TableDisallowDDLAdvisor is the advisor checking for disallow DDL on specific tables.
diff --git a/backend/plugin/advisor/mysql/rule_table_disallow_dml.go b/backend/plugin/advisor/mysql/rule_table_disallow_dml.go
index 699d540631..b930e7ab77 100644
--- a/backend/plugin/advisor/mysql/rule_table_disallow_dml.go
+++ b/backend/plugin/advisor/mysql/rule_table_disallow_dml.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableDisallowDML, &TableDisallowDMLAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableDisallowDML, &TableDisallowDMLAdvisor{})
}
// TableDisallowDMLAdvisor is the advisor checking for disallow DML on specific tables.
diff --git a/backend/plugin/advisor/mysql/rule_table_disallow_partition.go b/backend/plugin/advisor/mysql/rule_table_disallow_partition.go
index fc3258b18b..44323252a3 100644
--- a/backend/plugin/advisor/mysql/rule_table_disallow_partition.go
+++ b/backend/plugin/advisor/mysql/rule_table_disallow_partition.go
@@ -19,9 +19,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableDisallowPartition, &TableDisallowPartitionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLTableDisallowPartition, &TableDisallowPartitionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLTableDisallowPartition, &TableDisallowPartitionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableDisallowPartition, &TableDisallowPartitionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleTableDisallowPartition, &TableDisallowPartitionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleTableDisallowPartition, &TableDisallowPartitionAdvisor{})
}
// TableDisallowPartitionAdvisor is the advisor checking for disallow table partition.
diff --git a/backend/plugin/advisor/mysql/rule_table_disallow_set_charset.go b/backend/plugin/advisor/mysql/rule_table_disallow_set_charset.go
index 8f0501cba4..1df51fe662 100644
--- a/backend/plugin/advisor/mysql/rule_table_disallow_set_charset.go
+++ b/backend/plugin/advisor/mysql/rule_table_disallow_set_charset.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableDisallowSetCharset, &TableDisallowSetCharsetAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableDisallowSetCharset, &TableDisallowSetCharsetAdvisor{})
}
type TableDisallowSetCharsetAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_table_disallow_trigger.go b/backend/plugin/advisor/mysql/rule_table_disallow_trigger.go
index 8177357972..eae80d96b9 100644
--- a/backend/plugin/advisor/mysql/rule_table_disallow_trigger.go
+++ b/backend/plugin/advisor/mysql/rule_table_disallow_trigger.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableDisallowTrigger, &TableDisallowTriggerAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableDisallowTrigger, &TableDisallowTriggerAdvisor{})
}
// TableDisallowTriggerAdvisor is the advisor checking for disallow table trigger.
diff --git a/backend/plugin/advisor/mysql/rule_table_drop_naming_convention.go b/backend/plugin/advisor/mysql/rule_table_drop_naming_convention.go
index 881bcfc9ff..59f3037b5c 100644
--- a/backend/plugin/advisor/mysql/rule_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/mysql/rule_table_drop_naming_convention.go
@@ -20,9 +20,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
}
// TableDropNamingConventionAdvisor is the advisor checking the MySQLTableDropNamingConvention rule.
diff --git a/backend/plugin/advisor/mysql/rule_table_limit_size.go b/backend/plugin/advisor/mysql/rule_table_limit_size.go
index a07244d76e..c92beafb89 100644
--- a/backend/plugin/advisor/mysql/rule_table_limit_size.go
+++ b/backend/plugin/advisor/mysql/rule_table_limit_size.go
@@ -17,7 +17,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableLimitSize, &MaximumTableSizeAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableLimitSize, &MaximumTableSizeAdvisor{})
}
type MaximumTableSizeAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_table_no_duplicate_index.go b/backend/plugin/advisor/mysql/rule_table_no_duplicate_index.go
index fc9df3fec3..3ff4701852 100644
--- a/backend/plugin/advisor/mysql/rule_table_no_duplicate_index.go
+++ b/backend/plugin/advisor/mysql/rule_table_no_duplicate_index.go
@@ -23,7 +23,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableNoDuplicateIndex, &TableNoDuplicateIndexAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableNoDuplicateIndex, &TableNoDuplicateIndexAdvisor{})
}
// TableNoDuplicateIndexAdvisor is the advisor checking for no duplicate index in table.
diff --git a/backend/plugin/advisor/mysql/rule_table_no_fk.go b/backend/plugin/advisor/mysql/rule_table_no_fk.go
index 24fb1267a1..fdadc3de01 100644
--- a/backend/plugin/advisor/mysql/rule_table_no_fk.go
+++ b/backend/plugin/advisor/mysql/rule_table_no_fk.go
@@ -21,9 +21,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableNoFK, &TableNoFKAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLTableNoFK, &TableNoFKAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLTableNoFK, &TableNoFKAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableNoFK, &TableNoFKAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleTableNoFK, &TableNoFKAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleTableNoFK, &TableNoFKAdvisor{})
}
// TableNoFKAdvisor is the advisor checking table disallow foreign key.
diff --git a/backend/plugin/advisor/mysql/rule_table_require_charset.go b/backend/plugin/advisor/mysql/rule_table_require_charset.go
index acd633f6ac..f513d08e67 100644
--- a/backend/plugin/advisor/mysql/rule_table_require_charset.go
+++ b/backend/plugin/advisor/mysql/rule_table_require_charset.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableRequireCharset, &TableRequireCharsetAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableRequireCharset, &TableRequireCharsetAdvisor{})
}
// TableRequireCharsetAdvisor is the advisor checking for require charset.
diff --git a/backend/plugin/advisor/mysql/rule_table_require_collation.go b/backend/plugin/advisor/mysql/rule_table_require_collation.go
index 90967baa60..45b3ede0a3 100644
--- a/backend/plugin/advisor/mysql/rule_table_require_collation.go
+++ b/backend/plugin/advisor/mysql/rule_table_require_collation.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableRequireCollation, &TableRequireCollationAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableRequireCollation, &TableRequireCollationAdvisor{})
}
// TableRequireCollationAdvisor is the advisor checking for require collation.
diff --git a/backend/plugin/advisor/mysql/rule_table_require_pk.go b/backend/plugin/advisor/mysql/rule_table_require_pk.go
index 601a7b9a9d..c94062b9ab 100644
--- a/backend/plugin/advisor/mysql/rule_table_require_pk.go
+++ b/backend/plugin/advisor/mysql/rule_table_require_pk.go
@@ -26,9 +26,9 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableRequirePK, &TableRequirePKAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLTableRequirePK, &TableRequirePKAdvisor{})
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLTableRequirePK, &TableRequirePKAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableRequirePK, &TableRequirePKAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleTableRequirePK, &TableRequirePKAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleTableRequirePK, &TableRequirePKAdvisor{})
}
// TableRequirePKAdvisor is the advisor checking table requires PK.
diff --git a/backend/plugin/advisor/mysql/rule_table_text_fields_total_length.go b/backend/plugin/advisor/mysql/rule_table_text_fields_total_length.go
index b0f2cea176..b70c7eb0c8 100644
--- a/backend/plugin/advisor/mysql/rule_table_text_fields_total_length.go
+++ b/backend/plugin/advisor/mysql/rule_table_text_fields_total_length.go
@@ -24,7 +24,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLTableTextFieldsTotalLength, &TableMaximumVarcharLengthAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleTableTextFieldsTotalLength, &TableMaximumVarcharLengthAdvisor{})
}
type TableMaximumVarcharLengthAdvisor struct {
diff --git a/backend/plugin/advisor/mysql/rule_use_innodb.go b/backend/plugin/advisor/mysql/rule_use_innodb.go
index 5cf304405a..0844c8ddef 100644
--- a/backend/plugin/advisor/mysql/rule_use_innodb.go
+++ b/backend/plugin/advisor/mysql/rule_use_innodb.go
@@ -24,8 +24,8 @@ const (
var _ advisor.Advisor = (*UseInnoDBAdvisor)(nil)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLUseInnoDB, &UseInnoDBAdvisor{})
- advisor.Register(storepb.Engine_MARIADB, advisor.MySQLUseInnoDB, &UseInnoDBAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleMySQLEngine, &UseInnoDBAdvisor{})
+ advisor.Register(storepb.Engine_MARIADB, advisor.SchemaRuleMySQLEngine, &UseInnoDBAdvisor{})
}
// UseInnoDBAdvisor is the advisor checking for using InnoDB engine.
diff --git a/backend/plugin/advisor/mysql/rule_view_disallow_create.go b/backend/plugin/advisor/mysql/rule_view_disallow_create.go
index 67183bb7df..796d1801e8 100644
--- a/backend/plugin/advisor/mysql/rule_view_disallow_create.go
+++ b/backend/plugin/advisor/mysql/rule_view_disallow_create.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLViewDisallowCreate, &ViewDisallowCreateAdvisor{})
+ advisor.Register(storepb.Engine_MYSQL, advisor.SchemaRuleViewDisallowCreate, &ViewDisallowCreateAdvisor{})
}
// ViewDisallowCreateAdvisor is the advisor checking for disallow creating view.
diff --git a/backend/plugin/advisor/oceanbase/advisor_disallow_offline_ddl.go b/backend/plugin/advisor/oceanbase/advisor_disallow_offline_ddl.go
index c4e464ccf3..c77ce4bc32 100644
--- a/backend/plugin/advisor/oceanbase/advisor_disallow_offline_ddl.go
+++ b/backend/plugin/advisor/oceanbase/advisor_disallow_offline_ddl.go
@@ -24,7 +24,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLDisallowOfflineDDL, &DisallowOfflineDdlAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementDisallowOfflineDDL, &DisallowOfflineDdlAdvisor{})
}
// DisallowOfflineDdlAdvisor is the advisor checking for disallow Offline DDL.
diff --git a/backend/plugin/advisor/oceanbase/advisor_insert_row_limit.go b/backend/plugin/advisor/oceanbase/advisor_insert_row_limit.go
index 6e05aff528..d865fc4d09 100644
--- a/backend/plugin/advisor/oceanbase/advisor_insert_row_limit.go
+++ b/backend/plugin/advisor/oceanbase/advisor_insert_row_limit.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLInsertRowLimit, &InsertRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementInsertRowLimit, &InsertRowLimitAdvisor{})
}
// InsertRowLimitAdvisor is the advisor checking for insert row limit.
diff --git a/backend/plugin/advisor/oceanbase/advisor_statement_affected_row_limit.go b/backend/plugin/advisor/oceanbase/advisor_statement_affected_row_limit.go
index c6e4323a77..8e2909fee5 100644
--- a/backend/plugin/advisor/oceanbase/advisor_statement_affected_row_limit.go
+++ b/backend/plugin/advisor/oceanbase/advisor_statement_affected_row_limit.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_OCEANBASE, advisor.MySQLStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_OCEANBASE, advisor.SchemaRuleStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
}
// StatementAffectedRowLimitAdvisor is the advisor checking for UPDATE/DELETE affected row limit.
diff --git a/backend/plugin/advisor/oracle/rule_builtin_prior_backup_check.go b/backend/plugin/advisor/oracle/rule_builtin_prior_backup_check.go
index d44957ea2f..016156c1ea 100644
--- a/backend/plugin/advisor/oracle/rule_builtin_prior_backup_check.go
+++ b/backend/plugin/advisor/oracle/rule_builtin_prior_backup_check.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleBuiltinPriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.BuiltinRulePriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
}
type StatementPriorBackupCheckAdvisor struct {
diff --git a/backend/plugin/advisor/oracle/rule_column_add_not_null_column_require_default.go b/backend/plugin/advisor/oracle/rule_column_add_not_null_column_require_default.go
index 6db213414c..1dea282824 100644
--- a/backend/plugin/advisor/oracle/rule_column_add_not_null_column_require_default.go
+++ b/backend/plugin/advisor/oracle/rule_column_add_not_null_column_require_default.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleAddNotNullColumnRequireDefault, &ColumnAddNotNullColumnRequireDefaultAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleAddNotNullColumnRequireDefault, &ColumnAddNotNullColumnRequireDefaultAdvisor{})
}
// ColumnAddNotNullColumnRequireDefaultAdvisor is the advisor checking for adding not null column requires default.
diff --git a/backend/plugin/advisor/oracle/rule_column_comment_convention.go b/backend/plugin/advisor/oracle/rule_column_comment_convention.go
index 39d402d353..4c060a3e3b 100644
--- a/backend/plugin/advisor/oracle/rule_column_comment_convention.go
+++ b/backend/plugin/advisor/oracle/rule_column_comment_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleColumnCommentConvention, &ColumnCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleColumnCommentConvention, &ColumnCommentConventionAdvisor{})
}
// ColumnCommentConventionAdvisor is the advisor checking for column comment convention.
diff --git a/backend/plugin/advisor/oracle/rule_column_maximum_character_length.go b/backend/plugin/advisor/oracle/rule_column_maximum_character_length.go
index 591b1b367b..0bf3bdaa5f 100644
--- a/backend/plugin/advisor/oracle/rule_column_maximum_character_length.go
+++ b/backend/plugin/advisor/oracle/rule_column_maximum_character_length.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
}
// ColumnMaximumCharacterLengthAdvisor is the advisor checking for maximum character length.
diff --git a/backend/plugin/advisor/oracle/rule_column_maximum_varchar_length.go b/backend/plugin/advisor/oracle/rule_column_maximum_varchar_length.go
index 0b1ddc169a..3af398fe78 100644
--- a/backend/plugin/advisor/oracle/rule_column_maximum_varchar_length.go
+++ b/backend/plugin/advisor/oracle/rule_column_maximum_varchar_length.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
}
// ColumnMaximumVarcharLengthAdvisor is the advisor checking for maximum varchar length.
diff --git a/backend/plugin/advisor/oracle/rule_column_no_null.go b/backend/plugin/advisor/oracle/rule_column_no_null.go
index 46020cf92a..1162caad82 100644
--- a/backend/plugin/advisor/oracle/rule_column_no_null.go
+++ b/backend/plugin/advisor/oracle/rule_column_no_null.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleColumnNoNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
}
type columnMap map[string]int
diff --git a/backend/plugin/advisor/oracle/rule_column_require.go b/backend/plugin/advisor/oracle/rule_column_require.go
index 57b827a60d..5e157bab6f 100644
--- a/backend/plugin/advisor/oracle/rule_column_require.go
+++ b/backend/plugin/advisor/oracle/rule_column_require.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleColumnRequirement, &ColumnRequireAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleRequiredColumn, &ColumnRequireAdvisor{})
}
// ColumnRequireAdvisor is the advisor checking for column requirement.
diff --git a/backend/plugin/advisor/oracle/rule_column_require_default.go b/backend/plugin/advisor/oracle/rule_column_require_default.go
index e23d998e73..906d253258 100644
--- a/backend/plugin/advisor/oracle/rule_column_require_default.go
+++ b/backend/plugin/advisor/oracle/rule_column_require_default.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleRequireColumnDefault, &ColumnRequireDefaultAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleColumnRequireDefault, &ColumnRequireDefaultAdvisor{})
}
// ColumnRequireDefaultAdvisor is the advisor checking for column default requirement.
diff --git a/backend/plugin/advisor/oracle/rule_column_type_disallow_list.go b/backend/plugin/advisor/oracle/rule_column_type_disallow_list.go
index 8fc3e99917..f0357d7ee4 100644
--- a/backend/plugin/advisor/oracle/rule_column_type_disallow_list.go
+++ b/backend/plugin/advisor/oracle/rule_column_type_disallow_list.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
}
// ColumnTypeDisallowListAdvisor is the advisor checking for column type disallow list.
diff --git a/backend/plugin/advisor/oracle/rule_index_key_number_limit.go b/backend/plugin/advisor/oracle/rule_index_key_number_limit.go
index 52ee852336..647254e4df 100644
--- a/backend/plugin/advisor/oracle/rule_index_key_number_limit.go
+++ b/backend/plugin/advisor/oracle/rule_index_key_number_limit.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
}
// IndexKeyNumberLimitAdvisor is the advisor checking for index key number limit.
diff --git a/backend/plugin/advisor/oracle/rule_insert_must_specify_column.go b/backend/plugin/advisor/oracle/rule_insert_must_specify_column.go
index 57cba6d37a..c26c006ca0 100644
--- a/backend/plugin/advisor/oracle/rule_insert_must_specify_column.go
+++ b/backend/plugin/advisor/oracle/rule_insert_must_specify_column.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
}
// InsertMustSpecifyColumnAdvisor is the advisor checking for to enforce column specified.
diff --git a/backend/plugin/advisor/oracle/rule_naming_identifier_case.go b/backend/plugin/advisor/oracle/rule_naming_identifier_case.go
index d6c6614139..cf6e7cf235 100644
--- a/backend/plugin/advisor/oracle/rule_naming_identifier_case.go
+++ b/backend/plugin/advisor/oracle/rule_naming_identifier_case.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleIdentifierCase, &NamingIdentifierCaseAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleIdentifierCase, &NamingIdentifierCaseAdvisor{})
}
// NamingIdentifierCaseAdvisor is the advisor checking for identifier case.
diff --git a/backend/plugin/advisor/oracle/rule_naming_identifier_no_keyword.go b/backend/plugin/advisor/oracle/rule_naming_identifier_no_keyword.go
index 74cb060716..d50d8119f8 100644
--- a/backend/plugin/advisor/oracle/rule_naming_identifier_no_keyword.go
+++ b/backend/plugin/advisor/oracle/rule_naming_identifier_no_keyword.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleIdentifierNamingNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleIdentifierNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
}
// NamingIdentifierNoKeywordAdvisor is the advisor checking for identifier naming convention without keyword.
diff --git a/backend/plugin/advisor/oracle/rule_naming_table.go b/backend/plugin/advisor/oracle/rule_naming_table.go
index 753da910f1..f0c131938b 100644
--- a/backend/plugin/advisor/oracle/rule_naming_table.go
+++ b/backend/plugin/advisor/oracle/rule_naming_table.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleNamingTableConvention, &NamingTableAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleTableNaming, &NamingTableAdvisor{})
}
// NamingTableAdvisor is the advisor checking for table naming convention.
diff --git a/backend/plugin/advisor/oracle/rule_naming_table_no_keyword.go b/backend/plugin/advisor/oracle/rule_naming_table_no_keyword.go
index 18185358d9..0f40ab045f 100644
--- a/backend/plugin/advisor/oracle/rule_naming_table_no_keyword.go
+++ b/backend/plugin/advisor/oracle/rule_naming_table_no_keyword.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleTableNamingNoKeyword, &NamingTableNoKeywordAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleTableNameNoKeyword, &NamingTableNoKeywordAdvisor{})
}
// NamingTableNoKeywordAdvisor is the advisor checking for table naming convention without keyword.
diff --git a/backend/plugin/advisor/oracle/rule_select_no_select_all.go b/backend/plugin/advisor/oracle/rule_select_no_select_all.go
index c73b0278ee..c4d634c5b9 100644
--- a/backend/plugin/advisor/oracle/rule_select_no_select_all.go
+++ b/backend/plugin/advisor/oracle/rule_select_no_select_all.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleNoSelectAll, &SelectNoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementNoSelectAll, &SelectNoSelectAllAdvisor{})
}
// SelectNoSelectAllAdvisor is the advisor checking for no select all.
diff --git a/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_ddl.go b/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_ddl.go
index 5afc5137a6..a2c31306b1 100644
--- a/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_ddl.go
+++ b/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_ddl.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
}
type StatementDisallowMixInDDLAdvisor struct {
diff --git a/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_dml.go b/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_dml.go
index 47ce5f9648..a2560a1423 100644
--- a/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_dml.go
+++ b/backend/plugin/advisor/oracle/rule_statement_disallow_mix_in_dml.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
}
type StatementDisallowMixInDMLAdvisor struct {
diff --git a/backend/plugin/advisor/oracle/rule_statement_dml_dry_run.go b/backend/plugin/advisor/oracle/rule_statement_dml_dry_run.go
index 4bd74c7e8c..a67f8845d3 100644
--- a/backend/plugin/advisor/oracle/rule_statement_dml_dry_run.go
+++ b/backend/plugin/advisor/oracle/rule_statement_dml_dry_run.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
}
type StatementDmlDryRunAdvisor struct {
diff --git a/backend/plugin/advisor/oracle/rule_table_comment_convention.go b/backend/plugin/advisor/oracle/rule_table_comment_convention.go
index 7c0d3e171a..67e89ccc5a 100644
--- a/backend/plugin/advisor/oracle/rule_table_comment_convention.go
+++ b/backend/plugin/advisor/oracle/rule_table_comment_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleTableCommentConvention, &TableCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleTableCommentConvention, &TableCommentConventionAdvisor{})
}
// TableCommentConventionAdvisor is the advisor checking for table comment convention.
diff --git a/backend/plugin/advisor/oracle/rule_table_no_foreign_key.go b/backend/plugin/advisor/oracle/rule_table_no_foreign_key.go
index 06bc27dbe9..eeabe49913 100644
--- a/backend/plugin/advisor/oracle/rule_table_no_foreign_key.go
+++ b/backend/plugin/advisor/oracle/rule_table_no_foreign_key.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleTableNoFK, &TableNoForeignKeyAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleTableNoFK, &TableNoForeignKeyAdvisor{})
}
// TableNoForeignKeyAdvisor is the advisor checking for table disallow foreign key.
diff --git a/backend/plugin/advisor/oracle/rule_table_require_pk.go b/backend/plugin/advisor/oracle/rule_table_require_pk.go
index 14a43acbc9..3063d419ef 100644
--- a/backend/plugin/advisor/oracle/rule_table_require_pk.go
+++ b/backend/plugin/advisor/oracle/rule_table_require_pk.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleTableRequirePK, &TableRequirePKAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleTableRequirePK, &TableRequirePKAdvisor{})
}
// TableRequirePKAdvisor is the advisor checking table requires PK.
diff --git a/backend/plugin/advisor/oracle/rule_where_no_leading_wildcard_like.go b/backend/plugin/advisor/oracle/rule_where_no_leading_wildcard_like.go
index 9d490ca462..7c83280c79 100644
--- a/backend/plugin/advisor/oracle/rule_where_no_leading_wildcard_like.go
+++ b/backend/plugin/advisor/oracle/rule_where_no_leading_wildcard_like.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleNoLeadingWildcardLike, &WhereNoLeadingWildcardLikeAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementNoLeadingWildcardLike, &WhereNoLeadingWildcardLikeAdvisor{})
}
// WhereNoLeadingWildcardLikeAdvisor is the advisor checking for no leading wildcard LIKE.
diff --git a/backend/plugin/advisor/oracle/rule_where_require_for_select.go b/backend/plugin/advisor/oracle/rule_where_require_for_select.go
index 5742ba1cdb..3e6596556a 100644
--- a/backend/plugin/advisor/oracle/rule_where_require_for_select.go
+++ b/backend/plugin/advisor/oracle/rule_where_require_for_select.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleWhereRequirementForSelect, &WhereRequireForSelectAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequireForSelectAdvisor{})
}
// WhereRequireForSelectAdvisor is the advisor checking for WHERE clause requirement.
diff --git a/backend/plugin/advisor/oracle/rule_where_require_for_update_delete.go b/backend/plugin/advisor/oracle/rule_where_require_for_update_delete.go
index 79bc33bca8..ac0e2ef19b 100644
--- a/backend/plugin/advisor/oracle/rule_where_require_for_update_delete.go
+++ b/backend/plugin/advisor/oracle/rule_where_require_for_update_delete.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_ORACLE, advisor.OracleWhereRequirementForUpdateDelete, &WhereRequireForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_ORACLE, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequireForUpdateDeleteAdvisor{})
}
// WhereRequireForUpdateDeleteAdvisor is the advisor checking for WHERE clause requirement.
diff --git a/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go
index 16989d2d4f..f68b27d356 100644
--- a/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go
+++ b/backend/plugin/advisor/pg/advisor_builtin_prior_backup_check.go
@@ -29,7 +29,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLBuiltinPriorBackupCheck, &BuiltinPriorBackupCheckAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.BuiltinRulePriorBackupCheck, &BuiltinPriorBackupCheckAdvisor{})
}
// BuiltinPriorBackupCheckAdvisor is the advisor checking for disallow mix DDL and DML.
diff --git a/backend/plugin/advisor/pg/advisor_collation_allowlist.go b/backend/plugin/advisor/pg/advisor_collation_allowlist.go
index a886933817..4de54daa08 100644
--- a/backend/plugin/advisor/pg/advisor_collation_allowlist.go
+++ b/backend/plugin/advisor/pg/advisor_collation_allowlist.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLCollationAllowlist, &CollationAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleCollationAllowlist, &CollationAllowlistAdvisor{})
}
// CollationAllowlistAdvisor is the advisor checking for collation allowlist.
diff --git a/backend/plugin/advisor/pg/advisor_column_comment_convention.go b/backend/plugin/advisor/pg/advisor_column_comment_convention.go
index 536b8b3e94..0652ffbcff 100644
--- a/backend/plugin/advisor/pg/advisor_column_comment_convention.go
+++ b/backend/plugin/advisor/pg/advisor_column_comment_convention.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLColumnCommentConvention, &ColumnCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnCommentConvention, &ColumnCommentConventionAdvisor{})
}
// ColumnCommentConventionAdvisor is the advisor checking for column comment convention.
diff --git a/backend/plugin/advisor/pg/advisor_column_default_disallow_volatile.go b/backend/plugin/advisor/pg/advisor_column_default_disallow_volatile.go
index eb5b083b65..6677233a38 100644
--- a/backend/plugin/advisor/pg/advisor_column_default_disallow_volatile.go
+++ b/backend/plugin/advisor/pg/advisor_column_default_disallow_volatile.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLColumnDefaultDisallowVolatile, &ColumnDefaultDisallowVolatileAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnDefaultDisallowVolatile, &ColumnDefaultDisallowVolatileAdvisor{})
}
// ColumnRequireDefaultAdvisor is the advisor checking for column default requirement.
diff --git a/backend/plugin/advisor/pg/advisor_column_disallow_changing_type.go b/backend/plugin/advisor/pg/advisor_column_disallow_changing_type.go
index 5747b0922d..9cb86b39a6 100644
--- a/backend/plugin/advisor/pg/advisor_column_disallow_changing_type.go
+++ b/backend/plugin/advisor/pg/advisor_column_disallow_changing_type.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLColumnDisallowChangingType, &ColumnDisallowChangingTypeAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnDisallowChangeType, &ColumnDisallowChangingTypeAdvisor{})
}
// ColumnDisallowChangingTypeAdvisor is the advisor checking for disallow changing column type.
diff --git a/backend/plugin/advisor/pg/advisor_column_maximum_character_length.go b/backend/plugin/advisor/pg/advisor_column_maximum_character_length.go
index dd22d97be8..cbb9d962c1 100644
--- a/backend/plugin/advisor/pg/advisor_column_maximum_character_length.go
+++ b/backend/plugin/advisor/pg/advisor_column_maximum_character_length.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
}
// ColumnMaximumCharacterLengthAdvisor is the advisor checking for maximum character length.
diff --git a/backend/plugin/advisor/pg/advisor_column_no_null.go b/backend/plugin/advisor/pg/advisor_column_no_null.go
index daae7c521b..d0990a7532 100644
--- a/backend/plugin/advisor/pg/advisor_column_no_null.go
+++ b/backend/plugin/advisor/pg/advisor_column_no_null.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLColumnNoNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
}
// ColumnNoNullAdvisor is the advisor checking for column no NULL value.
diff --git a/backend/plugin/advisor/pg/advisor_column_require_default.go b/backend/plugin/advisor/pg/advisor_column_require_default.go
index 8f0b4baf7b..538f36d553 100644
--- a/backend/plugin/advisor/pg/advisor_column_require_default.go
+++ b/backend/plugin/advisor/pg/advisor_column_require_default.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLRequireColumnDefault, &ColumnRequireDefaultAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnRequireDefault, &ColumnRequireDefaultAdvisor{})
}
// ColumnRequireDefaultAdvisor is the advisor checking for column default requirement.
diff --git a/backend/plugin/advisor/pg/advisor_column_required.go b/backend/plugin/advisor/pg/advisor_column_required.go
index 8ae9955c92..9108976189 100644
--- a/backend/plugin/advisor/pg/advisor_column_required.go
+++ b/backend/plugin/advisor/pg/advisor_column_required.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLColumnRequirement, &ColumnRequirementAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleRequiredColumn, &ColumnRequirementAdvisor{})
}
type columnSet map[string]bool
diff --git a/backend/plugin/advisor/pg/advisor_column_type_disallow_list.go b/backend/plugin/advisor/pg/advisor_column_type_disallow_list.go
index dea4b28465..f1c7e2b3f2 100644
--- a/backend/plugin/advisor/pg/advisor_column_type_disallow_list.go
+++ b/backend/plugin/advisor/pg/advisor_column_type_disallow_list.go
@@ -14,7 +14,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
}
// ColumnTypeDisallowListAdvisor is the advisor checking for column type restriction.
diff --git a/backend/plugin/advisor/pg/advisor_comment_convention.go b/backend/plugin/advisor/pg/advisor_comment_convention.go
index 8be7524bca..53d1d08cf8 100644
--- a/backend/plugin/advisor/pg/advisor_comment_convention.go
+++ b/backend/plugin/advisor/pg/advisor_comment_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLCommentConvention, &CommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleCommentLength, &CommentConventionAdvisor{})
}
// CommentConventionAdvisor is the advisor checking for comment convention.
diff --git a/backend/plugin/advisor/pg/advisor_encoding_allowlist.go b/backend/plugin/advisor/pg/advisor_encoding_allowlist.go
index 71e6ea7219..668a0855b3 100644
--- a/backend/plugin/advisor/pg/advisor_encoding_allowlist.go
+++ b/backend/plugin/advisor/pg/advisor_encoding_allowlist.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLEncodingAllowlist, &EncodingAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleCharsetAllowlist, &EncodingAllowlistAdvisor{})
}
// EncodingAllowlistAdvisor is the advisor checking for encoding allowlist.
diff --git a/backend/plugin/advisor/pg/advisor_index_create_concurrently.go b/backend/plugin/advisor/pg/advisor_index_create_concurrently.go
index 3d9cedc190..0df7ebd37e 100644
--- a/backend/plugin/advisor/pg/advisor_index_create_concurrently.go
+++ b/backend/plugin/advisor/pg/advisor_index_create_concurrently.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLIndexConcurrently, &IndexConcurrentlyAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleCreateIndexConcurrently, &IndexConcurrentlyAdvisor{})
}
// IndexConcurrentlyAdvisor is the advisor checking for to create index concurrently.
diff --git a/backend/plugin/advisor/pg/advisor_index_key_number_limit.go b/backend/plugin/advisor/pg/advisor_index_key_number_limit.go
index c101ee5341..fd78a91649 100644
--- a/backend/plugin/advisor/pg/advisor_index_key_number_limit.go
+++ b/backend/plugin/advisor/pg/advisor_index_key_number_limit.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
}
// IndexKeyNumberLimitAdvisor is the advisor checking for index key number limit.
diff --git a/backend/plugin/advisor/pg/advisor_index_no_duplicate_column.go b/backend/plugin/advisor/pg/advisor_index_no_duplicate_column.go
index 60c0ab49dd..35bd205bc4 100644
--- a/backend/plugin/advisor/pg/advisor_index_no_duplicate_column.go
+++ b/backend/plugin/advisor/pg/advisor_index_no_duplicate_column.go
@@ -13,7 +13,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
}
// IndexNoDuplicateColumnAdvisor is the advisor checking for no duplicate columns in index.
diff --git a/backend/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go b/backend/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
index 54a33e4572..e5b4b54dd3 100644
--- a/backend/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
+++ b/backend/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleIndexPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
}
// IndexPrimaryKeyTypeAllowlistAdvisor is the advisor checking for primary key type allowlist.
diff --git a/backend/plugin/advisor/pg/advisor_index_total_number_limit.go b/backend/plugin/advisor/pg/advisor_index_total_number_limit.go
index 0e5d320fe7..ba14cae219 100644
--- a/backend/plugin/advisor/pg/advisor_index_total_number_limit.go
+++ b/backend/plugin/advisor/pg/advisor_index_total_number_limit.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
}
// IndexTotalNumberLimitAdvisor is the advisor checking for index total number limit.
diff --git a/backend/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go b/backend/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
index f899a84a25..8bc9736e24 100644
--- a/backend/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
+++ b/backend/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
}
// InsertDisallowOrderByRandAdvisor is the advisor checking for to disallow order by rand in INSERT statements.
diff --git a/backend/plugin/advisor/pg/advisor_insert_must_specify_column.go b/backend/plugin/advisor/pg/advisor_insert_must_specify_column.go
index fc9b11d21b..fd28a0d4f4 100644
--- a/backend/plugin/advisor/pg/advisor_insert_must_specify_column.go
+++ b/backend/plugin/advisor/pg/advisor_insert_must_specify_column.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
}
// InsertMustSpecifyColumnAdvisor is the advisor checking for to enforce column specified.
diff --git a/backend/plugin/advisor/pg/advisor_insert_row_limit.go b/backend/plugin/advisor/pg/advisor_insert_row_limit.go
index 9a4901fd85..897a48961a 100644
--- a/backend/plugin/advisor/pg/advisor_insert_row_limit.go
+++ b/backend/plugin/advisor/pg/advisor_insert_row_limit.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLInsertRowLimit, &InsertRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementInsertRowLimit, &InsertRowLimitAdvisor{})
}
// InsertRowLimitAdvisor is the advisor checking for to limit INSERT rows.
diff --git a/backend/plugin/advisor/pg/advisor_migration_compatibility.go b/backend/plugin/advisor/pg/advisor_migration_compatibility.go
index 6e2ce060df..d643a54669 100644
--- a/backend/plugin/advisor/pg/advisor_migration_compatibility.go
+++ b/backend/plugin/advisor/pg/advisor_migration_compatibility.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLMigrationCompatibility, &CompatibilityAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleSchemaBackwardCompatibility, &CompatibilityAdvisor{})
}
// CompatibilityAdvisor is the advisor checking for schema backward compatibility.
diff --git a/backend/plugin/advisor/pg/advisor_naming_column.go b/backend/plugin/advisor/pg/advisor_naming_column.go
index 45d659e453..78720a2653 100644
--- a/backend/plugin/advisor/pg/advisor_naming_column.go
+++ b/backend/plugin/advisor/pg/advisor_naming_column.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNamingColumnConvention, &NamingColumnConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleColumnNaming, &NamingColumnConventionAdvisor{})
}
// NamingColumnConventionAdvisor is the advisor checking for column convention.
diff --git a/backend/plugin/advisor/pg/advisor_naming_foreign_key_convention.go b/backend/plugin/advisor/pg/advisor_naming_foreign_key_convention.go
index 59aeb7d6c4..979ae59031 100644
--- a/backend/plugin/advisor/pg/advisor_naming_foreign_key_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_foreign_key_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNamingFKConvention, &NamingFKConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleFKNaming, &NamingFKConventionAdvisor{})
}
// NamingFKConventionAdvisor is the advisor checking for foreign key naming convention.
diff --git a/backend/plugin/advisor/pg/advisor_naming_fully_qualified.go b/backend/plugin/advisor/pg/advisor_naming_fully_qualified.go
index 5a400a36ac..7a92e02216 100644
--- a/backend/plugin/advisor/pg/advisor_naming_fully_qualified.go
+++ b/backend/plugin/advisor/pg/advisor_naming_fully_qualified.go
@@ -18,7 +18,7 @@ import (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNamingFullyQualifiedObjectName, &FullyQualifiedObjectNameAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleFullyQualifiedObjectName, &FullyQualifiedObjectNameAdvisor{})
}
type FullyQualifiedObjectNameAdvisor struct{}
diff --git a/backend/plugin/advisor/pg/advisor_naming_index_convention.go b/backend/plugin/advisor/pg/advisor_naming_index_convention.go
index 1fb06e31b4..c3294fe2b0 100644
--- a/backend/plugin/advisor/pg/advisor_naming_index_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_index_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNamingIndexConvention, &NamingIndexConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleIDXNaming, &NamingIndexConventionAdvisor{})
}
// NamingIndexConventionAdvisor is the advisor checking for index naming convention.
diff --git a/backend/plugin/advisor/pg/advisor_naming_primary_key_convention.go b/backend/plugin/advisor/pg/advisor_naming_primary_key_convention.go
index 55d6a360d6..bdeea038b9 100644
--- a/backend/plugin/advisor/pg/advisor_naming_primary_key_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_primary_key_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNamingPKConvention, &NamingPKConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRulePKNaming, &NamingPKConventionAdvisor{})
}
// NamingPKConventionAdvisor is the advisor checking for primary key naming convention.
diff --git a/backend/plugin/advisor/pg/advisor_naming_table.go b/backend/plugin/advisor/pg/advisor_naming_table.go
index fc6a4579be..4eaf8ca18a 100644
--- a/backend/plugin/advisor/pg/advisor_naming_table.go
+++ b/backend/plugin/advisor/pg/advisor_naming_table.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNamingTableConvention, &NamingTableConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleTableNaming, &NamingTableConventionAdvisor{})
}
// NamingTableConventionAdvisor is the advisor checking for table naming convention.
diff --git a/backend/plugin/advisor/pg/advisor_naming_unique_key_convention.go b/backend/plugin/advisor/pg/advisor_naming_unique_key_convention.go
index b3efa2b6fe..4944258616 100644
--- a/backend/plugin/advisor/pg/advisor_naming_unique_key_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_unique_key_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNamingUKConvention, &NamingUKConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleUKNaming, &NamingUKConventionAdvisor{})
}
// NamingUKConventionAdvisor is the advisor checking for unique key naming convention.
diff --git a/backend/plugin/advisor/pg/advisor_statement_add_check_not_valid.go b/backend/plugin/advisor/pg/advisor_statement_add_check_not_valid.go
index fd8f642805..178b3e601c 100644
--- a/backend/plugin/advisor/pg/advisor_statement_add_check_not_valid.go
+++ b/backend/plugin/advisor/pg/advisor_statement_add_check_not_valid.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLAddCheckNotValid, &StatementAddCheckNotValidAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementAddCheckNotValid, &StatementAddCheckNotValidAdvisor{})
}
// StatementAddCheckNotValidAdvisor is the advisor checking for to add check not valid.
diff --git a/backend/plugin/advisor/pg/advisor_statement_add_fk_not_valid.go b/backend/plugin/advisor/pg/advisor_statement_add_fk_not_valid.go
index 23aadca01a..fc30a2c61b 100644
--- a/backend/plugin/advisor/pg/advisor_statement_add_fk_not_valid.go
+++ b/backend/plugin/advisor/pg/advisor_statement_add_fk_not_valid.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLAddFKNotValid, &StatementAddFKNotValidAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementAddFKNotValid, &StatementAddFKNotValidAdvisor{})
}
// StatementAddFKNotValidAdvisor is the advisor checking for to add check not valid.
diff --git a/backend/plugin/advisor/pg/advisor_statement_affected_row_limit.go b/backend/plugin/advisor/pg/advisor_statement_affected_row_limit.go
index e2feb0453a..b0fcfe83b2 100644
--- a/backend/plugin/advisor/pg/advisor_statement_affected_row_limit.go
+++ b/backend/plugin/advisor/pg/advisor_statement_affected_row_limit.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementAffectedRowLimit, &StatementAffectedRowLimitAdvisor{})
}
// StatementAffectedRowLimitAdvisor is the advisor checking for UPDATE/DELETE affected row limit.
diff --git a/backend/plugin/advisor/pg/advisor_statement_check_set_role_variable.go b/backend/plugin/advisor/pg/advisor_statement_check_set_role_variable.go
index 90d9e3101e..4781374fac 100644
--- a/backend/plugin/advisor/pg/advisor_statement_check_set_role_variable.go
+++ b/backend/plugin/advisor/pg/advisor_statement_check_set_role_variable.go
@@ -16,7 +16,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementCheckSetRoleVariable, &StatementCheckSetRoleVariable{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementCheckSetRoleVariable, &StatementCheckSetRoleVariable{})
}
type StatementCheckSetRoleVariable struct {
diff --git a/backend/plugin/advisor/pg/advisor_statement_create_specify_schema.go b/backend/plugin/advisor/pg/advisor_statement_create_specify_schema.go
index 1bec00ec67..35c5339a2e 100644
--- a/backend/plugin/advisor/pg/advisor_statement_create_specify_schema.go
+++ b/backend/plugin/advisor/pg/advisor_statement_create_specify_schema.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementCreateSpecifySchema, &StatementCreateSpecifySchema{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementCreateSpecifySchema, &StatementCreateSpecifySchema{})
}
type StatementCreateSpecifySchema struct {
diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go b/backend/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
index bc258215fd..e492c16f14 100644
--- a/backend/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLDisallowAddColumnWithDefault, &StatementDisallowAddColumnWithDefaultAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDisallowAddColumnWithDefault, &StatementDisallowAddColumnWithDefaultAdvisor{})
}
// StatementDisallowAddColumnWithDefaultAdvisor is the advisor checking for to disallow add column with default.
diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go b/backend/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
index 4635534a6e..5b6413984f 100644
--- a/backend/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLDisallowAddNotNull, &StatementDisallowAddNotNullAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDisallowAddNotNull, &StatementDisallowAddNotNullAdvisor{})
}
// StatementDisallowAddNotNullAdvisor is the advisor checking for to disallow add not null.
diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_commit.go b/backend/plugin/advisor/pg/advisor_statement_disallow_commit.go
index db632f62c2..1a9af2a3ab 100644
--- a/backend/plugin/advisor/pg/advisor_statement_disallow_commit.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_commit.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
}
// StatementDisallowCommitAdvisor is the advisor checking for to disallow commit.
diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_ddl.go b/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_ddl.go
index 63a5d04f0c..45a7dcbf8f 100644
--- a/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_ddl.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_ddl.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
}
// StatementDisallowMixInDDLAdvisor is the advisor checking for disallow mix DDL and DML.
diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_dml.go b/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_dml.go
index 6c4831d9f1..8f8755e941 100644
--- a/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_dml.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_mix_in_dml.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
}
// StatementDisallowMixInDMLAdvisor is the advisor checking for disallow mix DDL and DML.
diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_on_del_cascade.go b/backend/plugin/advisor/pg/advisor_statement_disallow_on_del_cascade.go
index 51f1092a29..64527d9aaa 100644
--- a/backend/plugin/advisor/pg/advisor_statement_disallow_on_del_cascade.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_on_del_cascade.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementDisallowOnDelCascade, &StatementDisallowOnDelCascadeAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDisallowOnDelCascade, &StatementDisallowOnDelCascadeAdvisor{})
}
// StatementDisallowOnDelCascadeAdvisor is the advisor checking the disallow cascade.
diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_rm_tbl_cascade.go b/backend/plugin/advisor/pg/advisor_statement_disallow_rm_tbl_cascade.go
index 7ff6802983..a7acb3b436 100644
--- a/backend/plugin/advisor/pg/advisor_statement_disallow_rm_tbl_cascade.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_rm_tbl_cascade.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementDisallowRemoveTblCascade, &StatementDisallowRemoveTblCascadeAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDisallowRemoveTblCascade, &StatementDisallowRemoveTblCascadeAdvisor{})
}
// StatementDisallowRemoveTblCascadeAdvisor is the advisor checking the disallow cascade.
diff --git a/backend/plugin/advisor/pg/advisor_statement_dml_dry_run.go b/backend/plugin/advisor/pg/advisor_statement_dml_dry_run.go
index e244bdda83..5f3875b79b 100644
--- a/backend/plugin/advisor/pg/advisor_statement_dml_dry_run.go
+++ b/backend/plugin/advisor/pg/advisor_statement_dml_dry_run.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
}
// StatementDmlDryRunAdvisor is the advisor checking for DML dry run.
diff --git a/backend/plugin/advisor/pg/advisor_statement_maximum_limit_value.go b/backend/plugin/advisor/pg/advisor_statement_maximum_limit_value.go
index 16daac6264..d2b0b6646b 100644
--- a/backend/plugin/advisor/pg/advisor_statement_maximum_limit_value.go
+++ b/backend/plugin/advisor/pg/advisor_statement_maximum_limit_value.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
}
// StatementAddCheckNotValidAdvisor is the advisor checking for to add check not valid.
diff --git a/backend/plugin/advisor/pg/advisor_statement_merge_alter_table.go b/backend/plugin/advisor/pg/advisor_statement_merge_alter_table.go
index 37d01f3c2e..d6b931b468 100644
--- a/backend/plugin/advisor/pg/advisor_statement_merge_alter_table.go
+++ b/backend/plugin/advisor/pg/advisor_statement_merge_alter_table.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLMergeAlterTable, &StatementMergeAlterTableAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementMergeAlterTable, &StatementMergeAlterTableAdvisor{})
}
// StatementMergeAlterTableAdvisor is the advisor checking for no redundant ALTER TABLE statements.
diff --git a/backend/plugin/advisor/pg/advisor_statement_non_transactional.go b/backend/plugin/advisor/pg/advisor_statement_non_transactional.go
index 7c19872cf0..df38084486 100644
--- a/backend/plugin/advisor/pg/advisor_statement_non_transactional.go
+++ b/backend/plugin/advisor/pg/advisor_statement_non_transactional.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNonTransactional, &NonTransactionalAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementNonTransactional, &NonTransactionalAdvisor{})
}
type NonTransactionalAdvisor struct {
diff --git a/backend/plugin/advisor/pg/advisor_statement_object_owner_check.go b/backend/plugin/advisor/pg/advisor_statement_object_owner_check.go
index 1f4e2b89b4..2f08192ea8 100644
--- a/backend/plugin/advisor/pg/advisor_statement_object_owner_check.go
+++ b/backend/plugin/advisor/pg/advisor_statement_object_owner_check.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementObjectOwnerCheck, &StatementObjectOwnerCheckAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementObjectOwnerCheck, &StatementObjectOwnerCheckAdvisor{})
}
const (
diff --git a/backend/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go b/backend/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
index 4097725db8..8e6935902c 100644
--- a/backend/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
+++ b/backend/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
}
// NoLeadingWildcardLikeAdvisor is the advisor checking for no leading wildcard LIKE.
diff --git a/backend/plugin/advisor/pg/advisor_stmt_no_select_all.go b/backend/plugin/advisor/pg/advisor_stmt_no_select_all.go
index e68be001a0..2773ab6bd3 100644
--- a/backend/plugin/advisor/pg/advisor_stmt_no_select_all.go
+++ b/backend/plugin/advisor/pg/advisor_stmt_no_select_all.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLNoSelectAll, &NoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementNoSelectAll, &NoSelectAllAdvisor{})
}
// NoSelectAllAdvisor is the advisor checking for no "select *".
diff --git a/backend/plugin/advisor/pg/advisor_stmt_where_required_select.go b/backend/plugin/advisor/pg/advisor_stmt_where_required_select.go
index 1a4245070a..6f37f66dba 100644
--- a/backend/plugin/advisor/pg/advisor_stmt_where_required_select.go
+++ b/backend/plugin/advisor/pg/advisor_stmt_where_required_select.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLWhereRequirementForSelect, &WhereRequirementForSelectAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequirementForSelectAdvisor{})
}
// WhereRequirementForSelectAdvisor is the advisor checking for the WHERE clause requirement for SELECT statements.
diff --git a/backend/plugin/advisor/pg/advisor_stmt_where_required_update_delete.go b/backend/plugin/advisor/pg/advisor_stmt_where_required_update_delete.go
index 774759b18e..ea39267642 100644
--- a/backend/plugin/advisor/pg/advisor_stmt_where_required_update_delete.go
+++ b/backend/plugin/advisor/pg/advisor_stmt_where_required_update_delete.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLWhereRequirementForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
}
// WhereRequirementForUpdateDeleteAdvisor is the advisor checking for the WHERE clause requirement.
diff --git a/backend/plugin/advisor/pg/advisor_table_comment_convention.go b/backend/plugin/advisor/pg/advisor_table_comment_convention.go
index 7083648788..bb12f53d8f 100644
--- a/backend/plugin/advisor/pg/advisor_table_comment_convention.go
+++ b/backend/plugin/advisor/pg/advisor_table_comment_convention.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLTableCommentConvention, &TableCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleTableCommentConvention, &TableCommentConventionAdvisor{})
}
// TableCommentConventionAdvisor is the advisor checking for table comment convention.
diff --git a/backend/plugin/advisor/pg/advisor_table_disallow_partition.go b/backend/plugin/advisor/pg/advisor_table_disallow_partition.go
index c4d8b4d7aa..71a6ca6d50 100644
--- a/backend/plugin/advisor/pg/advisor_table_disallow_partition.go
+++ b/backend/plugin/advisor/pg/advisor_table_disallow_partition.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLTableDisallowPartition, &TableDisallowPartitionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleTableDisallowPartition, &TableDisallowPartitionAdvisor{})
}
// TableDisallowPartitionAdvisor is the advisor checking for disallow table partition.
diff --git a/backend/plugin/advisor/pg/advisor_table_drop_naming_convention.go b/backend/plugin/advisor/pg/advisor_table_drop_naming_convention.go
index 8869ec28af..c1cfac5679 100644
--- a/backend/plugin/advisor/pg/advisor_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/pg/advisor_table_drop_naming_convention.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
}
// TableDropNamingConventionAdvisor is the advisor checking for table drop with naming convention.
diff --git a/backend/plugin/advisor/pg/advisor_table_no_fk.go b/backend/plugin/advisor/pg/advisor_table_no_fk.go
index b786461a0e..bb2faa3cb2 100644
--- a/backend/plugin/advisor/pg/advisor_table_no_fk.go
+++ b/backend/plugin/advisor/pg/advisor_table_no_fk.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLTableNoFK, &TableNoFKAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleTableNoFK, &TableNoFKAdvisor{})
}
// TableNoFKAdvisor is the advisor checking table disallow foreign key.
diff --git a/backend/plugin/advisor/pg/advisor_table_require_pk.go b/backend/plugin/advisor/pg/advisor_table_require_pk.go
index 9c7e21695e..dcee64125e 100644
--- a/backend/plugin/advisor/pg/advisor_table_require_pk.go
+++ b/backend/plugin/advisor/pg/advisor_table_require_pk.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLTableRequirePK, &TableRequirePKAdvisor{})
+ advisor.Register(storepb.Engine_POSTGRES, advisor.SchemaRuleTableRequirePK, &TableRequirePKAdvisor{})
}
// TableRequirePKAdvisor is the advisor checking table requires PK.
diff --git a/backend/plugin/advisor/redshift/advisor_table_drop_naming_convention.go b/backend/plugin/advisor/redshift/advisor_table_drop_naming_convention.go
index 714def6f68..faa93854ef 100644
--- a/backend/plugin/advisor/redshift/advisor_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/redshift/advisor_table_drop_naming_convention.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_REDSHIFT, advisor.PostgreSQLTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_REDSHIFT, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
}
// TableDropNamingConventionAdvisor is the advisor checking for table drop with naming convention.
diff --git a/backend/plugin/advisor/snowflake/rule_column_maximum_varchar_length.go b/backend/plugin/advisor/snowflake/rule_column_maximum_varchar_length.go
index dec9db0d33..5f99ad3170 100644
--- a/backend/plugin/advisor/snowflake/rule_column_maximum_varchar_length.go
+++ b/backend/plugin/advisor/snowflake/rule_column_maximum_varchar_length.go
@@ -25,7 +25,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleColumnMaximumVarcharLength, &ColumnMaximumVarcharLengthAdvisor{})
}
// ColumnMaximumVarcharLengthAdvisor is the advisor checking for maximum varchar length.
diff --git a/backend/plugin/advisor/snowflake/rule_column_no_null.go b/backend/plugin/advisor/snowflake/rule_column_no_null.go
index 8e3f93a7b2..9717f310cf 100644
--- a/backend/plugin/advisor/snowflake/rule_column_no_null.go
+++ b/backend/plugin/advisor/snowflake/rule_column_no_null.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeColumnNoNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
}
// ColumnNoNullAdvisor is the advisor checking for column no NULL value.
diff --git a/backend/plugin/advisor/snowflake/rule_column_require.go b/backend/plugin/advisor/snowflake/rule_column_require.go
index 8af754a4dc..30e659d82b 100644
--- a/backend/plugin/advisor/snowflake/rule_column_require.go
+++ b/backend/plugin/advisor/snowflake/rule_column_require.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeColumnRequirement, &ColumnRequireAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleRequiredColumn, &ColumnRequireAdvisor{})
}
// ColumnRequireAdvisor is the advisor checking for column requirement.
diff --git a/backend/plugin/advisor/snowflake/rule_migration_compatibility.go b/backend/plugin/advisor/snowflake/rule_migration_compatibility.go
index 612730a3f5..3101f5ebdf 100644
--- a/backend/plugin/advisor/snowflake/rule_migration_compatibility.go
+++ b/backend/plugin/advisor/snowflake/rule_migration_compatibility.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeMigrationCompatibility, &MigrationCompatibilityAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleSchemaBackwardCompatibility, &MigrationCompatibilityAdvisor{})
}
// MigrationCompatibilityAdvisor is the advisor checking for migration compatibility.
diff --git a/backend/plugin/advisor/snowflake/rule_naming_identifier_case.go b/backend/plugin/advisor/snowflake/rule_naming_identifier_case.go
index 139128a84c..979f772105 100644
--- a/backend/plugin/advisor/snowflake/rule_naming_identifier_case.go
+++ b/backend/plugin/advisor/snowflake/rule_naming_identifier_case.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeIdentifierCase, &NamingIdentifierCaseAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleIdentifierCase, &NamingIdentifierCaseAdvisor{})
}
// NamingIdentifierCaseAdvisor is the advisor checking for identifier case.
diff --git a/backend/plugin/advisor/snowflake/rule_naming_identifier_no_keyword.go b/backend/plugin/advisor/snowflake/rule_naming_identifier_no_keyword.go
index 13bcfd3f9a..79b71aa5db 100644
--- a/backend/plugin/advisor/snowflake/rule_naming_identifier_no_keyword.go
+++ b/backend/plugin/advisor/snowflake/rule_naming_identifier_no_keyword.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeIdentifierNamingNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleIdentifierNoKeyword, &NamingIdentifierNoKeywordAdvisor{})
}
// NamingIdentifierNoKeywordAdvisor is the advisor checking for identifier naming convention without keyword.
diff --git a/backend/plugin/advisor/snowflake/rule_naming_table.go b/backend/plugin/advisor/snowflake/rule_naming_table.go
index 7f2cf80805..6ae6b53cfe 100644
--- a/backend/plugin/advisor/snowflake/rule_naming_table.go
+++ b/backend/plugin/advisor/snowflake/rule_naming_table.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeNamingTableConvention, &NamingTableAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleTableNaming, &NamingTableAdvisor{})
}
// NamingTableAdvisor is the advisor checking for table naming convention.
diff --git a/backend/plugin/advisor/snowflake/rule_naming_table_no_keyword.go b/backend/plugin/advisor/snowflake/rule_naming_table_no_keyword.go
index 95bf62d538..780dccd3cb 100644
--- a/backend/plugin/advisor/snowflake/rule_naming_table_no_keyword.go
+++ b/backend/plugin/advisor/snowflake/rule_naming_table_no_keyword.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeTableNamingNoKeyword, &NamingTableNoKeywordAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleTableNameNoKeyword, &NamingTableNoKeywordAdvisor{})
}
// NamingTableNoKeywordAdvisor is the advisor checking for table naming convention without keyword.
diff --git a/backend/plugin/advisor/snowflake/rule_select_no_select_all.go b/backend/plugin/advisor/snowflake/rule_select_no_select_all.go
index df14ae21ae..6960570348 100644
--- a/backend/plugin/advisor/snowflake/rule_select_no_select_all.go
+++ b/backend/plugin/advisor/snowflake/rule_select_no_select_all.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeNoSelectAll, &SelectNoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleStatementNoSelectAll, &SelectNoSelectAllAdvisor{})
}
// SelectNoSelectAllAdvisor is the advisor checking for no select all.
diff --git a/backend/plugin/advisor/snowflake/rule_table_drop_naming_convention.go b/backend/plugin/advisor/snowflake/rule_table_drop_naming_convention.go
index 8da13d69bf..39500aae91 100644
--- a/backend/plugin/advisor/snowflake/rule_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/snowflake/rule_table_drop_naming_convention.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
}
// TableDropNamingConventionAdvisor is the advisor checking for table drop with naming convention.
diff --git a/backend/plugin/advisor/snowflake/rule_table_no_foreign_key.go b/backend/plugin/advisor/snowflake/rule_table_no_foreign_key.go
index 50ffae1c55..7fa77f5428 100644
--- a/backend/plugin/advisor/snowflake/rule_table_no_foreign_key.go
+++ b/backend/plugin/advisor/snowflake/rule_table_no_foreign_key.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeTableNoFK, &TableNoForeignKeyAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleTableNoFK, &TableNoForeignKeyAdvisor{})
}
// TableNoForeignKeyAdvisor is the advisor checking for table disallow foreign key.
diff --git a/backend/plugin/advisor/snowflake/rule_table_require_pk.go b/backend/plugin/advisor/snowflake/rule_table_require_pk.go
index 7151e2aafd..3332167cef 100644
--- a/backend/plugin/advisor/snowflake/rule_table_require_pk.go
+++ b/backend/plugin/advisor/snowflake/rule_table_require_pk.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeTableRequirePK, &TableRequirePkAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleTableRequirePK, &TableRequirePkAdvisor{})
}
// TableRequirePkAdvisor is the advisor checking for table require primary key.
diff --git a/backend/plugin/advisor/snowflake/rule_where_require_select.go b/backend/plugin/advisor/snowflake/rule_where_require_select.go
index ab12f15bdc..3018963194 100644
--- a/backend/plugin/advisor/snowflake/rule_where_require_select.go
+++ b/backend/plugin/advisor/snowflake/rule_where_require_select.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeWhereRequirementForSelect, &WhereRequireForSelectAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequireForSelectAdvisor{})
}
// WhereRequireForSelectAdvisor is the advisor checking for WHERE clause requirement for SELECT statement.
diff --git a/backend/plugin/advisor/snowflake/rule_where_require_update_delete.go b/backend/plugin/advisor/snowflake/rule_where_require_update_delete.go
index 4b7a72ad09..b965cf8cb6 100644
--- a/backend/plugin/advisor/snowflake/rule_where_require_update_delete.go
+++ b/backend/plugin/advisor/snowflake/rule_where_require_update_delete.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SnowflakeWhereRequirementForUpdateDelete, &WhereRequireForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_SNOWFLAKE, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequireForUpdateDeleteAdvisor{})
}
// WhereRequireForUpdateDeleteAdvisor is the advisor checking for WHERE clause requirement for UPDATE and DELETE statement.
diff --git a/backend/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.go
index 4e60881bec..08f9f13568 100644
--- a/backend/plugin/advisor/sql_review.go
+++ b/backend/plugin/advisor/sql_review.go
@@ -5,13 +5,11 @@ import (
"database/sql"
"encoding/json"
"fmt"
- "log/slog"
"regexp"
"github.com/pkg/errors"
"github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
"github.com/bytebase/bytebase/backend/component/sheet"
storepb "github.com/bytebase/bytebase/backend/generated-go/store"
"github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
@@ -104,8 +102,8 @@ const (
SchemaRuleStatementDisallowUsingTemporary = "statement.disallow-using-temporary"
// SchemaRuleStatementWhereNoEqualNull check the WHERE clause no equal null.
SchemaRuleStatementWhereNoEqualNull = "statement.where.no-equal-null"
- // SchemaRuleStatementWhereDisallowFunctionsAndCaculations disallow using function in WHERE clause.
- SchemaRuleStatementWhereDisallowFunctionsAndCaculations = "statement.where.disallow-functions-and-calculations"
+ // SchemaRuleStatementWhereDisallowFunctionsAndCalculations disallow using function in WHERE clause.
+ SchemaRuleStatementWhereDisallowFunctionsAndCalculations = "statement.where.disallow-functions-and-calculations"
// SchemaRuleStatementQueryMinumumPlanLevel enforce the minimum plan level.
SchemaRuleStatementQueryMinumumPlanLevel = "statement.query.minimum-plan-level"
// SchemaRuleStatementWhereMaximumLogicalOperatorCount enforce the maximum logical operator count in WHERE clause.
@@ -119,9 +117,9 @@ const (
// SchemaRuleStatementJoinStrictColumnAttrs enforce the join strict column attributes.
SchemaRuleStatementJoinStrictColumnAttrs = "statement.join-strict-column-attrs"
// SchemaRuleStatementDisallowMixInDDL disallows DML statements in DDL statements.
- SchemaRuleStatementDisallowMixInDDL = "statement.disallow-mix-in-ddl"
+ SchemaRuleStatementDisallowMixInDDL SQLReviewRuleType = "statement.disallow-mix-in-ddl"
// SchemaRuleStatementDisallowMixInDML disallows DDL statements in DML statements.
- SchemaRuleStatementDisallowMixInDML = "statement.disallow-mix-in-dml"
+ SchemaRuleStatementDisallowMixInDML SQLReviewRuleType = "statement.disallow-mix-in-dml"
// SchemaRuleStatementPriorBackupCheck checks for prior backup.
SchemaRuleStatementPriorBackupCheck = "statement.prior-backup-check"
// SchemaRuleStatementNonTransactional checks for non-transactional statements.
@@ -131,7 +129,7 @@ const (
// SchemaRuleStatementDisallowOfflineDDL disallow offline ddl.
SchemaRuleStatementDisallowOfflineDDL = "statement.disallow-offline-ddl"
// SchemaRuleStatementDisallowCrossDBQueries disallow cross database queries.
- SchemaRuleStatementDisallowCrossDBQueries = "statement.disallow-cross-db-queries"
+ SchemaRuleStatementDisallowCrossDBQueries SQLReviewRuleType = "statement.disallow-cross-db-queries"
// SchemaRuleStatementMaxExecutionTime enforce the maximum execution time.
SchemaRuleStatementMaxExecutionTime = "statement.max-execution-time"
// SchemaRuleStatementRequireAlgorithmOption require set ALGORITHM option in ALTER TABLE statement.
@@ -564,18 +562,10 @@ func SQLReviewCheck(
continue
}
- advisorType, err := getAdvisorTypeByRule(ruleType, checkContext.DBType)
- if err != nil {
- if rule.Engine != storepb.Engine_ENGINE_UNSPECIFIED {
- slog.Warn("not supported rule", "rule type", rule.Type, "engine", rule.Engine.String(), log.BBError(err))
- }
- continue
- }
-
adviceList, err := Check(
ctx,
checkContext.DBType,
- advisorType,
+ ruleType,
Context{
DBSchema: checkContext.DBSchema,
ChangeType: checkContext.ChangeType,
@@ -811,799 +801,3 @@ func convertWalkThroughErrorToAdvice(err error) ([]*storepb.Advice, error) {
return res, nil
}
-
-func getAdvisorTypeByRule(ruleType SQLReviewRuleType, engine storepb.Engine) (Type, error) {
- switch ruleType {
- case SchemaRuleStatementRequireWhereForSelect:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLWhereRequirementForSelect, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLWhereRequirementForSelect, nil
- case storepb.Engine_ORACLE:
- return OracleWhereRequirementForSelect, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeWhereRequirementForSelect, nil
- case storepb.Engine_MSSQL:
- return MSSQLWhereRequirementForSelect, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleStatementRequireWhereForUpdateDelete:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLWhereRequirementForUpdateDelete, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLWhereRequirementForUpdateDelete, nil
- case storepb.Engine_ORACLE:
- return OracleWhereRequirementForUpdateDelete, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeWhereRequirementForUpdateDelete, nil
- case storepb.Engine_MSSQL:
- return MSSQLWhereRequirementForUpdateDelete, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleStatementNoLeadingWildcardLike:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNoLeadingWildcardLike, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLNoLeadingWildcardLike, nil
- case storepb.Engine_ORACLE:
- return OracleNoLeadingWildcardLike, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleStatementNoSelectAll:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNoSelectAll, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLNoSelectAll, nil
- case storepb.Engine_ORACLE:
- return OracleNoSelectAll, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeNoSelectAll, nil
- case storepb.Engine_MSSQL:
- return MSSQLNoSelectAll, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleSchemaBackwardCompatibility:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLMigrationCompatibility, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLMigrationCompatibility, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeMigrationCompatibility, nil
- case storepb.Engine_MSSQL:
- return MSSQLMigrationCompatibility, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleFullyQualifiedObjectName:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLNamingFullyQualifiedObjectName, nil
- }
- case SchemaRuleTableNaming:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNamingTableConvention, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLNamingTableConvention, nil
- case storepb.Engine_ORACLE:
- return OracleNamingTableConvention, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeNamingTableConvention, nil
- case storepb.Engine_MSSQL:
- return MSSQLNamingTableConvention, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleIDXNaming:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNamingIndexConvention, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLNamingIndexConvention, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRulePKNaming:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLNamingPKConvention, nil
- }
- case SchemaRuleUKNaming:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNamingUKConvention, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLNamingUKConvention, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleFKNaming:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNamingFKConvention, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLNamingFKConvention, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleColumnNaming:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNamingColumnConvention, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLNamingColumnConvention, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleAutoIncrementColumnNaming:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLNamingAutoIncrementColumnConvention, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleTableNameNoKeyword:
- switch engine {
- case storepb.Engine_ORACLE:
- return OracleTableNamingNoKeyword, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeTableNamingNoKeyword, nil
- case storepb.Engine_MSSQL:
- return MSSQLTableNamingNoKeyword, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleIdentifierNoKeyword:
- switch engine {
- case storepb.Engine_ORACLE:
- return OracleIdentifierNamingNoKeyword, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeIdentifierNamingNoKeyword, nil
- case storepb.Engine_MSSQL:
- return MSSQLIdentifierNamingNoKeyword, nil
- case storepb.Engine_MYSQL:
- return MySQLIdentifierNamingNoKeyword, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleIdentifierCase:
- switch engine {
- case storepb.Engine_ORACLE:
- return OracleIdentifierCase, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeIdentifierCase, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleRequiredColumn:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnRequirement, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLColumnRequirement, nil
- case storepb.Engine_ORACLE:
- return OracleColumnRequirement, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeColumnRequirement, nil
- case storepb.Engine_MSSQL:
- return MSSQLColumnRequirement, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleColumnNotNull:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnNoNull, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLColumnNoNull, nil
- case storepb.Engine_ORACLE:
- return OracleColumnNoNull, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeColumnNoNull, nil
- case storepb.Engine_MSSQL:
- return MSSQLColumnNoNull, nil
- default:
- // Unsupported engine for this rule
- }
- case SchemaRuleColumnDisallowChangeType:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnDisallowChangingType, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLColumnDisallowChangingType, nil
- default:
- }
- case SchemaRuleColumnSetDefaultForNotNull:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnSetDefaultForNotNull, nil
- case storepb.Engine_ORACLE:
- return OracleAddNotNullColumnRequireDefault, nil
- default:
- }
- case SchemaRuleColumnDisallowChange:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnDisallowChanging, nil
- default:
- }
- case SchemaRuleColumnDisallowChangingOrder:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnDisallowChangingOrder, nil
- default:
- }
- case SchemaRuleColumnDisallowDrop:
- if engine == storepb.Engine_OCEANBASE {
- return MySQLColumnDisallowDrop, nil
- }
- case SchemaRuleColumnDisallowDropInIndex:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnDisallowDropInIndex, nil
- default:
- }
- case SchemaRuleColumnCommentConvention:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnCommentConvention, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLColumnCommentConvention, nil
- case storepb.Engine_ORACLE:
- return OracleColumnCommentConvention, nil
- default:
- }
- case SchemaRuleColumnAutoIncrementMustInteger:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLAutoIncrementColumnMustInteger, nil
- default:
- }
- case SchemaRuleColumnTypeDisallowList:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnTypeDisallowList, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLColumnTypeDisallowList, nil
- case storepb.Engine_ORACLE:
- return OracleColumnTypeDisallowList, nil
- case storepb.Engine_MSSQL:
- return MSSQLColumnTypeDisallowList, nil
- default:
- }
- case SchemaRuleColumnDisallowSetCharset:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLDisallowSetColumnCharset, nil
- default:
- }
- case SchemaRuleColumnMaximumCharacterLength:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnMaximumCharacterLength, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLColumnMaximumCharacterLength, nil
- case storepb.Engine_ORACLE:
- return OracleColumnMaximumCharacterLength, nil
- default:
- }
- case SchemaRuleColumnMaximumVarcharLength:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLColumnMaximumVarcharLength, nil
- case storepb.Engine_ORACLE:
- return OracleColumnMaximumVarcharLength, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeColumnMaximumVarcharLength, nil
- case storepb.Engine_MSSQL:
- return MSSQLColumnMaximumVarcharLength, nil
- default:
- }
- case SchemaRuleColumnAutoIncrementInitialValue:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLAutoIncrementColumnInitialValue, nil
- default:
- }
- case SchemaRuleColumnAutoIncrementMustUnsigned:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLAutoIncrementColumnMustUnsigned, nil
- default:
- }
- case SchemaRuleCurrentTimeColumnCountLimit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLCurrentTimeColumnCountLimit, nil
- default:
- }
- case SchemaRuleColumnRequireDefault:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLRequireColumnDefault, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLRequireColumnDefault, nil
- case storepb.Engine_ORACLE:
- return OracleRequireColumnDefault, nil
- default:
- }
- case SchemaRuleColumnDefaultDisallowVolatile:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLColumnDefaultDisallowVolatile, nil
- }
- case SchemaRuleAddNotNullColumnRequireDefault:
- if engine == storepb.Engine_ORACLE {
- return OracleAddNotNullColumnRequireDefault, nil
- }
- case SchemaRuleColumnRequireCharset:
- if engine == storepb.Engine_MYSQL {
- return MySQLColumnRequireCharset, nil
- }
- case SchemaRuleColumnRequireCollation:
- if engine == storepb.Engine_MYSQL {
- return MySQLColumnRequireCollation, nil
- }
- case SchemaRuleTableRequirePK:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLTableRequirePK, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLTableRequirePK, nil
- case storepb.Engine_ORACLE:
- return OracleTableRequirePK, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeTableRequirePK, nil
- case storepb.Engine_MSSQL:
- return MSSQLTableRequirePK, nil
- default:
- }
- case SchemaRuleTableNoFK:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLTableNoFK, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLTableNoFK, nil
- case storepb.Engine_ORACLE:
- return OracleTableNoFK, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeTableNoFK, nil
- case storepb.Engine_MSSQL:
- return MSSQLTableNoFK, nil
- default:
- }
- case SchemaRuleTableDropNamingConvention:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLTableDropNamingConvention, nil
- case storepb.Engine_POSTGRES, storepb.Engine_REDSHIFT:
- return PostgreSQLTableDropNamingConvention, nil
- case storepb.Engine_SNOWFLAKE:
- return SnowflakeTableDropNamingConvention, nil
- case storepb.Engine_MSSQL:
- return MSSQLTableDropNamingConvention, nil
- default:
- }
- case SchemaRuleTableCommentConvention:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLTableCommentConvention, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLTableCommentConvention, nil
- case storepb.Engine_ORACLE:
- return OracleTableCommentConvention, nil
- default:
- }
- case SchemaRuleTableDisallowPartition:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLTableDisallowPartition, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLTableDisallowPartition, nil
- default:
- }
- case SchemaRuleTableDisallowTrigger:
- if engine == storepb.Engine_MYSQL {
- return MySQLTableDisallowTrigger, nil
- }
- case SchemaRuleTableNoDuplicateIndex:
- if engine == storepb.Engine_MYSQL {
- return MySQLTableNoDuplicateIndex, nil
- }
- case SchemaRuleTableTextFieldsTotalLength:
- if engine == storepb.Engine_MYSQL {
- return MySQLTableTextFieldsTotalLength, nil
- }
- case SchemaRuleTableDisallowSetCharset:
- if engine == storepb.Engine_MYSQL {
- return MySQLTableDisallowSetCharset, nil
- }
- case SchemaRuleTableDisallowDDL:
- switch engine {
- case storepb.Engine_MYSQL:
- return MySQLTableDisallowDDL, nil
- case storepb.Engine_MSSQL:
- return MSSQLTableDisallowDDL, nil
- default:
- }
- case SchemaRuleTableDisallowDML:
- switch engine {
- case storepb.Engine_MYSQL:
- return MySQLTableDisallowDML, nil
- case storepb.Engine_MSSQL:
- return MSSQLTableDisallowDML, nil
- default:
- }
- case SchemaRuleTableLimitSize:
- if engine == storepb.Engine_MYSQL {
- return MySQLTableLimitSize, nil
- }
- case SchemaRuleTableRequireCharset:
- if engine == storepb.Engine_MYSQL {
- return MySQLTableRequireCharset, nil
- }
- case SchemaRuleTableRequireCollation:
- if engine == storepb.Engine_MYSQL {
- return MySQLTableRequireCollation, nil
- }
- case SchemaRuleMySQLEngine:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_MARIADB:
- return MySQLUseInnoDB, nil
- default:
- }
- case SchemaRuleDropEmptyDatabase:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLDatabaseAllowDropIfEmpty, nil
- default:
- }
- case SchemaRuleIndexNoDuplicateColumn:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLIndexNoDuplicateColumn, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLIndexNoDuplicateColumn, nil
- default:
- }
- case SchemaRuleIndexKeyNumberLimit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLIndexKeyNumberLimit, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLIndexKeyNumberLimit, nil
- case storepb.Engine_ORACLE:
- return OracleIndexKeyNumberLimit, nil
- default:
- }
- case SchemaRuleIndexTotalNumberLimit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLIndexTotalNumberLimit, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLIndexTotalNumberLimit, nil
- default:
- }
- case SchemaRuleIndexNotRedundant:
- if engine == storepb.Engine_MSSQL {
- return MSSQLIndexNotRedundant, nil
- }
- case SchemaRuleStatementDisallowRemoveTblCascade:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLStatementDisallowRemoveTblCascade, nil
- }
- case SchemaRuleStatementDisallowOnDelCascade:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLStatementDisallowOnDelCascade, nil
- }
- case SchemaRuleStatementDisallowCommit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLStatementDisallowCommit, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLStatementDisallowCommit, nil
- default:
- }
- case SchemaRuleStatementDisallowUsingFilesort:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementDisallowUsingFilesort, nil
- }
- case SchemaRuleStatementDisallowUsingTemporary:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementDisallowUsingTemporary, nil
- }
- case SchemaRuleStatementDisallowMixInDDL:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB:
- return MySQLStatementDisallowMixInDDL, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLStatementDisallowMixInDDL, nil
- case storepb.Engine_ORACLE:
- return OracleStatementDisallowMixInDDL, nil
- case storepb.Engine_MSSQL:
- return MSSQLStatementDisallowMixInDDL, nil
- default:
- }
- case SchemaRuleStatementDisallowMixInDML:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB:
- return MySQLStatementDisallowMixInDML, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLStatementDisallowMixInDML, nil
- case storepb.Engine_ORACLE:
- return OracleStatementDisallowMixInDML, nil
- case storepb.Engine_MSSQL:
- return MSSQLStatementDisallowMixInDML, nil
- default:
- }
- case SchemaRuleStatementAddColumnWithoutPosition:
- if engine == storepb.Engine_OCEANBASE {
- return MySQLStatementAddColumnWithoutPosition, nil
- }
- case SchemaRuleCharsetAllowlist:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLCharsetAllowlist, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLEncodingAllowlist, nil
- default:
- }
- case SchemaRuleCollationAllowlist:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLCollationAllowlist, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLCollationAllowlist, nil
- default:
- }
- case SchemaRuleIndexPKTypeLimit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLIndexPKType, nil
- default:
- }
- case SchemaRuleIndexTypeNoBlob:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLIndexTypeNoBlob, nil
- default:
- }
- case SchemaRuleIndexPrimaryKeyTypeAllowlist:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_OCEANBASE:
- return MySQLPrimaryKeyTypeAllowlist, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLPrimaryKeyTypeAllowlist, nil
- default:
- }
- case SchemaRuleCreateIndexConcurrently:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLIndexConcurrently, nil
- }
- case SchemaRuleIndexTypeAllowList:
- if engine == storepb.Engine_MYSQL {
- return MySQLIndexTypeAllowList, nil
- }
- case SchemaRuleStatementInsertRowLimit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLInsertRowLimit, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLInsertRowLimit, nil
- default:
- }
- case SchemaRuleStatementInsertMustSpecifyColumn:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLInsertMustSpecifyColumn, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLInsertMustSpecifyColumn, nil
- case storepb.Engine_ORACLE:
- return OracleInsertMustSpecifyColumn, nil
- default:
- }
- case SchemaRuleStatementInsertDisallowOrderByRand:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLInsertDisallowOrderByRand, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLInsertDisallowOrderByRand, nil
- default:
- }
- case SchemaRuleStatementDisallowLimit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLStatementDisallowLimit, nil
- default:
- }
- case SchemaRuleStatementDisallowOrderBy:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLDisallowOrderBy, nil
- default:
- }
- case SchemaRuleStatementMergeAlterTable:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLMergeAlterTable, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLMergeAlterTable, nil
- default:
- }
- case SchemaRuleStatementAffectedRowLimit:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLStatementAffectedRowLimit, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLStatementAffectedRowLimit, nil
- default:
- }
- case SchemaRuleStatementDMLDryRun:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLStatementDMLDryRun, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLStatementDMLDryRun, nil
- case storepb.Engine_ORACLE:
- return OracleStatementDMLDryRun, nil
- default:
- }
- case SchemaRuleStatementDisallowAddColumnWithDefault:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLDisallowAddColumnWithDefault, nil
- }
- case SchemaRuleStatementAddCheckNotValid:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLAddCheckNotValid, nil
- }
- case SchemaRuleStatementAddFKNotValid:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLAddFKNotValid, nil
- }
- case SchemaRuleStatementDisallowAddNotNull:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLDisallowAddNotNull, nil
- }
- case SchemaRuleStatementSelectFullTableScan:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- return MySQLStatementSelectFullTableScan, nil
- default:
- }
- case SchemaRuleStatementCreateSpecifySchema:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLStatementCreateSpecifySchema, nil
- }
- case SchemaRuleStatementCheckSetRoleVariable:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLStatementCheckSetRoleVariable, nil
- }
- case SchemaRuleStatementWhereNoEqualNull:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementWhereNoEqualNull, nil
- }
- case SchemaRuleStatementWhereDisallowFunctionsAndCaculations:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementWhereDisallowUsingFunction, nil
- }
- if engine == storepb.Engine_MSSQL {
- return MSSQLStatementWhereDisallowFunctionsAndCalculations, nil
- }
- if engine == storepb.Engine_MSSQL {
- return MSSQLStatementWhereDisallowFunctionsAndCalculations, nil
- }
- case SchemaRuleStatementQueryMinumumPlanLevel:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementQueryMinumumPlanLevel, nil
- }
- case SchemaRuleStatementWhereMaximumLogicalOperatorCount:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementWhereMaximumLogicalOperatorCount, nil
- }
- case SchemaRuleStatementMaximumLimitValue:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE, storepb.Engine_TIDB:
- return MySQLStatementMaximumLimitValue, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLStatementMaximumLimitValue, nil
- default:
- }
- case SchemaRuleStatementMaximumJoinTableCount:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementMaximumJoinTableCount, nil
- }
- case SchemaRuleStatementMaximumStatementsInTransaction:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementMaximumStatementsInTransaction, nil
- }
- case SchemaRuleStatementJoinStrictColumnAttrs:
- if engine == storepb.Engine_MYSQL {
- return MySQLStatementJoinStrictColumnAttrs, nil
- }
- case SchemaRuleStatementDisallowCrossDBQueries:
- if engine == storepb.Engine_MSSQL {
- return MSSQLStatementDisallowCrossDBQueries, nil
- }
- case SchemaRuleStatementMaxExecutionTime:
- if engine == storepb.Engine_MYSQL || engine == storepb.Engine_MARIADB {
- return MySQLStatementMaxExecutionTime, nil
- }
- case SchemaRuleStatementRequireAlgorithmOption:
- if engine == storepb.Engine_MYSQL || engine == storepb.Engine_MARIADB {
- return MySQLStatementRequireAlgorithmOption, nil
- }
- case SchemaRuleStatementRequireLockOption:
- if engine == storepb.Engine_MYSQL || engine == storepb.Engine_MARIADB {
- return MySQLStatementRequireLockOption, nil
- }
- case SchemaRuleStatementObjectOwnerCheck:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLStatementObjectOwnerCheck, nil
- }
- case SchemaRuleCommentLength:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLCommentConvention, nil
- }
- case SchemaRuleProcedureDisallowCreate:
- if engine == storepb.Engine_MYSQL {
- return MySQLProcedureDisallowCreate, nil
- }
- if engine == storepb.Engine_MSSQL {
- return MSSQLProcedureDisallowCreateOrAlter, nil
- }
- case SchemaRuleEventDisallowCreate:
- if engine == storepb.Engine_MYSQL {
- return MySQLEventDisallowCreate, nil
- }
- case SchemaRuleViewDisallowCreate:
- if engine == storepb.Engine_MYSQL {
- return MySQLViewDisallowCreate, nil
- }
- case SchemaRuleFunctionDisallowCreate:
- if engine == storepb.Engine_MYSQL {
- return MySQLFunctionDisallowCreate, nil
- }
- if engine == storepb.Engine_MSSQL {
- return MSSQLFunctionDisallowCreateOrAlter, nil
- }
- case SchemaRuleFunctionDisallowList:
- if engine == storepb.Engine_MYSQL {
- return MySQLFunctionDisallowedList, nil
- }
- case SchemaRuleOnlineMigration:
- if engine == storepb.Engine_MYSQL || engine == storepb.Engine_MARIADB {
- return MySQLOnlineMigration, nil
- }
- case SchemaRuleStatementNonTransactional:
- if engine == storepb.Engine_POSTGRES {
- return PostgreSQLNonTransactional, nil
- }
- case SchemaRuleStatementDisallowOfflineDDL:
- if engine == storepb.Engine_OCEANBASE {
- return MySQLDisallowOfflineDDL, nil
- }
- // ----------------- Builtin Rules -----------------------
- case BuiltinRulePriorBackupCheck:
- switch engine {
- case storepb.Engine_MYSQL, storepb.Engine_TIDB:
- return MySQLBuiltinPriorBackupCheck, nil
- case storepb.Engine_POSTGRES:
- return PostgreSQLBuiltinPriorBackupCheck, nil
- case storepb.Engine_MSSQL:
- return MSSQLBuiltinPriorBackupCheck, nil
- case storepb.Engine_ORACLE:
- return OracleBuiltinPriorBackupCheck, nil
- default:
- // Unsupported engine for this rule
- }
- default:
- // Unknown rule type
- }
- return "", errors.Errorf("unknown SQL review rule type %v for %v", ruleType, engine)
-}
diff --git a/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.go b/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.go
index b298e16d78..630a304f36 100644
--- a/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.go
+++ b/backend/plugin/advisor/tidb/advisor_builtin_prior_backup_check.go
@@ -25,7 +25,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLBuiltinPriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.BuiltinRulePriorBackupCheck, &StatementPriorBackupCheckAdvisor{})
}
// StatementPriorBackupCheckAdvisor is the advisor checking for no mixed DDL and DML.
diff --git a/backend/plugin/advisor/tidb/advisor_charset_allowlist.go b/backend/plugin/advisor/tidb/advisor_charset_allowlist.go
index fba6251d5e..a7ed39e5c2 100644
--- a/backend/plugin/advisor/tidb/advisor_charset_allowlist.go
+++ b/backend/plugin/advisor/tidb/advisor_charset_allowlist.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLCharsetAllowlist, &CharsetAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleCharsetAllowlist, &CharsetAllowlistAdvisor{})
}
// CharsetAllowlistAdvisor is the advisor checking for charset allowlist.
diff --git a/backend/plugin/advisor/tidb/advisor_collation_allowlist.go b/backend/plugin/advisor/tidb/advisor_collation_allowlist.go
index b32b37f722..ab6640d9e0 100644
--- a/backend/plugin/advisor/tidb/advisor_collation_allowlist.go
+++ b/backend/plugin/advisor/tidb/advisor_collation_allowlist.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLCollationAllowlist, &CollationAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleCollationAllowlist, &CollationAllowlistAdvisor{})
}
// CollationAllowlistAdvisor is the advisor checking for collation allowlist.
diff --git a/backend/plugin/advisor/tidb/advisor_column_auto_increment_initial_value.go b/backend/plugin/advisor/tidb/advisor_column_auto_increment_initial_value.go
index 1597a5f92f..dc2623b30d 100644
--- a/backend/plugin/advisor/tidb/advisor_column_auto_increment_initial_value.go
+++ b/backend/plugin/advisor/tidb/advisor_column_auto_increment_initial_value.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLAutoIncrementColumnInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnAutoIncrementInitialValue, &ColumnAutoIncrementInitialValueAdvisor{})
}
// ColumnAutoIncrementInitialValueAdvisor is the advisor checking for auto-increment column initial value.
diff --git a/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_integer.go b/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_integer.go
index 5c3f2b1a6e..82b0343227 100644
--- a/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_integer.go
+++ b/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_integer.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLAutoIncrementColumnMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnAutoIncrementMustInteger, &ColumnAutoIncrementMustIntegerAdvisor{})
}
// ColumnAutoIncrementMustIntegerAdvisor is the advisor checking for auto-increment column type.
diff --git a/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_unsigned.go b/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_unsigned.go
index 5958f9de70..31c3f9ab7f 100644
--- a/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_unsigned.go
+++ b/backend/plugin/advisor/tidb/advisor_column_auto_increment_must_unsigned.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLAutoIncrementColumnMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnAutoIncrementMustUnsigned, &ColumnAutoIncrementMustUnsignedAdvisor{})
}
// ColumnAutoIncrementMustUnsignedAdvisor is the advisor checking for unsigned auto-increment column.
diff --git a/backend/plugin/advisor/tidb/advisor_column_comment_convention.go b/backend/plugin/advisor/tidb/advisor_column_comment_convention.go
index 42de348ba1..d09fe9bafc 100644
--- a/backend/plugin/advisor/tidb/advisor_column_comment_convention.go
+++ b/backend/plugin/advisor/tidb/advisor_column_comment_convention.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnCommentConvention, &ColumnCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnCommentConvention, &ColumnCommentConventionAdvisor{})
}
// ColumnCommentConventionAdvisor is the advisor checking for column comment convention.
diff --git a/backend/plugin/advisor/tidb/advisor_column_current_time_count_limit.go b/backend/plugin/advisor/tidb/advisor_column_current_time_count_limit.go
index c00e5699dc..af40b53b14 100644
--- a/backend/plugin/advisor/tidb/advisor_column_current_time_count_limit.go
+++ b/backend/plugin/advisor/tidb/advisor_column_current_time_count_limit.go
@@ -28,7 +28,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleCurrentTimeColumnCountLimit, &ColumnCurrentTimeCountLimitAdvisor{})
}
// ColumnCurrentTimeCountLimitAdvisor is the advisor checking for current time column count limit.
diff --git a/backend/plugin/advisor/tidb/advisor_column_disallow_changing.go b/backend/plugin/advisor/tidb/advisor_column_disallow_changing.go
index 0b20869043..96ca35f425 100644
--- a/backend/plugin/advisor/tidb/advisor_column_disallow_changing.go
+++ b/backend/plugin/advisor/tidb/advisor_column_disallow_changing.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnDisallowChanging, &ColumnDisallowChangingAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnDisallowChange, &ColumnDisallowChangingAdvisor{})
}
// ColumnDisallowChangingAdvisor is the advisor checking for disallow CHANGE COLUMN statement.
diff --git a/backend/plugin/advisor/tidb/advisor_column_disallow_changing_order.go b/backend/plugin/advisor/tidb/advisor_column_disallow_changing_order.go
index ca3f822a01..fa601d3326 100644
--- a/backend/plugin/advisor/tidb/advisor_column_disallow_changing_order.go
+++ b/backend/plugin/advisor/tidb/advisor_column_disallow_changing_order.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnDisallowChangingOrder, &ColumnDisallowChangingOrderAdvisor{})
}
// ColumnDisallowChangingOrderAdvisor is the advisor checking for disallow changing column order.
diff --git a/backend/plugin/advisor/tidb/advisor_column_disallow_changing_type.go b/backend/plugin/advisor/tidb/advisor_column_disallow_changing_type.go
index 8291abc6a6..9674dd8cd0 100644
--- a/backend/plugin/advisor/tidb/advisor_column_disallow_changing_type.go
+++ b/backend/plugin/advisor/tidb/advisor_column_disallow_changing_type.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnDisallowChangingType, &ColumnDisallowChangingTypeAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnDisallowChangeType, &ColumnDisallowChangingTypeAdvisor{})
}
// ColumnDisallowChangingTypeAdvisor is the advisor checking for disallow changing column type..
diff --git a/backend/plugin/advisor/tidb/advisor_column_disallow_drop_in_index.go b/backend/plugin/advisor/tidb/advisor_column_disallow_drop_in_index.go
index bc12195dc4..6b37cdb226 100644
--- a/backend/plugin/advisor/tidb/advisor_column_disallow_drop_in_index.go
+++ b/backend/plugin/advisor/tidb/advisor_column_disallow_drop_in_index.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnDisallowDropInIndex, &ColumnDisallowDropInIndexAdvisor{})
}
// ColumnDisallowDropInIndexAdvisor is the advisor checking for disallow DROP COLUMN in index.
diff --git a/backend/plugin/advisor/tidb/advisor_column_disallow_set_charset.go b/backend/plugin/advisor/tidb/advisor_column_disallow_set_charset.go
index c9e705fec5..1dc71b5ab1 100644
--- a/backend/plugin/advisor/tidb/advisor_column_disallow_set_charset.go
+++ b/backend/plugin/advisor/tidb/advisor_column_disallow_set_charset.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLDisallowSetColumnCharset, &ColumnDisallowSetCharsetAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnDisallowSetCharset, &ColumnDisallowSetCharsetAdvisor{})
}
// ColumnDisallowSetCharsetAdvisor is the advisor checking for disallow set column charset.
diff --git a/backend/plugin/advisor/tidb/advisor_column_maximum_character_length.go b/backend/plugin/advisor/tidb/advisor_column_maximum_character_length.go
index d846cd03fa..f7727a1baf 100644
--- a/backend/plugin/advisor/tidb/advisor_column_maximum_character_length.go
+++ b/backend/plugin/advisor/tidb/advisor_column_maximum_character_length.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnMaximumCharacterLength, &ColumnMaximumCharacterLengthAdvisor{})
}
// ColumnMaximumCharacterLengthAdvisor is the advisor checking for max character length.
diff --git a/backend/plugin/advisor/tidb/advisor_column_no_null.go b/backend/plugin/advisor/tidb/advisor_column_no_null.go
index f78a1c80ea..3c9b73f538 100644
--- a/backend/plugin/advisor/tidb/advisor_column_no_null.go
+++ b/backend/plugin/advisor/tidb/advisor_column_no_null.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnNoNull, &ColumnNoNullAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnNotNull, &ColumnNoNullAdvisor{})
}
// ColumnNoNullAdvisor is the advisor checking for column no NULL value.
diff --git a/backend/plugin/advisor/tidb/advisor_column_require_default.go b/backend/plugin/advisor/tidb/advisor_column_require_default.go
index 012c71ffec..5b3a28340d 100644
--- a/backend/plugin/advisor/tidb/advisor_column_require_default.go
+++ b/backend/plugin/advisor/tidb/advisor_column_require_default.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLRequireColumnDefault, &ColumRequireDefaultAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnRequireDefault, &ColumRequireDefaultAdvisor{})
}
// ColumRequireDefaultAdvisor is the advisor checking for column default requirement.
diff --git a/backend/plugin/advisor/tidb/advisor_column_required.go b/backend/plugin/advisor/tidb/advisor_column_required.go
index 18c78b8826..1fda240c00 100644
--- a/backend/plugin/advisor/tidb/advisor_column_required.go
+++ b/backend/plugin/advisor/tidb/advisor_column_required.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnRequirement, &ColumnRequirementAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleRequiredColumn, &ColumnRequirementAdvisor{})
}
// ColumnRequirementAdvisor is the advisor checking for column requirement.
diff --git a/backend/plugin/advisor/tidb/advisor_column_set_default_for_not_null.go b/backend/plugin/advisor/tidb/advisor_column_set_default_for_not_null.go
index 384e799b07..90273c8687 100644
--- a/backend/plugin/advisor/tidb/advisor_column_set_default_for_not_null.go
+++ b/backend/plugin/advisor/tidb/advisor_column_set_default_for_not_null.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnSetDefaultForNotNull, &ColumnSetDefaultForNotNullAdvisor{})
}
// ColumnSetDefaultForNotNullAdvisor is the advisor checking for set default value for not null column.
diff --git a/backend/plugin/advisor/tidb/advisor_column_type_disallow_list.go b/backend/plugin/advisor/tidb/advisor_column_type_disallow_list.go
index 89b854ef44..7f879c3cb1 100644
--- a/backend/plugin/advisor/tidb/advisor_column_type_disallow_list.go
+++ b/backend/plugin/advisor/tidb/advisor_column_type_disallow_list.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnTypeDisallowList, &ColumnTypeDisallowListAdvisor{})
}
// ColumnTypeDisallowListAdvisor is the advisor checking for column type restriction.
diff --git a/backend/plugin/advisor/tidb/advisor_database_drop_empty_db.go b/backend/plugin/advisor/tidb/advisor_database_drop_empty_db.go
index 08a039bf04..4d1f694b80 100644
--- a/backend/plugin/advisor/tidb/advisor_database_drop_empty_db.go
+++ b/backend/plugin/advisor/tidb/advisor_database_drop_empty_db.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLDatabaseAllowDropIfEmpty, &DatabaseAllowDropIfEmptyAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleDropEmptyDatabase, &DatabaseAllowDropIfEmptyAdvisor{})
}
// DatabaseAllowDropIfEmptyAdvisor is the advisor checking the MySQLDatabaseAllowDropIfEmpty rule.
diff --git a/backend/plugin/advisor/tidb/advisor_index_key_number_limit.go b/backend/plugin/advisor/tidb/advisor_index_key_number_limit.go
index 3bbc8114f2..82c9608a66 100644
--- a/backend/plugin/advisor/tidb/advisor_index_key_number_limit.go
+++ b/backend/plugin/advisor/tidb/advisor_index_key_number_limit.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleIndexKeyNumberLimit, &IndexKeyNumberLimitAdvisor{})
}
// IndexKeyNumberLimitAdvisor is the advisor checking for index key number limit.
diff --git a/backend/plugin/advisor/tidb/advisor_index_no_duplicate_column.go b/backend/plugin/advisor/tidb/advisor_index_no_duplicate_column.go
index 682d5d5655..14f781e7e8 100644
--- a/backend/plugin/advisor/tidb/advisor_index_no_duplicate_column.go
+++ b/backend/plugin/advisor/tidb/advisor_index_no_duplicate_column.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleIndexNoDuplicateColumn, &IndexNoDuplicateColumnAdvisor{})
}
// IndexNoDuplicateColumnAdvisor is the advisor checking for no duplicate columns in index.
diff --git a/backend/plugin/advisor/tidb/advisor_index_pk_type.go b/backend/plugin/advisor/tidb/advisor_index_pk_type.go
index 486d94608a..3a5e1fc259 100644
--- a/backend/plugin/advisor/tidb/advisor_index_pk_type.go
+++ b/backend/plugin/advisor/tidb/advisor_index_pk_type.go
@@ -23,7 +23,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLIndexPKType, &IndexPkTypeAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleIndexPKTypeLimit, &IndexPkTypeAdvisor{})
}
// IndexPkTypeAdvisor is the advisor checking for correct type of PK.
diff --git a/backend/plugin/advisor/tidb/advisor_index_primary_key_type_allowlist.go b/backend/plugin/advisor/tidb/advisor_index_primary_key_type_allowlist.go
index 255724e888..e273584f96 100644
--- a/backend/plugin/advisor/tidb/advisor_index_primary_key_type_allowlist.go
+++ b/backend/plugin/advisor/tidb/advisor_index_primary_key_type_allowlist.go
@@ -23,7 +23,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleIndexPrimaryKeyTypeAllowlist, &IndexPrimaryKeyTypeAllowlistAdvisor{})
}
// IndexPrimaryKeyTypeAllowlistAdvisor is the advisor checking for primary key type allowlist.
diff --git a/backend/plugin/advisor/tidb/advisor_index_total_number_limit.go b/backend/plugin/advisor/tidb/advisor_index_total_number_limit.go
index afdb269a86..3b48796d09 100644
--- a/backend/plugin/advisor/tidb/advisor_index_total_number_limit.go
+++ b/backend/plugin/advisor/tidb/advisor_index_total_number_limit.go
@@ -22,7 +22,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleIndexTotalNumberLimit, &IndexTotalNumberLimitAdvisor{})
}
// IndexTotalNumberLimitAdvisor is the advisor checking for index total number limit.
diff --git a/backend/plugin/advisor/tidb/advisor_index_type_no_blob.go b/backend/plugin/advisor/tidb/advisor_index_type_no_blob.go
index c31bf6933d..21965b4441 100644
--- a/backend/plugin/advisor/tidb/advisor_index_type_no_blob.go
+++ b/backend/plugin/advisor/tidb/advisor_index_type_no_blob.go
@@ -24,7 +24,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleIndexTypeNoBlob, &IndexTypeNoBlobAdvisor{})
}
// IndexTypeNoBlobAdvisor is the advisor checking for index type no blob.
diff --git a/backend/plugin/advisor/tidb/advisor_insert_disallow_order_by_rand.go b/backend/plugin/advisor/tidb/advisor_insert_disallow_order_by_rand.go
index 10488682d9..5f278dfa73 100644
--- a/backend/plugin/advisor/tidb/advisor_insert_disallow_order_by_rand.go
+++ b/backend/plugin/advisor/tidb/advisor_insert_disallow_order_by_rand.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementInsertDisallowOrderByRand, &InsertDisallowOrderByRandAdvisor{})
}
// InsertDisallowOrderByRandAdvisor is the advisor checking for to disallow order by rand in INSERT statements.
diff --git a/backend/plugin/advisor/tidb/advisor_insert_must_specify_column.go b/backend/plugin/advisor/tidb/advisor_insert_must_specify_column.go
index 1daa4d4836..e10d4414c1 100644
--- a/backend/plugin/advisor/tidb/advisor_insert_must_specify_column.go
+++ b/backend/plugin/advisor/tidb/advisor_insert_must_specify_column.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementInsertMustSpecifyColumn, &InsertMustSpecifyColumnAdvisor{})
}
// InsertMustSpecifyColumnAdvisor is the advisor checking for to enforce column specified.
diff --git a/backend/plugin/advisor/tidb/advisor_migration_compatibility.go b/backend/plugin/advisor/tidb/advisor_migration_compatibility.go
index 19a5ee9fb8..66d9470f21 100644
--- a/backend/plugin/advisor/tidb/advisor_migration_compatibility.go
+++ b/backend/plugin/advisor/tidb/advisor_migration_compatibility.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLMigrationCompatibility, &CompatibilityAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleSchemaBackwardCompatibility, &CompatibilityAdvisor{})
}
// CompatibilityAdvisor is the advisor checking for schema backward compatibility.
diff --git a/backend/plugin/advisor/tidb/advisor_naming_auto_increment_column.go b/backend/plugin/advisor/tidb/advisor_naming_auto_increment_column.go
index 878559cf58..0e3a402dfe 100644
--- a/backend/plugin/advisor/tidb/advisor_naming_auto_increment_column.go
+++ b/backend/plugin/advisor/tidb/advisor_naming_auto_increment_column.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNamingAutoIncrementColumnConvention, &NamingAutoIncrementColumnAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleAutoIncrementColumnNaming, &NamingAutoIncrementColumnAdvisor{})
}
// NamingAutoIncrementColumnAdvisor is the advisor checking for auto-increment naming convention.
diff --git a/backend/plugin/advisor/tidb/advisor_naming_column.go b/backend/plugin/advisor/tidb/advisor_naming_column.go
index 9716174e15..6373ee86c9 100644
--- a/backend/plugin/advisor/tidb/advisor_naming_column.go
+++ b/backend/plugin/advisor/tidb/advisor_naming_column.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNamingColumnConvention, &NamingColumnConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleColumnNaming, &NamingColumnConventionAdvisor{})
}
// NamingColumnConventionAdvisor is the advisor checking for column naming convention.
diff --git a/backend/plugin/advisor/tidb/advisor_naming_foreign_key_convention.go b/backend/plugin/advisor/tidb/advisor_naming_foreign_key_convention.go
index ef65c06d7a..3861779956 100644
--- a/backend/plugin/advisor/tidb/advisor_naming_foreign_key_convention.go
+++ b/backend/plugin/advisor/tidb/advisor_naming_foreign_key_convention.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNamingFKConvention, &NamingFKConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleFKNaming, &NamingFKConventionAdvisor{})
}
// NamingFKConventionAdvisor is the advisor checking for foreign key naming convention.
diff --git a/backend/plugin/advisor/tidb/advisor_naming_index_convention.go b/backend/plugin/advisor/tidb/advisor_naming_index_convention.go
index bf07af0378..5258981d71 100644
--- a/backend/plugin/advisor/tidb/advisor_naming_index_convention.go
+++ b/backend/plugin/advisor/tidb/advisor_naming_index_convention.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNamingIndexConvention, &NamingIndexConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleIDXNaming, &NamingIndexConventionAdvisor{})
}
// NamingIndexConventionAdvisor is the advisor checking for index naming convention.
diff --git a/backend/plugin/advisor/tidb/advisor_naming_table.go b/backend/plugin/advisor/tidb/advisor_naming_table.go
index 15bc9d69da..8f260134f3 100644
--- a/backend/plugin/advisor/tidb/advisor_naming_table.go
+++ b/backend/plugin/advisor/tidb/advisor_naming_table.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNamingTableConvention, &NamingTableConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleTableNaming, &NamingTableConventionAdvisor{})
}
// NamingTableConventionAdvisor is the advisor checking for table naming convention.
diff --git a/backend/plugin/advisor/tidb/advisor_naming_unique_key_convention.go b/backend/plugin/advisor/tidb/advisor_naming_unique_key_convention.go
index b66703e6b8..bf09d429f2 100644
--- a/backend/plugin/advisor/tidb/advisor_naming_unique_key_convention.go
+++ b/backend/plugin/advisor/tidb/advisor_naming_unique_key_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNamingUKConvention, &NamingUKConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleUKNaming, &NamingUKConventionAdvisor{})
}
// NamingUKConventionAdvisor is the advisor checking for unique key naming convention.
diff --git a/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_ddl.go b/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_ddl.go
index 318b1436a6..c37e103f4e 100644
--- a/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_ddl.go
+++ b/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_ddl.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementDisallowMixInDDL, &StatementDisallowMixInDDLAdvisor{})
}
// StatementDisallowMixInDDLAdvisor is the advisor checking for no mixed DDL and DML.
diff --git a/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_dml.go b/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_dml.go
index d2331ec912..6d6b466cbb 100644
--- a/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_dml.go
+++ b/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_in_dml.go
@@ -17,7 +17,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementDisallowMixInDML, &StatementDisallowMixInDMLAdvisor{})
}
// StatementDisallowMixInDMLAdvisor is the advisor checking for no mixed DDL and DML.
diff --git a/backend/plugin/advisor/tidb/advisor_statement_dml_dry_run.go b/backend/plugin/advisor/tidb/advisor_statement_dml_dry_run.go
index 509e1bf594..a2b979dc4d 100644
--- a/backend/plugin/advisor/tidb/advisor_statement_dml_dry_run.go
+++ b/backend/plugin/advisor/tidb/advisor_statement_dml_dry_run.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementDMLDryRun, &StatementDmlDryRunAdvisor{})
}
// StatementDmlDryRunAdvisor is the advisor checking for DML dry run.
diff --git a/backend/plugin/advisor/tidb/advisor_statement_maximum_limit_value.go b/backend/plugin/advisor/tidb/advisor_statement_maximum_limit_value.go
index 9957c6c036..ef1c8382d4 100644
--- a/backend/plugin/advisor/tidb/advisor_statement_maximum_limit_value.go
+++ b/backend/plugin/advisor/tidb/advisor_statement_maximum_limit_value.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementMaximumLimitValue, &StatementMaximumLimitValueAdvisor{})
}
// StatementMaximumLimitValueAdvisor is the advisor checking for LIMIT maximum value.
diff --git a/backend/plugin/advisor/tidb/advisor_statement_merge_alter_table.go b/backend/plugin/advisor/tidb/advisor_statement_merge_alter_table.go
index 862a5ff632..3a6488fa54 100644
--- a/backend/plugin/advisor/tidb/advisor_statement_merge_alter_table.go
+++ b/backend/plugin/advisor/tidb/advisor_statement_merge_alter_table.go
@@ -21,7 +21,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLMergeAlterTable, &StatementMergeAlterTableAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementMergeAlterTable, &StatementMergeAlterTableAdvisor{})
}
// StatementMergeAlterTableAdvisor is the advisor checking for merging ALTER TABLE statements.
diff --git a/backend/plugin/advisor/tidb/advisor_stmt_disallow_commit.go b/backend/plugin/advisor/tidb/advisor_stmt_disallow_commit.go
index 35788f5ffe..84db9ddbf0 100644
--- a/backend/plugin/advisor/tidb/advisor_stmt_disallow_commit.go
+++ b/backend/plugin/advisor/tidb/advisor_stmt_disallow_commit.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementDisallowCommit, &StatementDisallowCommitAdvisor{})
}
// StatementDisallowCommitAdvisor is the advisor checking for index type no blob.
diff --git a/backend/plugin/advisor/tidb/advisor_stmt_disallow_limit.go b/backend/plugin/advisor/tidb/advisor_stmt_disallow_limit.go
index fc63ac19ec..5e293602a8 100644
--- a/backend/plugin/advisor/tidb/advisor_stmt_disallow_limit.go
+++ b/backend/plugin/advisor/tidb/advisor_stmt_disallow_limit.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementDisallowLimit, &StatementDisallowLimitAdvisor{})
}
// StatementDisallowLimitAdvisor is the advisor checking for no LIMIT clause in INSERT/UPDATE statement.
diff --git a/backend/plugin/advisor/tidb/advisor_stmt_disallow_order_by.go b/backend/plugin/advisor/tidb/advisor_stmt_disallow_order_by.go
index 3bd4cbf549..d923c17f23 100644
--- a/backend/plugin/advisor/tidb/advisor_stmt_disallow_order_by.go
+++ b/backend/plugin/advisor/tidb/advisor_stmt_disallow_order_by.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLDisallowOrderBy, &DisallowOrderByAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementDisallowOrderBy, &DisallowOrderByAdvisor{})
}
// DisallowOrderByAdvisor is the advisor checking for no ORDER BY clause in DELETE/UPDATE statements.
diff --git a/backend/plugin/advisor/tidb/advisor_stmt_no_leading_wildcard_like.go b/backend/plugin/advisor/tidb/advisor_stmt_no_leading_wildcard_like.go
index c46f080d2d..7ba5117d58 100644
--- a/backend/plugin/advisor/tidb/advisor_stmt_no_leading_wildcard_like.go
+++ b/backend/plugin/advisor/tidb/advisor_stmt_no_leading_wildcard_like.go
@@ -23,7 +23,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementNoLeadingWildcardLike, &NoLeadingWildcardLikeAdvisor{})
}
// NoLeadingWildcardLikeAdvisor is the advisor checking for no leading wildcard LIKE.
diff --git a/backend/plugin/advisor/tidb/advisor_stmt_no_select_all.go b/backend/plugin/advisor/tidb/advisor_stmt_no_select_all.go
index 59e14d21d2..8edd7ee630 100644
--- a/backend/plugin/advisor/tidb/advisor_stmt_no_select_all.go
+++ b/backend/plugin/advisor/tidb/advisor_stmt_no_select_all.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLNoSelectAll, &NoSelectAllAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementNoSelectAll, &NoSelectAllAdvisor{})
}
// NoSelectAllAdvisor is the advisor checking for no "select *".
diff --git a/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_select.go b/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_select.go
index 921fd254ac..44b58cdaa0 100644
--- a/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_select.go
+++ b/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_select.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLWhereRequirementForSelect, &WhereRequirementForSelectAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementRequireWhereForSelect, &WhereRequirementForSelectAdvisor{})
}
// WhereRequirementForSelectAdvisor is the advisor checking for the WHERE clause requirement for SELECT statements.
diff --git a/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_update_delete.go b/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_update_delete.go
index 8822e3c308..847d3d639f 100644
--- a/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_update_delete.go
+++ b/backend/plugin/advisor/tidb/advisor_stmt_where_required_for_update_delete.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLWhereRequirementForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleStatementRequireWhereForUpdateDelete, &WhereRequirementForUpdateDeleteAdvisor{})
}
// WhereRequirementForUpdateDeleteAdvisor is the advisor checking for the WHERE clause requirement for UPDATE and DELETE statements.
diff --git a/backend/plugin/advisor/tidb/advisor_table_comment_convention.go b/backend/plugin/advisor/tidb/advisor_table_comment_convention.go
index d7c76da48d..f85f720d60 100644
--- a/backend/plugin/advisor/tidb/advisor_table_comment_convention.go
+++ b/backend/plugin/advisor/tidb/advisor_table_comment_convention.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLTableCommentConvention, &TableCommentConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleTableCommentConvention, &TableCommentConventionAdvisor{})
}
// TableCommentConventionAdvisor is the advisor checking for table comment convention.
diff --git a/backend/plugin/advisor/tidb/advisor_table_disallow_partition.go b/backend/plugin/advisor/tidb/advisor_table_disallow_partition.go
index 92f8f5409d..74a6c36209 100644
--- a/backend/plugin/advisor/tidb/advisor_table_disallow_partition.go
+++ b/backend/plugin/advisor/tidb/advisor_table_disallow_partition.go
@@ -20,7 +20,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLTableDisallowPartition, &TableDisallowPartitionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleTableDisallowPartition, &TableDisallowPartitionAdvisor{})
}
// TableDisallowPartitionAdvisor is the advisor checking for disallow table partition.
diff --git a/backend/plugin/advisor/tidb/advisor_table_drop_naming_convention.go b/backend/plugin/advisor/tidb/advisor_table_drop_naming_convention.go
index 41d3321d47..f25a87aca9 100644
--- a/backend/plugin/advisor/tidb/advisor_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/tidb/advisor_table_drop_naming_convention.go
@@ -19,7 +19,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleTableDropNamingConvention, &TableDropNamingConventionAdvisor{})
}
// TableDropNamingConventionAdvisor is the advisor checking the MySQLTableDropNamingConvention rule.
diff --git a/backend/plugin/advisor/tidb/advisor_table_no_fk.go b/backend/plugin/advisor/tidb/advisor_table_no_fk.go
index 7f13d072ab..75e953bf59 100644
--- a/backend/plugin/advisor/tidb/advisor_table_no_fk.go
+++ b/backend/plugin/advisor/tidb/advisor_table_no_fk.go
@@ -18,7 +18,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLTableNoFK, &TableNoFKAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleTableNoFK, &TableNoFKAdvisor{})
}
// TableNoFKAdvisor is the advisor checking table disallow foreign key.
diff --git a/backend/plugin/advisor/tidb/advisor_table_require_pk.go b/backend/plugin/advisor/tidb/advisor_table_require_pk.go
index 8e0ac77afe..13cbb05558 100644
--- a/backend/plugin/advisor/tidb/advisor_table_require_pk.go
+++ b/backend/plugin/advisor/tidb/advisor_table_require_pk.go
@@ -24,7 +24,7 @@ var (
)
func init() {
- advisor.Register(storepb.Engine_TIDB, advisor.MySQLTableRequirePK, &TableRequirePKAdvisor{})
+ advisor.Register(storepb.Engine_TIDB, advisor.SchemaRuleTableRequirePK, &TableRequirePKAdvisor{})
}
// TableRequirePKAdvisor is the advisor checking table requires PK.
diff --git a/backend/plugin/advisor/utils_for_tests.go b/backend/plugin/advisor/utils_for_tests.go
index d1d833ea8f..ef1aa69063 100644
--- a/backend/plugin/advisor/utils_for_tests.go
+++ b/backend/plugin/advisor/utils_for_tests.go
@@ -388,7 +388,7 @@ func SetDefaultSQLReviewRulePayload(ruleTp SQLReviewRuleType, dbType storepb.Eng
SchemaRuleFunctionDisallowCreate,
SchemaRuleStatementCreateSpecifySchema,
SchemaRuleStatementCheckSetRoleVariable,
- SchemaRuleStatementWhereDisallowFunctionsAndCaculations,
+ SchemaRuleStatementWhereDisallowFunctionsAndCalculations,
SchemaRuleStatementDisallowMixInDDL,
SchemaRuleStatementDisallowMixInDML,
SchemaRuleStatementPriorBackupCheck,
diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.go
index 37e606477d..98015772b6 100644
--- a/backend/tests/sql_review_test.go
+++ b/backend/tests/sql_review_test.go
@@ -517,7 +517,7 @@ func createIssueAndReturnSQLReviewResult(ctx context.Context, a *require.Asserti
}
func equalReviewResultProtos(a *require.Assertions, want, got []*v1pb.PlanCheckRun_Result, message string) {
- a.Equal(len(want), len(got))
+ a.Equal(len(want), len(got), message)
for i := 0; i < len(want); i++ {
diff := cmp.Diff(want[i], got[i], protocmp.Transform())
a.Empty(diff, message)
@@ -587,11 +587,6 @@ func prodTemplateReviewConfigForPostgreSQL() (*v1pb.ReviewConfig, error) {
Level: v1pb.SQLReviewRuleLevel_ERROR,
Engine: v1pb.Engine_POSTGRES,
},
- {
- Type: string(advisor.SchemaRuleStatementDisallowOrderBy),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
{
Type: string(advisor.SchemaRuleStatementMergeAlterTable),
Level: v1pb.SQLReviewRuleLevel_WARNING,
@@ -644,63 +639,22 @@ func prodTemplateReviewConfigForPostgreSQL() (*v1pb.ReviewConfig, error) {
Level: v1pb.SQLReviewRuleLevel_WARNING,
Engine: v1pb.Engine_POSTGRES,
},
- {
- Type: string(advisor.SchemaRuleColumnDisallowChange),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
- {
- Type: string(advisor.SchemaRuleColumnDisallowChangingOrder),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
- {
- Type: string(advisor.SchemaRuleColumnAutoIncrementMustInteger),
- Level: v1pb.SQLReviewRuleLevel_ERROR,
- Engine: v1pb.Engine_POSTGRES,
- },
{
Type: string(advisor.SchemaRuleColumnTypeDisallowList),
Level: v1pb.SQLReviewRuleLevel_ERROR,
Engine: v1pb.Engine_POSTGRES,
},
- {
- Type: string(advisor.SchemaRuleColumnDisallowSetCharset),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
{
Type: string(advisor.SchemaRuleColumnMaximumCharacterLength),
Level: v1pb.SQLReviewRuleLevel_WARNING,
Engine: v1pb.Engine_POSTGRES,
},
- {
- Type: string(advisor.SchemaRuleColumnAutoIncrementInitialValue),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
- {
- Type: string(advisor.SchemaRuleColumnAutoIncrementMustUnsigned),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
- {
- Type: string(advisor.SchemaRuleCurrentTimeColumnCountLimit),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
// SCHEMA
{
Type: string(advisor.SchemaRuleSchemaBackwardCompatibility),
Level: v1pb.SQLReviewRuleLevel_WARNING,
Engine: v1pb.Engine_POSTGRES,
},
- // DATABASE
- {
- Type: string(advisor.SchemaRuleDropEmptyDatabase),
- Level: v1pb.SQLReviewRuleLevel_ERROR,
- Engine: v1pb.Engine_POSTGRES,
- },
// INDEX
{
Type: string(advisor.SchemaRuleIndexNoDuplicateColumn),
@@ -712,16 +666,6 @@ func prodTemplateReviewConfigForPostgreSQL() (*v1pb.ReviewConfig, error) {
Level: v1pb.SQLReviewRuleLevel_WARNING,
Engine: v1pb.Engine_POSTGRES,
},
- {
- Type: string(advisor.SchemaRuleIndexPKTypeLimit),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
- {
- Type: string(advisor.SchemaRuleIndexTypeNoBlob),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_POSTGRES,
- },
{
Type: string(advisor.SchemaRuleIndexTotalNumberLimit),
Level: v1pb.SQLReviewRuleLevel_WARNING,
@@ -779,11 +723,6 @@ func prodTemplateReviewConfigForMySQL() (*v1pb.ReviewConfig, error) {
Level: v1pb.SQLReviewRuleLevel_WARNING,
Engine: v1pb.Engine_MYSQL,
},
- {
- Type: string(advisor.SchemaRulePKNaming),
- Level: v1pb.SQLReviewRuleLevel_WARNING,
- Engine: v1pb.Engine_MYSQL,
- },
{
Type: string(advisor.SchemaRuleUKNaming),
Level: v1pb.SQLReviewRuleLevel_WARNING,