Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(sql-review): implement prior backup check rules (#11188)
rebelicee6769f252622
diff --git a/backend/api/v1/rollout_service_plan_check.go b/backend/api/v1/rollout_service_plan_check.goindex 4c21f5a800..419dead24b 100644--- a/backend/api/v1/rollout_service_plan_check.go+++ b/backend/api/v1/rollout_service_plan_check.go@@ -326,6 +326,12 @@ func getPlanCheckRunsFromChangeDatabaseConfigForDatabase(ctx context.Context, sDatabaseGroupUid: databaseGroupUID,},})+ preUpdateBackupDetail := (*storepb.PlanCheckRunConfig_PreUpdateBackupDetail)(nil)+ if config.PreUpdateBackupDetail != nil {+ preUpdateBackupDetail = &storepb.PlanCheckRunConfig_PreUpdateBackupDetail{+ Database: config.PreUpdateBackupDetail.Database,+ }+ }planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{CreatorUID: api.SystemBotID,UpdaterUID: api.SystemBotID,@@ -333,11 +339,12 @@ func getPlanCheckRunsFromChangeDatabaseConfigForDatabase(ctx context.Context, sStatus: store.PlanCheckRunStatusRunning,Type: store.PlanCheckDatabaseStatementAdvise,Config: &storepb.PlanCheckRunConfig{- SheetUid: int32(sheetUID),- ChangeDatabaseType: convertToChangeDatabaseType(config.Type),- InstanceUid: int32(instance.UID),- DatabaseName: database.DatabaseName,- DatabaseGroupUid: databaseGroupUID,+ SheetUid: int32(sheetUID),+ ChangeDatabaseType: convertToChangeDatabaseType(config.Type),+ InstanceUid: int32(instance.UID),+ DatabaseName: database.DatabaseName,+ DatabaseGroupUid: databaseGroupUID,+ PreUpdateBackupDetail: preUpdateBackupDetail,},})planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{diff --git a/backend/plugin/advisor/advisor.go b/backend/plugin/advisor/advisor.goindex 6a837cfcdb..56d592f061 100644--- a/backend/plugin/advisor/advisor.go+++ b/backend/plugin/advisor/advisor.go@@ -278,8 +278,8 @@ const (// MySQLStatementDisallowMixDML is an advisor type for MySQL disallow mix DML on same table.MySQLStatementDisallowMixDML Type = "bb.plugin.advisor.mysql.statement.disallow-mix-dml"- // MySQLStatementDisallowMixDDLDML is an advisor type for MySQL disallow mix DDL and DML.- MySQLStatementDisallowMixDDLDML Type = "bb.plugin.advisor.mysql.statement.disallow-mix-ddl-dml"+ // MySQLStatementPriorBackupCheck is an advisor type for MySQL prior backup check.+ MySQLStatementPriorBackupCheck Type = "bb.plugin.advisor.mysql.statement.prior-backup-check"// MySQLProcedureDisallowCreate is an advisor type for MySQL disallow create procedure.MySQLProcedureDisallowCreate Type = "bb.plugin.advisor.mysql.procedure.disallow-create"@@ -427,8 +427,8 @@ const (// PostgreSQLStatementDisallowMixDML is an advisor type for PostgreSQL disallow mix DML on same table.PostgreSQLStatementDisallowMixDML Type = "bb.plugin.advisor.postgresql.statement.disallow-mix-dml"- // PostgreSQLStatementDisallowMixDDLDML is an advisor type for PostgreSQL disallow mix DDL and DML.- PostgreSQLStatementDisallowMixDDLDML Type = "bb.plugin.advisor.postgresql.statement.disallow-mix-ddl-dml"+ // PostgreSQLStatementPriorBackupCheck is an advisor type for PostgreSQL do prior backup check.+ PostgreSQLStatementPriorBackupCheck Type = "bb.plugin.advisor.postgresql.statement.prior-backup-check"// Oracle Advisor.@@ -600,11 +600,12 @@ const (// Context is the context for advisor.type Context struct {- Charset string- Collation string- DBSchema *storepb.DatabaseSchemaMetadata- SyntaxMode SyntaxMode- ChangeType storepb.PlanCheckRunConfig_ChangeDatabaseType+ Charset string+ Collation string+ DBSchema *storepb.DatabaseSchemaMetadata+ SyntaxMode SyntaxMode+ ChangeType storepb.PlanCheckRunConfig_ChangeDatabaseType+ PreUpdateBackupDetail *storepb.PlanCheckRunConfig_PreUpdateBackupDetail// SQL review rule special fields.AST anydiff --git a/backend/plugin/advisor/code.go b/backend/plugin/advisor/code.goindex c9ff1e50d8..9caf09c0e6 100644--- a/backend/plugin/advisor/code.go+++ b/backend/plugin/advisor/code.go@@ -52,7 +52,7 @@ const (StatementWhereMaximumLogicalOperatorCount Code = 225StatementJoinColumnAttrsNotMatch Code = 226StatementDisallowMixDML Code = 227- StatementDisallowMixDDLDML Code = 228+ StatementMixDDLDML Code = 228// 301 ~ 399 naming error code// 301 table naming advisor error code.@@ -121,6 +121,7 @@ const (DatabaseNotEmpty Code = 701NotCurrentDatabase Code = 702DatabaseIsDeleted Code = 703+ DatabaseNotExists Code = 704// 801 ~ 899 index error code.NotUseIndex Code = 801diff --git a/backend/plugin/advisor/config/sql-review.dev.yaml b/backend/plugin/advisor/config/sql-review.dev.yamlindex 853523e125..35fca34cbe 100644--- a/backend/plugin/advisor/config/sql-review.dev.yaml+++ b/backend/plugin/advisor/config/sql-review.dev.yaml@@ -102,8 +102,8 @@ ruleList:level: WARNING- type: statement.disallow-mix-dmllevel: WARNING- - type: statement.disallow-mix-ddl-dml- level: WARNING+ - type: statement.prior-backup-check+ level: ERROR- type: naming.tablelevel: WARNINGpayload:diff --git a/backend/plugin/advisor/config/sql-review.prod.yaml b/backend/plugin/advisor/config/sql-review.prod.yamlindex 1d4d6a18f8..48d48d02f7 100644--- a/backend/plugin/advisor/config/sql-review.prod.yaml+++ b/backend/plugin/advisor/config/sql-review.prod.yaml@@ -102,8 +102,8 @@ ruleList:level: WARNING- type: statement.disallow-mix-dmllevel: WARNING- - type: statement.disallow-mix-ddl-dml- level: WARNING+ - type: statement.prior-backup-check+ level: ERROR- type: naming.tablelevel: WARNINGpayload:diff --git a/backend/plugin/advisor/mysql/advisor_statement_disallow_mix_ddl_dml.go b/backend/plugin/advisor/mysql/advisor_statement_disallow_mix_ddl_dml.godeleted file mode 100644index d3ed70a0d6..0000000000--- a/backend/plugin/advisor/mysql/advisor_statement_disallow_mix_ddl_dml.go+++ /dev/null@@ -1,93 +0,0 @@-package mysql--import (- "fmt"-- "github.com/antlr4-go/antlr/v4"- "github.com/pkg/errors"-- "github.com/bytebase/bytebase/backend/plugin/advisor"- mysqlparser "github.com/bytebase/bytebase/backend/plugin/parser/mysql"- storepb "github.com/bytebase/bytebase/proto/generated-go/store"-)--var (- _ advisor.Advisor = (*StatementDisallowmixDDLDMLAdvisor)(nil)-)--func init() {- advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementDisallowMixDDLDML, &StatementDisallowmixDDLDMLAdvisor{})-}--type StatementDisallowmixDDLDMLAdvisor struct {-}--func (*StatementDisallowmixDDLDMLAdvisor) Check(ctx advisor.Context, _ string) ([]advisor.Advice, error) {- stmtList, ok := ctx.AST.([]*mysqlparser.ParseResult)- if !ok {- return nil, errors.Errorf("failed to convert to mysql parse result")- }-- level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level)- if err != nil {- return nil, err- }- title := string(ctx.Rule.Type)-- var adviceList []advisor.Advice- var hasDDL, hasDML bool- for _, stmt := range stmtList {- checker := &mysqlparser.StatementTypeChecker{}- antlr.ParseTreeWalkerDefault.Walk(checker, stmt.Tree)-- switch ctx.ChangeType {- case storepb.PlanCheckRunConfig_DDL, storepb.PlanCheckRunConfig_SDL, storepb.PlanCheckRunConfig_DDL_GHOST:- if checker.IsDML {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: fmt.Sprintf("Alter schema can only run DDL, \"%s\" is not DDL", checker.Text),- Code: advisor.StatementDisallowMixDDLDML,- Line: stmt.BaseLine,- })- }- case storepb.PlanCheckRunConfig_DML:- if checker.IsDDL {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: fmt.Sprintf("Data change can only run DML, \"%s\" is not DML", checker.Text),- Code: advisor.StatementDisallowMixDDLDML,- Line: stmt.BaseLine,- })- }- }-- if checker.IsDDL {- hasDDL = true- }- if checker.IsDML {- hasDML = true- }- }-- if hasDDL && hasDML {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: "Mixing DDL with DML is not allowed",- Code: advisor.StatementDisallowMixDDLDML,- })- }-- if len(adviceList) == 0 {- adviceList = append(adviceList, advisor.Advice{- Status: advisor.Success,- Code: advisor.Ok,- Title: "OK",- Content: "",- })- }-- return adviceList, nil-}diff --git a/backend/plugin/advisor/mysql/advisor_statement_prior_backup_check.go b/backend/plugin/advisor/mysql/advisor_statement_prior_backup_check.gonew file mode 100644index 0000000000..efa51b747a--- /dev/null+++ b/backend/plugin/advisor/mysql/advisor_statement_prior_backup_check.go@@ -0,0 +1,102 @@+package mysql++import (+ "context"+ "database/sql"+ "fmt"+ "strings"++ "github.com/antlr4-go/antlr/v4"+ "github.com/pkg/errors"++ "github.com/bytebase/bytebase/backend/plugin/advisor"+ mysqlparser "github.com/bytebase/bytebase/backend/plugin/parser/mysql"+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"+)++var (+ _ advisor.Advisor = (*StatementPriorBackupCheckAdvisor)(nil)+)++func init() {+ advisor.Register(storepb.Engine_MYSQL, advisor.MySQLStatementPriorBackupCheck, &StatementPriorBackupCheckAdvisor{})+}++type StatementPriorBackupCheckAdvisor struct {+}++func (*StatementPriorBackupCheckAdvisor) Check(ctx advisor.Context, _ string) ([]advisor.Advice, error) {+ var adviceList []advisor.Advice+ if ctx.PreUpdateBackupDetail == nil || ctx.ChangeType != storepb.PlanCheckRunConfig_DML {+ adviceList = append(adviceList, advisor.Advice{+ Status: advisor.Success,+ Code: advisor.Ok,+ Title: "OK",+ Content: "",+ })+ return adviceList, nil+ }++ stmtList, ok := ctx.AST.([]*mysqlparser.ParseResult)+ if !ok {+ return nil, errors.Errorf("failed to convert to mysql parse result")+ }++ level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level)+ if err != nil {+ return nil, err+ }+ title := string(ctx.Rule.Type)++ for _, stmt := range stmtList {+ checker := &mysqlparser.StatementTypeChecker{}+ antlr.ParseTreeWalkerDefault.Walk(checker, stmt.Tree)++ if checker.IsDDL {+ adviceList = append(adviceList, advisor.Advice{+ Status: level,+ Title: title,+ Content: "Prior backup cannot deal with mixed DDL and DML statements",+ Code: advisor.StatementMixDDLDML,+ Line: stmt.BaseLine,+ })+ }+ }++ if !databaseExists(ctx.Context, ctx.Driver, extractDatabaseName(ctx.PreUpdateBackupDetail.Database)) {+ adviceList = append(adviceList, advisor.Advice{+ Status: level,+ Title: title,+ Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", ctx.PreUpdateBackupDetail.Database),+ Code: advisor.DatabaseNotExists,+ Line: 0,+ })+ }++ if len(adviceList) == 0 {+ adviceList = append(adviceList, advisor.Advice{+ Status: advisor.Success,+ Code: advisor.Ok,+ Title: "OK",+ Content: "",+ })+ }++ return adviceList, nil+}++func extractDatabaseName(databaseUID string) string {+ segments := strings.Split(databaseUID, "/")+ return segments[len(segments)-1]+}++func databaseExists(ctx context.Context, driver *sql.DB, database string) bool {+ if driver == nil {+ return false+ }+ var count int+ if err := driver.QueryRowContext(ctx, "SELECT COUNT(*) FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = ?", database).Scan(&count); err != nil {+ return false+ }+ return count > 0+}diff --git a/backend/plugin/advisor/mysql/test/statement_disallow_mix_ddl_dml.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_mix_ddl_dml.yamldeleted file mode 100644index d217fbda79..0000000000--- a/backend/plugin/advisor/mysql/test/statement_disallow_mix_ddl_dml.yaml+++ /dev/null@@ -1,28 +0,0 @@--- statement: DELETE FROM tech_book WHERE a > 1;- want:- - status: SUCCESS- code: 0- title: OK- content: ""- line: 0- column: 0- details: ""-- statement: UPDATE tech_book SET id = 1;- want:- - status: SUCCESS- code: 0- title: OK- content: ""- line: 0- column: 0- details: ""-- statement: ALTER TABLE tech_book ADD COLUMN author TEXT; UPDATE tech_book SET id = 1;DELETE FROM tech_book WHERE a > 1;- want:- - status: WARN- code: 228- title: statement.disallow-mix-ddl-dml- content: Mixing DDL with DML is not allowed- line: 0- column: 0- details: ""diff --git a/backend/plugin/advisor/pg/advisor_statement_disallow_mix_ddl_dml.go b/backend/plugin/advisor/pg/advisor_statement_disallow_mix_ddl_dml.godeleted file mode 100644index b4acd3dfc6..0000000000--- a/backend/plugin/advisor/pg/advisor_statement_disallow_mix_ddl_dml.go+++ /dev/null@@ -1,102 +0,0 @@-package pg--// Framework code is generated by the generator.--import (- "fmt"-- "github.com/pkg/errors"-- "github.com/bytebase/bytebase/backend/plugin/advisor"- "github.com/bytebase/bytebase/backend/plugin/parser/sql/ast"- storepb "github.com/bytebase/bytebase/proto/generated-go/store"-)--var (- _ advisor.Advisor = (*StatementDisallowMixDdlDmlAdvisor)(nil)-)--func init() {- advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementDisallowMixDDLDML, &StatementDisallowMixDdlDmlAdvisor{})-}--// StatementDisallowMixDdlDmlAdvisor is the advisor checking for disallow mix DDL and DML.-type StatementDisallowMixDdlDmlAdvisor struct {-}--// Check checks for disallow mix DDL and DML.-func (*StatementDisallowMixDdlDmlAdvisor) Check(ctx advisor.Context, _ string) ([]advisor.Advice, error) {- stmtList, ok := ctx.AST.([]ast.Node)- if !ok {- return nil, errors.Errorf("failed to convert to Node")- }-- level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level)- if err != nil {- return nil, err- }- title := string(ctx.Rule.Type)-- var adviceList []advisor.Advice- var hasDDL, hasDML bool- for _, stmt := range stmtList {- var isDDL, isDML bool- if _, ok := stmt.(ast.DDLNode); ok {- isDDL = true- }- if _, ok := stmt.(ast.DMLNode); ok {- isDML = true- }- switch ctx.ChangeType {- case storepb.PlanCheckRunConfig_DDL, storepb.PlanCheckRunConfig_SDL, storepb.PlanCheckRunConfig_DDL_GHOST:- if isDML {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: fmt.Sprintf("Alter schema can only run DDL, \"%s\" is not DDL", stmt.Text()),- Code: advisor.StatementDisallowMixDDLDML,- Line: stmt.LastLine(),- })- }- case storepb.PlanCheckRunConfig_DML:- if isDDL {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: fmt.Sprintf("Data change can only run DML, \"%s\" is not DML", stmt.Text()),- Code: advisor.StatementDisallowMixDDLDML,- Line: stmt.LastLine(),- })- }- }- if isDDL {- hasDDL = true- }- if isDML {- hasDML = true- }- if hasDDL && hasDML {- break- }- }-- if hasDDL && hasDML {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: "Mixing DDL with DML is not allowed",- Code: advisor.StatementDisallowMixDDLDML,- })- }-- if len(adviceList) == 0 {- adviceList = append(adviceList, advisor.Advice{- Status: advisor.Success,- Code: advisor.Ok,- Title: "OK",- Content: "",- })- }-- return adviceList, nil-}diff --git a/backend/plugin/advisor/pg/advisor_statement_prior_backup_check.go b/backend/plugin/advisor/pg/advisor_statement_prior_backup_check.gonew file mode 100644index 0000000000..961a167fae--- /dev/null+++ b/backend/plugin/advisor/pg/advisor_statement_prior_backup_check.go@@ -0,0 +1,105 @@+package pg++// Framework code is generated by the generator.++import (+ "context"+ "database/sql"+ "fmt"+ "strings"++ "github.com/pkg/errors"++ "github.com/bytebase/bytebase/backend/plugin/advisor"+ "github.com/bytebase/bytebase/backend/plugin/parser/sql/ast"+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"+)++var (+ _ advisor.Advisor = (*StatementPriorBackupCheckAdvisor)(nil)+)++func init() {+ advisor.Register(storepb.Engine_POSTGRES, advisor.PostgreSQLStatementPriorBackupCheck, &StatementPriorBackupCheckAdvisor{})+}++// StatementPriorBackupCheckAdvisor is the advisor checking for disallow mix DDL and DML.+type StatementPriorBackupCheckAdvisor struct {+}++// Check checks for disallow mix DDL and DML.+func (*StatementPriorBackupCheckAdvisor) Check(ctx advisor.Context, _ string) ([]advisor.Advice, error) {+ var adviceList []advisor.Advice+ if ctx.PreUpdateBackupDetail == nil || ctx.ChangeType != storepb.PlanCheckRunConfig_DML {+ adviceList = append(adviceList, advisor.Advice{+ Status: advisor.Success,+ Code: advisor.Ok,+ Title: "OK",+ Content: "",+ })+ return adviceList, nil+ }+ stmtList, ok := ctx.AST.([]ast.Node)+ if !ok {+ return nil, errors.Errorf("failed to convert to Node")+ }++ level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level)+ if err != nil {+ return nil, err+ }+ title := string(ctx.Rule.Type)++ for _, stmt := range stmtList {+ var isDDL bool+ if _, ok := stmt.(ast.DDLNode); ok {+ isDDL = true+ }+ if isDDL {+ adviceList = append(adviceList, advisor.Advice{+ Status: level,+ Title: title,+ Content: fmt.Sprintf("Data change can only run DML, \"%s\" is not DML", stmt.Text()),+ Code: advisor.StatementMixDDLDML,+ Line: stmt.LastLine(),+ })+ }+ }++ if !databaseExists(ctx.Context, ctx.Driver, extractDatabaseName(ctx.PreUpdateBackupDetail.Database)) {+ adviceList = append(adviceList, advisor.Advice{+ Status: level,+ Title: title,+ Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", ctx.PreUpdateBackupDetail.Database),+ Code: advisor.DatabaseNotExists,+ Line: 0,+ })+ }++ if len(adviceList) == 0 {+ adviceList = append(adviceList, advisor.Advice{+ Status: advisor.Success,+ Code: advisor.Ok,+ Title: "OK",+ Content: "",+ })+ }++ return adviceList, nil+}++func extractDatabaseName(databaseUID string) string {+ segments := strings.Split(databaseUID, "/")+ return segments[len(segments)-1]+}++func databaseExists(ctx context.Context, driver *sql.DB, database string) bool {+ if driver == nil {+ return false+ }+ var count int+ if err := driver.QueryRowContext(ctx, "SELECT COUNT(*) FROM pg_database WHERE datname = $1", database).Scan(&count); err != nil {+ return false+ }+ return count > 0+}diff --git a/backend/plugin/advisor/pg/pg_rules_test.go b/backend/plugin/advisor/pg/pg_rules_test.goindex b8336b9a71..07fffb6f97 100644--- a/backend/plugin/advisor/pg/pg_rules_test.go+++ b/backend/plugin/advisor/pg/pg_rules_test.go@@ -50,7 +50,6 @@ func TestPostgreSQLRules(t *testing.T) {advisor.SchemaRuleStatementDisallowAddNotNull,advisor.SchemaRuleStatementCreateSpecifySchema,advisor.SchemaRuleStatementCheckSetRoleVariable,- advisor.SchemaRuleStatementDisallowMixDDLDML,}for _, rule := range pgRules {diff --git a/backend/plugin/advisor/pg/test/statement_disallow_mix_ddl_dml.yaml b/backend/plugin/advisor/pg/test/statement_disallow_mix_ddl_dml.yamldeleted file mode 100644index d217fbda79..0000000000--- a/backend/plugin/advisor/pg/test/statement_disallow_mix_ddl_dml.yaml+++ /dev/null@@ -1,28 +0,0 @@--- statement: DELETE FROM tech_book WHERE a > 1;- want:- - status: SUCCESS- code: 0- title: OK- content: ""- line: 0- column: 0- details: ""-- statement: UPDATE tech_book SET id = 1;- want:- - status: SUCCESS- code: 0- title: OK- content: ""- line: 0- column: 0- details: ""-- statement: ALTER TABLE tech_book ADD COLUMN author TEXT; UPDATE tech_book SET id = 1;DELETE FROM tech_book WHERE a > 1;- want:- - status: WARN- code: 228- title: statement.disallow-mix-ddl-dml- content: Mixing DDL with DML is not allowed- line: 0- column: 0- details: ""diff --git a/backend/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.goindex 4f3b7934b5..e75e929978 100644--- a/backend/plugin/advisor/sql_review.go+++ b/backend/plugin/advisor/sql_review.go@@ -123,8 +123,8 @@ const (SchemaRuleStatementJoinStrictColumnAttrs = "statement.join-strict-column-attrs"// SchemaRuleStatementDisallowMixDML disallow mix DML on the same table.SchemaRuleStatementDisallowMixDML = "statement.disallow-mix-dml"- // SchemaRuleStatementDisallowMixDDLDML disallow mix DDL and DML.- SchemaRuleStatementDisallowMixDDLDML = "statement.disallow-mix-ddl-dml"+ // SchemaRuleStatementPriorBackupCheck checks for prior backup.+ SchemaRuleStatementPriorBackupCheck = "statement.prior-backup-check"// SchemaRuleTableRequirePK require the table to have a primary key.SchemaRuleTableRequirePK SQLReviewRuleType = "table.require-pk"@@ -455,14 +455,15 @@ func UnmarshalNamingCaseRulePayload(payload string) (*NamingCaseRulePayload, err// SQLReviewCheckContext is the context for SQL review check.type SQLReviewCheckContext struct {- Charset string- Collation string- ChangeType storepb.PlanCheckRunConfig_ChangeDatabaseType- DBSchema *storepb.DatabaseSchemaMetadata- DbType storepb.Engine- Catalog catalog.Catalog- Driver *sql.DB- Context context.Context+ Charset string+ Collation string+ ChangeType storepb.PlanCheckRunConfig_ChangeDatabaseType+ DBSchema *storepb.DatabaseSchemaMetadata+ DbType storepb.Engine+ Catalog catalog.Catalog+ Driver *sql.DB+ Context context.Context+ PreUpdateBackupDetail *storepb.PlanCheckRunConfig_PreUpdateBackupDetail// Snowflake specific fieldsCurrentDatabase string@@ -768,18 +769,19 @@ func SQLReviewCheck(statements string, ruleList []*storepb.SQLReviewRule, checkCcheckContext.DbType,advisorType,Context{- Charset: checkContext.Charset,- Collation: checkContext.Collation,- DBSchema: checkContext.DBSchema,- ChangeType: checkContext.ChangeType,- AST: ast,- Statements: statements,- Rule: rule,- Catalog: finder,- Driver: checkContext.Driver,- Context: checkContext.Context,- CurrentSchema: checkContext.CurrentSchema,- CurrentDatabase: checkContext.CurrentDatabase,+ Charset: checkContext.Charset,+ Collation: checkContext.Collation,+ DBSchema: checkContext.DBSchema,+ ChangeType: checkContext.ChangeType,+ PreUpdateBackupDetail: checkContext.PreUpdateBackupDetail,+ AST: ast,+ Statements: statements,+ Rule: rule,+ Catalog: finder,+ Driver: checkContext.Driver,+ Context: checkContext.Context,+ CurrentSchema: checkContext.CurrentSchema,+ CurrentDatabase: checkContext.CurrentDatabase,},statements,)@@ -1431,12 +1433,12 @@ func getAdvisorTypeByRule(ruleType SQLReviewRuleType, engine storepb.Engine) (Tyif engine == storepb.Engine_MYSQL || engine == storepb.Engine_TIDB {return MySQLStatementDisallowMixDML, nil}- case SchemaRuleStatementDisallowMixDDLDML:+ case SchemaRuleStatementPriorBackupCheck:switch engine {case storepb.Engine_MYSQL, storepb.Engine_TIDB:- return MySQLStatementDisallowMixDDLDML, nil+ return MySQLStatementPriorBackupCheck, nilcase storepb.Engine_POSTGRES:- return PostgreSQLStatementDisallowMixDDLDML, nil+ return PostgreSQLStatementPriorBackupCheck, nil}case SchemaRuleCharsetAllowlist:switch engine {diff --git a/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_ddl_dml.go b/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_ddl_dml.godeleted file mode 100644index b43982cd1f..0000000000--- a/backend/plugin/advisor/tidb/advisor_statement_disallow_mix_ddl_dml.go+++ /dev/null@@ -1,101 +0,0 @@-package tidb--import (- "fmt"-- "github.com/pingcap/tidb/pkg/parser/ast"- "github.com/pkg/errors"-- "github.com/bytebase/bytebase/backend/plugin/advisor"- storepb "github.com/bytebase/bytebase/proto/generated-go/store"-)--var (- _ advisor.Advisor = (*StatementDisallowMixDDLDMLAdvisor)(nil)-)--func init() {- advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementDisallowMixDDLDML, &StatementDisallowMixDDLDMLAdvisor{})-}--// StatementDisallowMixDDLDMLAdvisor is the advisor checking for no mixed DDL and DML.-type StatementDisallowMixDDLDMLAdvisor struct {-}--// Check checks for no mixed DDL and DML.-func (*StatementDisallowMixDDLDMLAdvisor) Check(ctx advisor.Context, _ string) ([]advisor.Advice, error) {- root, ok := ctx.AST.([]ast.StmtNode)- if !ok {- return nil, errors.Errorf("failed to convert to StmtNode")- }-- level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level)- if err != nil {- return nil, err- }- title := string(ctx.Rule.Type)-- var adviceList []advisor.Advice- var hasDDL, hasDML bool- for _, stmtNode := range root {- var isDDL, isDML bool- if _, ok := stmtNode.(ast.DDLNode); ok {- isDDL = true- }- if _, ok := stmtNode.(ast.DMLNode); ok {- isDML = true- }-- switch ctx.ChangeType {- case storepb.PlanCheckRunConfig_DDL, storepb.PlanCheckRunConfig_SDL, storepb.PlanCheckRunConfig_DDL_GHOST:- if isDML {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: fmt.Sprintf("Alter schema can only run DDL, \"%s\" is not DDL", stmtNode.Text()),- Code: advisor.StatementDisallowMixDDLDML,- Line: stmtNode.OriginTextPosition(),- })- }- case storepb.PlanCheckRunConfig_DML:- if isDDL {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: fmt.Sprintf("Data change can only run DML, \"%s\" is not DML", stmtNode.Text()),- Code: advisor.StatementDisallowMixDDLDML,- Line: stmtNode.OriginTextPosition(),- })- }- }- if isDDL {- hasDDL = true- }- if isDML {- hasDML = true- }- if hasDDL && hasDML {- break- }- }-- if hasDDL && hasDML {- adviceList = append(adviceList, advisor.Advice{- Status: level,- Title: title,- Content: "Mixing DDL with DML is not allowed",- Code: advisor.StatementDisallowMixDDLDML,- })- }-- if len(adviceList) == 0 {- adviceList = append(adviceList, advisor.Advice{- Status: advisor.Success,- Code: advisor.Ok,- Title: "OK",- Content: "",- })- }-- return adviceList, nil-}diff --git a/backend/plugin/advisor/tidb/advisor_statement_prior_backup_check.go b/backend/plugin/advisor/tidb/advisor_statement_prior_backup_check.gonew file mode 100644index 0000000000..34eab438b6--- /dev/null+++ b/backend/plugin/advisor/tidb/advisor_statement_prior_backup_check.go@@ -0,0 +1,105 @@+package tidb++import (+ "context"+ "database/sql"+ "fmt"+ "strings"++ "github.com/pingcap/tidb/pkg/parser/ast"+ "github.com/pkg/errors"++ "github.com/bytebase/bytebase/backend/plugin/advisor"+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"+)++var (+ _ advisor.Advisor = (*StatementPriorBackupCheckAdvisor)(nil)+)++func init() {+ advisor.Register(storepb.Engine_TIDB, advisor.MySQLStatementPriorBackupCheck, &StatementPriorBackupCheckAdvisor{})+}++// StatementPriorBackupCheckAdvisor is the advisor checking for no mixed DDL and DML.+type StatementPriorBackupCheckAdvisor struct {+}++// Check checks for no mixed DDL and DML.+func (*StatementPriorBackupCheckAdvisor) Check(ctx advisor.Context, _ string) ([]advisor.Advice, error) {+ var adviceList []advisor.Advice+ if ctx.PreUpdateBackupDetail == nil || ctx.ChangeType != storepb.PlanCheckRunConfig_DML {+ adviceList = append(adviceList, advisor.Advice{+ Status: advisor.Success,+ Code: advisor.Ok,+ Title: "OK",+ Content: "",+ })+ return adviceList, nil+ }++ root, ok := ctx.AST.([]ast.StmtNode)+ if !ok {+ return nil, errors.Errorf("failed to convert to StmtNode")+ }++ level, err := advisor.NewStatusBySQLReviewRuleLevel(ctx.Rule.Level)+ if err != nil {+ return nil, err+ }+ title := string(ctx.Rule.Type)++ for _, stmtNode := range root {+ var isDDL bool+ if _, ok := stmtNode.(ast.DDLNode); ok {+ isDDL = true+ }++ if isDDL {+ adviceList = append(adviceList, advisor.Advice{+ Status: level,+ Title: title,+ Content: "Prior backup cannot deal with mixed DDL and DML statements",+ Code: advisor.StatementMixDDLDML,+ Line: stmtNode.OriginTextPosition(),+ })+ }+ }++ if !databaseExists(ctx.Context, ctx.Driver, extractDatabaseName(ctx.PreUpdateBackupDetail.Database)) {+ adviceList = append(adviceList, advisor.Advice{+ Status: level,+ Title: title,+ Content: fmt.Sprintf("Need database %q to do prior backup but it does not exist", ctx.PreUpdateBackupDetail.Database),+ Code: advisor.DatabaseNotExists,+ Line: 0,+ })+ }++ if len(adviceList) == 0 {+ adviceList = append(adviceList, advisor.Advice{+ Status: advisor.Success,+ Code: advisor.Ok,+ Title: "OK",+ Content: "",+ })+ }++ return adviceList, nil+}++func extractDatabaseName(databaseUID string) string {+ segments := strings.Split(databaseUID, "/")+ return segments[len(segments)-1]+}++func databaseExists(ctx context.Context, driver *sql.DB, database string) bool {+ if driver == nil {+ return false+ }+ var count int+ if err := driver.QueryRowContext(ctx, "SELECT COUNT(*) FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = ?", database).Scan(&count); err != nil {+ return false+ }+ return count > 0+}diff --git a/backend/plugin/advisor/tidb/test/statement_disallow_mix_ddl_dml.yaml b/backend/plugin/advisor/tidb/test/statement_disallow_mix_ddl_dml.yamldeleted file mode 100644index edc112a65f..0000000000--- a/backend/plugin/advisor/tidb/test/statement_disallow_mix_ddl_dml.yaml+++ /dev/null@@ -1,27 +0,0 @@-- statement: DELETE FROM tech_book WHERE a > 1;- want:- - status: SUCCESS- code: 0- title: OK- content: ""- line: 0- column: 0- details: ""-- statement: UPDATE tech_book SET id = 1;- want:- - status: SUCCESS- code: 0- title: OK- content: ""- line: 0- column: 0- details: ""-- statement: ALTER TABLE tech_book ADD COLUMN author TEXT; UPDATE tech_book SET id = 1;DELETE FROM tech_book WHERE a > 1;- want:- - status: WARN- code: 228- title: statement.disallow-mix-ddl-dml- content: Mixing DDL with DML is not allowed- line: 0- column: 0- details: ""diff --git a/backend/plugin/advisor/tidb/tidb_rules_test.go b/backend/plugin/advisor/tidb/tidb_rules_test.goindex a004fd3964..5bff1f7bcf 100644--- a/backend/plugin/advisor/tidb/tidb_rules_test.go+++ b/backend/plugin/advisor/tidb/tidb_rules_test.go@@ -42,7 +42,6 @@ func TestTiDBRules(t *testing.T) {advisor.SchemaRuleStatementInsertDisallowOrderByRand,// advisor.SchemaRuleStatementDMLDryRun dry run the dml.advisor.SchemaRuleStatementDMLDryRun,- advisor.SchemaRuleStatementDisallowMixDDLDML,// advisor.SchemaRuleTableRequirePK require the table to have a primary key.advisor.SchemaRuleTableRequirePK,diff --git a/backend/plugin/advisor/utils_for_tests.go b/backend/plugin/advisor/utils_for_tests.goindex 1437d6a39f..47593ce20a 100644--- a/backend/plugin/advisor/utils_for_tests.go+++ b/backend/plugin/advisor/utils_for_tests.go@@ -366,7 +366,7 @@ func SetDefaultSQLReviewRulePayload(ruleTp SQLReviewRuleType, dbType storepb.EngSchemaRuleStatementCheckSetRoleVariable,SchemaRuleStatementWhereDisallowUsingFunction,SchemaRuleStatementDisallowMixDML,- SchemaRuleStatementDisallowMixDDLDML,+ SchemaRuleStatementPriorBackupCheck,SchemaRuleStatementJoinStrictColumnAttrs,SchemaRuleTableDisallowSetCharset:case SchemaRuleTableDropNamingConvention:diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.goindex af901142ee..7c8462a83c 100644--- a/backend/runner/plancheck/statement_advise_executor.go+++ b/backend/runner/plancheck/statement_advise_executor.go@@ -162,14 +162,15 @@ func (e *StatementAdviseExecutor) runForDatabaseTarget(ctx context.Context, conf// To avoid leaking the rendered statement, the error message should use the original statement and not the rendered statement.renderedStatement := utils.RenderStatement(statement, materials)adviceList, err := advisor.SQLReviewCheck(renderedStatement, policy.RuleList, advisor.SQLReviewCheckContext{- Charset: dbSchema.GetMetadata().CharacterSet,- Collation: dbSchema.GetMetadata().Collation,- DBSchema: dbSchema.GetMetadata(),- ChangeType: changeType,- DbType: instance.Engine,- Catalog: catalog,- Driver: connection,- Context: ctx,+ Charset: dbSchema.GetMetadata().CharacterSet,+ Collation: dbSchema.GetMetadata().Collation,+ DBSchema: dbSchema.GetMetadata(),+ ChangeType: changeType,+ DbType: instance.Engine,+ Catalog: catalog,+ Driver: connection,+ Context: ctx,+ PreUpdateBackupDetail: config.PreUpdateBackupDetail,})if err != nil {return nil, errdiff --git a/frontend/src/locales/sql-review/en-US.json b/frontend/src/locales/sql-review/en-US.jsonindex c2e2d52a18..59aae3ea72 100644--- a/frontend/src/locales/sql-review/en-US.json+++ b/frontend/src/locales/sql-review/en-US.json@@ -465,9 +465,9 @@"title": "Disallow DMLs on the same table","description": "Performing concurrent data modifications on a table can lead to challenges in accurately identifying the impacted rows. This consequently complicates the process of creating a precise backup of the affected data."},- "statement-disallow-mix-ddl-dml": {- "title": "Disallow mixing DDL and DML",- "description": "For optimal performance and data integrity, avoid combining DDL and DML statements within the same script."+ "statement-prior-backup-check": {+ "title": "Check for prior backup before data change",+ "description": "This rule will check if a backup can be created before the data change. For more details, contains the backup target database exists and disallow the DDL statement."},"schema-backward-compatibility": {"title": "Check application backward compatibility",diff --git a/frontend/src/locales/sql-review/es-ES.json b/frontend/src/locales/sql-review/es-ES.jsonindex f95aafffe2..c8f6d3c021 100644--- a/frontend/src/locales/sql-review/es-ES.json+++ b/frontend/src/locales/sql-review/es-ES.json@@ -465,9 +465,9 @@"title": "Prohibir DML en la misma tabla","description": "La realización de modificaciones concurrentes de datos en una tabla puede generar dificultades para identificar con precisión las filas afectadas. En consecuencia, esto complica el proceso de crear una copia de seguridad precisa de los datos modificados."},- "statement-disallow-mix-ddl-dml": {- "title": "No se permite mezclar DDL y DML",- "description": "Para un rendimiento óptimo e integridad de los datos, evite combinar sentencias DDL y DML dentro del mismo script."+ "statement-prior-backup-check": {+ "title": "Verificar la existencia de una copia de seguridad previa antes de cambiar los datos",+ "description": "Esta regla verificará si se puede crear una copia de seguridad antes del cambio de datos. Para más detalles, contiene la existencia de la base de datos objetivo de la copia de seguridad y no permite la sentencia DDL."},"schema-backward-compatibility": {"title": "Comprobación de la compatibilidad con versiones anteriores de la aplicación",diff --git a/frontend/src/locales/sql-review/ja-JP.json b/frontend/src/locales/sql-review/ja-JP.jsonindex d3a209eb23..b3b7f1be57 100644--- a/frontend/src/locales/sql-review/ja-JP.json+++ b/frontend/src/locales/sql-review/ja-JP.json@@ -465,9 +465,9 @@"title": "同じテーブルに対する DML 操作を禁止する","description": "テーブルに対する同時データ更新を行うと、影響を受ける行を正確に特定することが困難になり、結果的に、影響を受けたデータの正確なバックアップを作成するプロセスが複雑になります。"},- "statement-disallow-mix-ddl-dml": {- "title": "DDL と DML の混在を禁止する",- "description": "最適なパフォーマンスとデータの整合性を保つために、同じスクリプト内で DDL ステートメントと DML ステートメントを組み合わせることは避けてください。"+ "statement-prior-backup-check": {+ "title": "データ変更前のバックアップの確認",+ "description": "このルールは、データ変更前にバックアップが作成できるかどうかを確認します。詳細については、バックアップ対象のデータベースが存在し、DDLステートメントを許可しないことを含みます。"},"schema-backward-compatibility": {"title": "アプリケーションの後方互換性を確認する",diff --git a/frontend/src/locales/sql-review/vi-VN.json b/frontend/src/locales/sql-review/vi-VN.jsonindex 1d931c55a3..52251d20d3 100644--- a/frontend/src/locales/sql-review/vi-VN.json+++ b/frontend/src/locales/sql-review/vi-VN.json@@ -465,9 +465,9 @@"title": "Chặn các truy vấn DML trên cùng một bảng","description": "Ch thực hiện các sửa đổi dữ liệu đồng thời trên một bảng có thể dẫn đến những thách thức trong việc xác định chính xác các hàng bị ảnh hưởng. Điều này do đó làm phức tạp quá trình tạo bản sao lưu chính xác của dữ liệu bị ảnh hưởng."},- "statement-disallow-mix-ddl-dml": {- "title": "Không nên trộn lẫn DDL và DML",- "description": "Chú ý để đạt hiệu suất tối ưu và tính toàn vẹn dữ liệu, tránh kết hợp các câu lệnh DDL và DML trong cùng một tập lệnh."+ "statement-prior-backup-check": {+ "title": "Kiểm tra sao lưu trước khi thay đổi dữ liệu",+ "description": "Quy tắc này sẽ kiểm tra xem có thể tạo sao lưu trước khi thay đổi dữ liệu hay không. Để biết thêm chi tiết, hãy kiểm tra xem cơ sở dữ liệu mục tiêu sao lưu có tồn tại và không cho phép câu lệnh DDL."},"schema-backward-compatibility": {"title": "Kiểm tra khả năng tương thích ngược của ứng dụng",diff --git a/frontend/src/locales/sql-review/zh-CN.json b/frontend/src/locales/sql-review/zh-CN.jsonindex 017f13a86b..22fbd9120a 100644--- a/frontend/src/locales/sql-review/zh-CN.json+++ b/frontend/src/locales/sql-review/zh-CN.json@@ -465,9 +465,9 @@"title": "禁止在同一张表上进行多个 DML 操作","description": "对表格进行并发数据修改可能会给准确识别受影响的行带来挑战。 因此,这会使创建受影响数据的精确备份过程变得复杂。"},- "statement-disallow-mix-ddl-dml": {- "title": "禁止混合 DDL 和 DML 操作",- "description": "为了获得最佳性能和数据完整性,请避免在同一个脚本中混合使用 DDL 和 DML 语句。"+ "statement-prior-backup-check": {+ "title": "在数据更改前检查先前的备份",+ "description": "此规则将检查是否可以在数据更改前创建备份。更多详细信息,包含备份目标数据库存在并禁止DDL语句。"},"schema-backward-compatibility": {"title": "检查应用向后兼容性",diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.tsindex 824c1150fd..e5804c3efe 100644--- a/frontend/src/types/proto/google/protobuf/descriptor.ts+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts@@ -4,98 +4,6 @@ import _m0 from "protobufjs/minimal";export const protobufPackage = "google.protobuf";-/** The full set of known editions. */-export enum Edition {- /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */- EDITION_UNKNOWN = 0,- /**- * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like- * distinct editions. These can't be used to specify the edition of proto- * files, but feature definitions must supply proto2/proto3 defaults for- * backwards compatibility.- */- EDITION_PROTO2 = 998,- EDITION_PROTO3 = 999,- /**- * EDITION_2023 - Editions that have been released. The specific values are arbitrary and- * should not be depended on, but they will always be time-ordered for easy- * comparison.- */- EDITION_2023 = 1000,- /**- * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be- * used or relyed on outside of tests.- */- EDITION_1_TEST_ONLY = 1,- EDITION_2_TEST_ONLY = 2,- EDITION_99997_TEST_ONLY = 99997,- EDITION_99998_TEST_ONLY = 99998,- EDITION_99999_TEST_ONLY = 99999,- UNRECOGNIZED = -1,-}--export function editionFromJSON(object: any): Edition {- switch (object) {- case 0:- case "EDITION_UNKNOWN":- return Edition.EDITION_UNKNOWN;- case 998:- case "EDITION_PROTO2":- return Edition.EDITION_PROTO2;- case 999:- case "EDITION_PROTO3":- return Edition.EDITION_PROTO3;- case 1000:- case "EDITION_2023":- return Edition.EDITION_2023;- case 1:- case "EDITION_1_TEST_ONLY":- return Edition.EDITION_1_TEST_ONLY;- case 2:- case "EDITION_2_TEST_ONLY":- return Edition.EDITION_2_TEST_ONLY;- case 99997:- case "EDITION_99997_TEST_ONLY":- return Edition.EDITION_99997_TEST_ONLY;- case 99998:- case "EDITION_99998_TEST_ONLY":- return Edition.EDITION_99998_TEST_ONLY;- case 99999:- case "EDITION_99999_TEST_ONLY":- return Edition.EDITION_99999_TEST_ONLY;- case -1:- case "UNRECOGNIZED":- default:- return Edition.UNRECOGNIZED;- }-}--export function editionToJSON(object: Edition): string {- switch (object) {- case Edition.EDITION_UNKNOWN:- return "EDITION_UNKNOWN";- case Edition.EDITION_PROTO2:- return "EDITION_PROTO2";- case Edition.EDITION_PROTO3:- return "EDITION_PROTO3";- case Edition.EDITION_2023:- return "EDITION_2023";- case Edition.EDITION_1_TEST_ONLY:- return "EDITION_1_TEST_ONLY";- case Edition.EDITION_2_TEST_ONLY:- return "EDITION_2_TEST_ONLY";- case Edition.EDITION_99997_TEST_ONLY:- return "EDITION_99997_TEST_ONLY";- case Edition.EDITION_99998_TEST_ONLY:- return "EDITION_99998_TEST_ONLY";- case Edition.EDITION_99999_TEST_ONLY:- return "EDITION_99999_TEST_ONLY";- case Edition.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}-/*** The protocol compiler can output a FileDescriptorSet containing the .proto* files it parses.@@ -143,8 +51,8 @@ export interface FileDescriptorProto {* If `edition` is present, this value must be "editions".*/syntax: string;- /** The edition of the proto file. */- edition: Edition;+ /** The edition of the proto file, which is an opaque string. */+ edition: string;}/** Describes a message type. */@@ -188,84 +96,6 @@ export interface DescriptorProto_ReservedRange {export interface ExtensionRangeOptions {/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];- /**- * For external users: DO NOT USE. We are in the process of open sourcing- * extension declaration and executing internal cleanups before it can be- * used externally.- */- declaration: ExtensionRangeOptions_Declaration[];- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;- /**- * The verification state of the range.- * TODO: flip the default to DECLARATION once all empty ranges- * are marked as UNVERIFIED.- */- verification: ExtensionRangeOptions_VerificationState;-}--/** The verification state of the extension range. */-export enum ExtensionRangeOptions_VerificationState {- /** DECLARATION - All the extensions of the range must be declared. */- DECLARATION = 0,- UNVERIFIED = 1,- UNRECOGNIZED = -1,-}--export function extensionRangeOptions_VerificationStateFromJSON(object: any): ExtensionRangeOptions_VerificationState {- switch (object) {- case 0:- case "DECLARATION":- return ExtensionRangeOptions_VerificationState.DECLARATION;- case 1:- case "UNVERIFIED":- return ExtensionRangeOptions_VerificationState.UNVERIFIED;- case -1:- case "UNRECOGNIZED":- default:- return ExtensionRangeOptions_VerificationState.UNRECOGNIZED;- }-}--export function extensionRangeOptions_VerificationStateToJSON(object: ExtensionRangeOptions_VerificationState): string {- switch (object) {- case ExtensionRangeOptions_VerificationState.DECLARATION:- return "DECLARATION";- case ExtensionRangeOptions_VerificationState.UNVERIFIED:- return "UNVERIFIED";- case ExtensionRangeOptions_VerificationState.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--export interface ExtensionRangeOptions_Declaration {- /** The extension number declared within the extension range. */- number: number;- /**- * The fully-qualified name of the extension field. There must be a leading- * dot in front of the full name.- */- fullName: string;- /**- * The fully-qualified type name of the extension field. Unlike- * Metadata.type, Declaration.type must have a leading dot for messages- * and enums.- */- type: string;- /**- * If true, indicates that the number is reserved in the extension range,- * and any extension field with the number will fail to compile. Set this- * when a declared extension field is deleted.- */- reserved: boolean;- /**- * If true, indicates that the extension must be defined as repeated.- * Otherwise the extension must be defined as optional.- */- repeated: boolean;}/** Describes a field within a message. */@@ -363,10 +193,9 @@ export enum FieldDescriptorProto_Type {TYPE_STRING = 9,/*** TYPE_GROUP - Tag-delimited aggregate.- * Group type is deprecated and not supported after google.protobuf. However, Proto3+ * Group type is deprecated and not supported in proto3. However, Proto3* implementations should still be able to parse the group wire format and- * treat group fields as unknown fields. In Editions, the group wire format- * can be enabled via the `message_encoding` feature.+ * treat group fields as unknown fields.*/TYPE_GROUP = 10,/** TYPE_MESSAGE - Length-delimited aggregate. */@@ -494,13 +323,8 @@ export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Typexport enum FieldDescriptorProto_Label {/** LABEL_OPTIONAL - 0 is reserved for errors */LABEL_OPTIONAL = 1,- LABEL_REPEATED = 3,- /**- * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions- * it's explicitly prohibited. In Editions, the `field_presence` feature- * can be used to get this behavior.- */LABEL_REQUIRED = 2,+ LABEL_REPEATED = 3,UNRECOGNIZED = -1,}@@ -509,12 +333,12 @@ export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorcase 1:case "LABEL_OPTIONAL":return FieldDescriptorProto_Label.LABEL_OPTIONAL;- case 3:- case "LABEL_REPEATED":- return FieldDescriptorProto_Label.LABEL_REPEATED;case 2:case "LABEL_REQUIRED":return FieldDescriptorProto_Label.LABEL_REQUIRED;+ case 3:+ case "LABEL_REPEATED":+ return FieldDescriptorProto_Label.LABEL_REPEATED;case -1:case "UNRECOGNIZED":default:@@ -526,10 +350,10 @@ export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Laswitch (object) {case FieldDescriptorProto_Label.LABEL_OPTIONAL:return "LABEL_OPTIONAL";- case FieldDescriptorProto_Label.LABEL_REPEATED:- return "LABEL_REPEATED";case FieldDescriptorProto_Label.LABEL_REQUIRED:return "LABEL_REQUIRED";+ case FieldDescriptorProto_Label.LABEL_REPEATED:+ return "LABEL_REPEATED";case FieldDescriptorProto_Label.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -723,10 +547,6 @@ export interface FileOptions {* determining the ruby package.*/rubyPackage: string;- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;/*** The parser stores options it doesn't recognize here.* See the documentation for the "Options" section above.@@ -845,16 +665,12 @@ export interface MessageOptions {* This should only be used as a temporary measure against broken builds due* to the change in behavior for JSON field name conflicts.*- * TODO This is legacy behavior we plan to remove once downstream+ * TODO(b/261750190) This is legacy behavior we plan to remove once downstream* teams have had time to migrate.** @deprecated*/deprecatedLegacyJsonFieldConflicts: boolean;- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -863,10 +679,8 @@ export interface FieldOptions {/*** The ctype option instructs the C++ code generator to use a different* representation of the field than it normally would. See the specific- * options below. This option is only implemented to support use of- * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of- * type "bytes" in the open source release -- sorry, we'll try to include- * other types in a future version!+ * options below. This option is not yet implemented in the open source+ * release -- sorry, we'll try to include it in a future version!*/ctype: FieldOptions_CType;/**@@ -874,9 +688,7 @@ export interface FieldOptions {* a more efficient representation on the wire. Rather than repeatedly* writing the tag and type for each element, the entire array is encoded as* a single length-delimited blob. In proto3, only explicit setting it to- * false will avoid using packed encoding. This option is prohibited in- * Editions, but the `repeated_field_encoding` feature can be used to control- * the behavior.+ * false will avoid using packed encoding.*/packed: boolean;/**@@ -947,12 +759,7 @@ export interface FieldOptions {*/debugRedact: boolean;retention: FieldOptions_OptionRetention;- targets: FieldOptions_OptionTargetType[];- editionDefaults: FieldOptions_EditionDefault[];- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;+ target: FieldOptions_OptionTargetType;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -960,14 +767,6 @@ export interface FieldOptions {export enum FieldOptions_CType {/** STRING - Default mode. */STRING = 0,- /**- * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type- * "bytes". It indicates that in C++, the data should be stored in a Cord- * instead of a string. For very large strings, this may reduce memory- * fragmentation. It may also allow better performance when parsing from a- * Cord, or when parsing with aliasing enabled, as the parsed Cord may then- * alias the original buffer.- */CORD = 1,STRING_PIECE = 2,UNRECOGNIZED = -1,@@ -1178,17 +977,7 @@ export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionT}}-export interface FieldOptions_EditionDefault {- edition: Edition;- /** Textproto value. */- value: string;-}-export interface OneofOptions {- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -1211,16 +1000,12 @@ export interface EnumOptions {* and strips underscored from the fields before comparison in proto3 only.* The new behavior takes `json_name` into account and applies to proto2 as* well.- * TODO Remove this legacy behavior once downstream teams have+ * TODO(b/261750190) Remove this legacy behavior once downstream teams have* had time to migrate.** @deprecated*/deprecatedLegacyJsonFieldConflicts: boolean;- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -1233,25 +1018,11 @@ export interface EnumValueOptions {* this is a formalization for deprecating enum values.*/deprecated: boolean;- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;- /**- * Indicate that fields annotated with this enum value should not be printed- * out when using debug formats, e.g. when the field contains sensitive- * credentials.- */- debugRedact: boolean;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}export interface ServiceOptions {- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;/*** Is this service deprecated?* Depending on the target platform, this can emit Deprecated annotations@@ -1272,10 +1043,6 @@ export interface MethodOptions {*/deprecated: boolean;idempotencyLevel: MethodOptions_IdempotencyLevel;- /** Any features defined in the specific edition. */- features:- | FeatureSet- | undefined;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];}@@ -1360,294 +1127,6 @@ export interface UninterpretedOption_NamePart {isExtension: boolean;}-/**- * TODO Enums in C++ gencode (and potentially other languages) are- * not well scoped. This means that each of the feature enums below can clash- * with each other. The short names we've chosen maximize call-site- * readability, but leave us very open to this scenario. A future feature will- * be designed and implemented to handle this, hopefully before we ever hit a- * conflict here.- */-export interface FeatureSet {- fieldPresence: FeatureSet_FieldPresence;- enumType: FeatureSet_EnumType;- repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding;- utf8Validation: FeatureSet_Utf8Validation;- messageEncoding: FeatureSet_MessageEncoding;- jsonFormat: FeatureSet_JsonFormat;-}--export enum FeatureSet_FieldPresence {- FIELD_PRESENCE_UNKNOWN = 0,- EXPLICIT = 1,- IMPLICIT = 2,- LEGACY_REQUIRED = 3,- UNRECOGNIZED = -1,-}--export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence {- switch (object) {- case 0:- case "FIELD_PRESENCE_UNKNOWN":- return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN;- case 1:- case "EXPLICIT":- return FeatureSet_FieldPresence.EXPLICIT;- case 2:- case "IMPLICIT":- return FeatureSet_FieldPresence.IMPLICIT;- case 3:- case "LEGACY_REQUIRED":- return FeatureSet_FieldPresence.LEGACY_REQUIRED;- case -1:- case "UNRECOGNIZED":- default:- return FeatureSet_FieldPresence.UNRECOGNIZED;- }-}--export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string {- switch (object) {- case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN:- return "FIELD_PRESENCE_UNKNOWN";- case FeatureSet_FieldPresence.EXPLICIT:- return "EXPLICIT";- case FeatureSet_FieldPresence.IMPLICIT:- return "IMPLICIT";- case FeatureSet_FieldPresence.LEGACY_REQUIRED:- return "LEGACY_REQUIRED";- case FeatureSet_FieldPresence.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--export enum FeatureSet_EnumType {- ENUM_TYPE_UNKNOWN = 0,- OPEN = 1,- CLOSED = 2,- UNRECOGNIZED = -1,-}--export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType {- switch (object) {- case 0:- case "ENUM_TYPE_UNKNOWN":- return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN;- case 1:- case "OPEN":- return FeatureSet_EnumType.OPEN;- case 2:- case "CLOSED":- return FeatureSet_EnumType.CLOSED;- case -1:- case "UNRECOGNIZED":- default:- return FeatureSet_EnumType.UNRECOGNIZED;- }-}--export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string {- switch (object) {- case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN:- return "ENUM_TYPE_UNKNOWN";- case FeatureSet_EnumType.OPEN:- return "OPEN";- case FeatureSet_EnumType.CLOSED:- return "CLOSED";- case FeatureSet_EnumType.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--export enum FeatureSet_RepeatedFieldEncoding {- REPEATED_FIELD_ENCODING_UNKNOWN = 0,- PACKED = 1,- EXPANDED = 2,- UNRECOGNIZED = -1,-}--export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding {- switch (object) {- case 0:- case "REPEATED_FIELD_ENCODING_UNKNOWN":- return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN;- case 1:- case "PACKED":- return FeatureSet_RepeatedFieldEncoding.PACKED;- case 2:- case "EXPANDED":- return FeatureSet_RepeatedFieldEncoding.EXPANDED;- case -1:- case "UNRECOGNIZED":- default:- return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED;- }-}--export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string {- switch (object) {- case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN:- return "REPEATED_FIELD_ENCODING_UNKNOWN";- case FeatureSet_RepeatedFieldEncoding.PACKED:- return "PACKED";- case FeatureSet_RepeatedFieldEncoding.EXPANDED:- return "EXPANDED";- case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--export enum FeatureSet_Utf8Validation {- UTF8_VALIDATION_UNKNOWN = 0,- NONE = 1,- VERIFY = 2,- UNRECOGNIZED = -1,-}--export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation {- switch (object) {- case 0:- case "UTF8_VALIDATION_UNKNOWN":- return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;- case 1:- case "NONE":- return FeatureSet_Utf8Validation.NONE;- case 2:- case "VERIFY":- return FeatureSet_Utf8Validation.VERIFY;- case -1:- case "UNRECOGNIZED":- default:- return FeatureSet_Utf8Validation.UNRECOGNIZED;- }-}--export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string {- switch (object) {- case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:- return "UTF8_VALIDATION_UNKNOWN";- case FeatureSet_Utf8Validation.NONE:- return "NONE";- case FeatureSet_Utf8Validation.VERIFY:- return "VERIFY";- case FeatureSet_Utf8Validation.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--export enum FeatureSet_MessageEncoding {- MESSAGE_ENCODING_UNKNOWN = 0,- LENGTH_PREFIXED = 1,- DELIMITED = 2,- UNRECOGNIZED = -1,-}--export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding {- switch (object) {- case 0:- case "MESSAGE_ENCODING_UNKNOWN":- return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;- case 1:- case "LENGTH_PREFIXED":- return FeatureSet_MessageEncoding.LENGTH_PREFIXED;- case 2:- case "DELIMITED":- return FeatureSet_MessageEncoding.DELIMITED;- case -1:- case "UNRECOGNIZED":- default:- return FeatureSet_MessageEncoding.UNRECOGNIZED;- }-}--export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string {- switch (object) {- case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN:- return "MESSAGE_ENCODING_UNKNOWN";- case FeatureSet_MessageEncoding.LENGTH_PREFIXED:- return "LENGTH_PREFIXED";- case FeatureSet_MessageEncoding.DELIMITED:- return "DELIMITED";- case FeatureSet_MessageEncoding.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--export enum FeatureSet_JsonFormat {- JSON_FORMAT_UNKNOWN = 0,- ALLOW = 1,- LEGACY_BEST_EFFORT = 2,- UNRECOGNIZED = -1,-}--export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat {- switch (object) {- case 0:- case "JSON_FORMAT_UNKNOWN":- return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;- case 1:- case "ALLOW":- return FeatureSet_JsonFormat.ALLOW;- case 2:- case "LEGACY_BEST_EFFORT":- return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT;- case -1:- case "UNRECOGNIZED":- default:- return FeatureSet_JsonFormat.UNRECOGNIZED;- }-}--export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string {- switch (object) {- case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN:- return "JSON_FORMAT_UNKNOWN";- case FeatureSet_JsonFormat.ALLOW:- return "ALLOW";- case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT:- return "LEGACY_BEST_EFFORT";- case FeatureSet_JsonFormat.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--/**- * A compiled specification for the defaults of a set of features. These- * messages are generated from FeatureSet extensions and can be used to seed- * feature resolution. The resolution with this object becomes a simple search- * for the closest matching edition, followed by proto merges.- */-export interface FeatureSetDefaults {- defaults: FeatureSetDefaults_FeatureSetEditionDefault[];- /**- * The minimum supported edition (inclusive) when this was constructed.- * Editions before this will not have defaults.- */- minimumEdition: Edition;- /**- * The maximum known edition (inclusive) when this was constructed. Editions- * after this will not have reliable defaults.- */- maximumEdition: Edition;-}--/**- * A map from every known edition with a unique set of defaults to its- * defaults. Not all editions may be contained here. For a given edition,- * the defaults at the closest matching edition ordered at or before it should- * be used. This field must be in strict ascending order by edition.- */-export interface FeatureSetDefaults_FeatureSetEditionDefault {- edition: Edition;- features: FeatureSet | undefined;-}-/*** Encapsulates information about the original source file from which a* FileDescriptorProto was generated.@@ -1944,7 +1423,7 @@ function createBaseFileDescriptorProto(): FileDescriptorProto {options: undefined,sourceCodeInfo: undefined,syntax: "",- edition: 0,+ edition: "",};}@@ -1990,8 +1469,8 @@ export const FileDescriptorProto = {if (message.syntax !== "") {writer.uint32(98).string(message.syntax);}- if (message.edition !== 0) {- writer.uint32(112).int32(message.edition);+ if (message.edition !== "") {+ writer.uint32(106).string(message.edition);}return writer;},@@ -2107,12 +1586,12 @@ export const FileDescriptorProto = {message.syntax = reader.string();continue;- case 14:- if (tag !== 112) {+ case 13:+ if (tag !== 106) {break;}- message.edition = reader.int32() as any;+ message.edition = reader.string();continue;}if ((tag & 7) === 4 || tag === 0) {@@ -2151,7 +1630,7 @@ export const FileDescriptorProto = {options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined,sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined,syntax: isSet(object.syntax) ? globalThis.String(object.syntax) : "",- edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0,+ edition: isSet(object.edition) ? globalThis.String(object.edition) : "",};},@@ -2193,8 +1672,8 @@ export const FileDescriptorProto = {if (message.syntax !== "") {obj.syntax = message.syntax;}- if (message.edition !== 0) {- obj.edition = editionToJSON(message.edition);+ if (message.edition !== "") {+ obj.edition = message.edition;}return obj;},@@ -2220,7 +1699,7 @@ export const FileDescriptorProto = {? SourceCodeInfo.fromPartial(object.sourceCodeInfo): undefined;message.syntax = object.syntax ?? "";- message.edition = object.edition ?? 0;+ message.edition = object.edition ?? "";return message;},};@@ -2614,7 +2093,7 @@ export const DescriptorProto_ReservedRange = {};function createBaseExtensionRangeOptions(): ExtensionRangeOptions {- return { uninterpretedOption: [], declaration: [], features: undefined, verification: 0 };+ return { uninterpretedOption: [] };}export const ExtensionRangeOptions = {@@ -2622,15 +2101,6 @@ export const ExtensionRangeOptions = {for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}- for (const v of message.declaration) {- ExtensionRangeOptions_Declaration.encode(v!, writer.uint32(18).fork()).ldelim();- }- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim();- }- if (message.verification !== 0) {- writer.uint32(24).int32(message.verification);- }return writer;},@@ -2648,27 +2118,6 @@ export const ExtensionRangeOptions = {message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));continue;- case 2:- if (tag !== 18) {- break;- }-- message.declaration.push(ExtensionRangeOptions_Declaration.decode(reader, reader.uint32()));- continue;- case 50:- if (tag !== 402) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;- case 3:- if (tag !== 24) {- break;- }-- message.verification = reader.int32() as any;- continue;}if ((tag & 7) === 4 || tag === 0) {break;@@ -2683,13 +2132,6 @@ export const ExtensionRangeOptions = {uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],- declaration: globalThis.Array.isArray(object?.declaration)- ? object.declaration.map((e: any) => ExtensionRangeOptions_Declaration.fromJSON(e))- : [],- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,- verification: isSet(object.verification)- ? extensionRangeOptions_VerificationStateFromJSON(object.verification)- : 0,};},@@ -2698,15 +2140,6 @@ export const ExtensionRangeOptions = {if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}- if (message.declaration?.length) {- obj.declaration = message.declaration.map((e) => ExtensionRangeOptions_Declaration.toJSON(e));- }- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }- if (message.verification !== 0) {- obj.verification = extensionRangeOptions_VerificationStateToJSON(message.verification);- }return obj;},@@ -2716,130 +2149,6 @@ export const ExtensionRangeOptions = {fromPartial(object: DeepPartial<ExtensionRangeOptions>): ExtensionRangeOptions {const message = createBaseExtensionRangeOptions();message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];- message.declaration = object.declaration?.map((e) => ExtensionRangeOptions_Declaration.fromPartial(e)) || [];- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;- message.verification = object.verification ?? 0;- return message;- },-};--function createBaseExtensionRangeOptions_Declaration(): ExtensionRangeOptions_Declaration {- return { number: 0, fullName: "", type: "", reserved: false, repeated: false };-}--export const ExtensionRangeOptions_Declaration = {- encode(message: ExtensionRangeOptions_Declaration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.number !== 0) {- writer.uint32(8).int32(message.number);- }- if (message.fullName !== "") {- writer.uint32(18).string(message.fullName);- }- if (message.type !== "") {- writer.uint32(26).string(message.type);- }- if (message.reserved === true) {- writer.uint32(40).bool(message.reserved);- }- if (message.repeated === true) {- writer.uint32(48).bool(message.repeated);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions_Declaration {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseExtensionRangeOptions_Declaration();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 8) {- break;- }-- message.number = reader.int32();- continue;- case 2:- if (tag !== 18) {- break;- }-- message.fullName = reader.string();- continue;- case 3:- if (tag !== 26) {- break;- }-- message.type = reader.string();- continue;- case 5:- if (tag !== 40) {- break;- }-- message.reserved = reader.bool();- continue;- case 6:- if (tag !== 48) {- break;- }-- message.repeated = reader.bool();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): ExtensionRangeOptions_Declaration {- return {- number: isSet(object.number) ? globalThis.Number(object.number) : 0,- fullName: isSet(object.fullName) ? globalThis.String(object.fullName) : "",- type: isSet(object.type) ? globalThis.String(object.type) : "",- reserved: isSet(object.reserved) ? globalThis.Boolean(object.reserved) : false,- repeated: isSet(object.repeated) ? globalThis.Boolean(object.repeated) : false,- };- },-- toJSON(message: ExtensionRangeOptions_Declaration): unknown {- const obj: any = {};- if (message.number !== 0) {- obj.number = Math.round(message.number);- }- if (message.fullName !== "") {- obj.fullName = message.fullName;- }- if (message.type !== "") {- obj.type = message.type;- }- if (message.reserved === true) {- obj.reserved = message.reserved;- }- if (message.repeated === true) {- obj.repeated = message.repeated;- }- return obj;- },-- create(base?: DeepPartial<ExtensionRangeOptions_Declaration>): ExtensionRangeOptions_Declaration {- return ExtensionRangeOptions_Declaration.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<ExtensionRangeOptions_Declaration>): ExtensionRangeOptions_Declaration {- const message = createBaseExtensionRangeOptions_Declaration();- message.number = object.number ?? 0;- message.fullName = object.fullName ?? "";- message.type = object.type ?? "";- message.reserved = object.reserved ?? false;- message.repeated = object.repeated ?? false;return message;},};@@ -3694,7 +3003,6 @@ function createBaseFileOptions(): FileOptions {phpNamespace: "",phpMetadataNamespace: "",rubyPackage: "",- features: undefined,uninterpretedOption: [],};}@@ -3761,9 +3069,6 @@ export const FileOptions = {if (message.rubyPackage !== "") {writer.uint32(362).string(message.rubyPackage);}- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim();- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -3917,13 +3222,6 @@ export const FileOptions = {message.rubyPackage = reader.string();continue;- case 50:- if (tag !== 402) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;case 999:if (tag !== 7994) {break;@@ -3964,7 +3262,6 @@ export const FileOptions = {phpNamespace: isSet(object.phpNamespace) ? globalThis.String(object.phpNamespace) : "",phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? globalThis.String(object.phpMetadataNamespace) : "",rubyPackage: isSet(object.rubyPackage) ? globalThis.String(object.rubyPackage) : "",- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4033,9 +3330,6 @@ export const FileOptions = {if (message.rubyPackage !== "") {obj.rubyPackage = message.rubyPackage;}- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -4067,9 +3361,6 @@ export const FileOptions = {message.phpNamespace = object.phpNamespace ?? "";message.phpMetadataNamespace = object.phpMetadataNamespace ?? "";message.rubyPackage = object.rubyPackage ?? "";- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -4082,7 +3373,6 @@ function createBaseMessageOptions(): MessageOptions {deprecated: false,mapEntry: false,deprecatedLegacyJsonFieldConflicts: false,- features: undefined,uninterpretedOption: [],};}@@ -4104,9 +3394,6 @@ export const MessageOptions = {if (message.deprecatedLegacyJsonFieldConflicts === true) {writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts);}- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(98).fork()).ldelim();- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -4155,13 +3442,6 @@ export const MessageOptions = {message.deprecatedLegacyJsonFieldConflicts = reader.bool();continue;- case 12:- if (tag !== 98) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;case 999:if (tag !== 7994) {break;@@ -4191,7 +3471,6 @@ export const MessageOptions = {deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts): false,- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4215,9 +3494,6 @@ export const MessageOptions = {if (message.deprecatedLegacyJsonFieldConflicts === true) {obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;}- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -4234,9 +3510,6 @@ export const MessageOptions = {message.deprecated = object.deprecated ?? false;message.mapEntry = object.mapEntry ?? false;message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false;- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -4253,9 +3526,7 @@ function createBaseFieldOptions(): FieldOptions {weak: false,debugRedact: false,retention: 0,- targets: [],- editionDefaults: [],- features: undefined,+ target: 0,uninterpretedOption: [],};}@@ -4289,16 +3560,8 @@ export const FieldOptions = {if (message.retention !== 0) {writer.uint32(136).int32(message.retention);}- writer.uint32(154).fork();- for (const v of message.targets) {- writer.int32(v);- }- writer.ldelim();- for (const v of message.editionDefaults) {- FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).ldelim();- }- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(170).fork()).ldelim();+ if (message.target !== 0) {+ writer.uint32(144).int32(message.target);}for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();@@ -4376,36 +3639,12 @@ export const FieldOptions = {message.retention = reader.int32() as any;continue;- case 19:- if (tag === 152) {- message.targets.push(reader.int32() as any);-- continue;- }-- if (tag === 154) {- const end2 = reader.uint32() + reader.pos;- while (reader.pos < end2) {- message.targets.push(reader.int32() as any);- }-- continue;- }-- break;- case 20:- if (tag !== 162) {- break;- }-- message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32()));- continue;- case 21:- if (tag !== 170) {+ case 18:+ if (tag !== 144) {break;}- message.features = FeatureSet.decode(reader, reader.uint32());+ message.target = reader.int32() as any;continue;case 999:if (tag !== 7994) {@@ -4434,13 +3673,7 @@ export const FieldOptions = {weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false,debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false,retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0,- targets: globalThis.Array.isArray(object?.targets)- ? object.targets.map((e: any) => fieldOptions_OptionTargetTypeFromJSON(e))- : [],- editionDefaults: globalThis.Array.isArray(object?.editionDefaults)- ? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e))- : [],- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,+ target: isSet(object.target) ? fieldOptions_OptionTargetTypeFromJSON(object.target) : 0,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4476,14 +3709,8 @@ export const FieldOptions = {if (message.retention !== 0) {obj.retention = fieldOptions_OptionRetentionToJSON(message.retention);}- if (message.targets?.length) {- obj.targets = message.targets.map((e) => fieldOptions_OptionTargetTypeToJSON(e));- }- if (message.editionDefaults?.length) {- obj.editionDefaults = message.editionDefaults.map((e) => FieldOptions_EditionDefault.toJSON(e));- }- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);+ if (message.target !== 0) {+ obj.target = fieldOptions_OptionTargetTypeToJSON(message.target);}if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));@@ -4505,99 +3732,18 @@ export const FieldOptions = {message.weak = object.weak ?? false;message.debugRedact = object.debugRedact ?? false;message.retention = object.retention ?? 0;- message.targets = object.targets?.map((e) => e) || [];- message.editionDefaults = object.editionDefaults?.map((e) => FieldOptions_EditionDefault.fromPartial(e)) || [];- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;+ message.target = object.target ?? 0;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},};-function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault {- return { edition: 0, value: "" };-}--export const FieldOptions_EditionDefault = {- encode(message: FieldOptions_EditionDefault, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.edition !== 0) {- writer.uint32(24).int32(message.edition);- }- if (message.value !== "") {- writer.uint32(18).string(message.value);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions_EditionDefault {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseFieldOptions_EditionDefault();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 3:- if (tag !== 24) {- break;- }-- message.edition = reader.int32() as any;- continue;- case 2:- if (tag !== 18) {- break;- }-- message.value = reader.string();- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): FieldOptions_EditionDefault {- return {- edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0,- value: isSet(object.value) ? globalThis.String(object.value) : "",- };- },-- toJSON(message: FieldOptions_EditionDefault): unknown {- const obj: any = {};- if (message.edition !== 0) {- obj.edition = editionToJSON(message.edition);- }- if (message.value !== "") {- obj.value = message.value;- }- return obj;- },-- create(base?: DeepPartial<FieldOptions_EditionDefault>): FieldOptions_EditionDefault {- return FieldOptions_EditionDefault.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<FieldOptions_EditionDefault>): FieldOptions_EditionDefault {- const message = createBaseFieldOptions_EditionDefault();- message.edition = object.edition ?? 0;- message.value = object.value ?? "";- return message;- },-};-function createBaseOneofOptions(): OneofOptions {- return { features: undefined, uninterpretedOption: [] };+ return { uninterpretedOption: [] };}export const OneofOptions = {encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(10).fork()).ldelim();- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -4611,13 +3757,6 @@ export const OneofOptions = {while (reader.pos < end) {const tag = reader.uint32();switch (tag >>> 3) {- case 1:- if (tag !== 10) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;case 999:if (tag !== 7994) {break;@@ -4636,7 +3775,6 @@ export const OneofOptions = {fromJSON(object: any): OneofOptions {return {- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4645,9 +3783,6 @@ export const OneofOptions = {toJSON(message: OneofOptions): unknown {const obj: any = {};- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -4659,22 +3794,13 @@ export const OneofOptions = {},fromPartial(object: DeepPartial<OneofOptions>): OneofOptions {const message = createBaseOneofOptions();- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},};function createBaseEnumOptions(): EnumOptions {- return {- allowAlias: false,- deprecated: false,- deprecatedLegacyJsonFieldConflicts: false,- features: undefined,- uninterpretedOption: [],- };+ return { allowAlias: false, deprecated: false, deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [] };}export const EnumOptions = {@@ -4688,9 +3814,6 @@ export const EnumOptions = {if (message.deprecatedLegacyJsonFieldConflicts === true) {writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts);}- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(58).fork()).ldelim();- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -4725,13 +3848,6 @@ export const EnumOptions = {message.deprecatedLegacyJsonFieldConflicts = reader.bool();continue;- case 7:- if (tag !== 58) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;case 999:if (tag !== 7994) {break;@@ -4755,7 +3871,6 @@ export const EnumOptions = {deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts): false,- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4773,9 +3888,6 @@ export const EnumOptions = {if (message.deprecatedLegacyJsonFieldConflicts === true) {obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;}- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -4790,16 +3902,13 @@ export const EnumOptions = {message.allowAlias = object.allowAlias ?? false;message.deprecated = object.deprecated ?? false;message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false;- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},};function createBaseEnumValueOptions(): EnumValueOptions {- return { deprecated: false, features: undefined, debugRedact: false, uninterpretedOption: [] };+ return { deprecated: false, uninterpretedOption: [] };}export const EnumValueOptions = {@@ -4807,12 +3916,6 @@ export const EnumValueOptions = {if (message.deprecated === true) {writer.uint32(8).bool(message.deprecated);}- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim();- }- if (message.debugRedact === true) {- writer.uint32(24).bool(message.debugRedact);- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -4833,20 +3936,6 @@ export const EnumValueOptions = {message.deprecated = reader.bool();continue;- case 2:- if (tag !== 18) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;- case 3:- if (tag !== 24) {- break;- }-- message.debugRedact = reader.bool();- continue;case 999:if (tag !== 7994) {break;@@ -4866,8 +3955,6 @@ export const EnumValueOptions = {fromJSON(object: any): EnumValueOptions {return {deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,- debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4879,12 +3966,6 @@ export const EnumValueOptions = {if (message.deprecated === true) {obj.deprecated = message.deprecated;}- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }- if (message.debugRedact === true) {- obj.debugRedact = message.debugRedact;- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -4897,24 +3978,17 @@ export const EnumValueOptions = {fromPartial(object: DeepPartial<EnumValueOptions>): EnumValueOptions {const message = createBaseEnumValueOptions();message.deprecated = object.deprecated ?? false;- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;- message.debugRedact = object.debugRedact ?? false;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},};function createBaseServiceOptions(): ServiceOptions {- return { features: undefined, deprecated: false, uninterpretedOption: [] };+ return { deprecated: false, uninterpretedOption: [] };}export const ServiceOptions = {encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(274).fork()).ldelim();- }if (message.deprecated === true) {writer.uint32(264).bool(message.deprecated);}@@ -4931,13 +4005,6 @@ export const ServiceOptions = {while (reader.pos < end) {const tag = reader.uint32();switch (tag >>> 3) {- case 34:- if (tag !== 274) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;case 33:if (tag !== 264) {break;@@ -4963,7 +4030,6 @@ export const ServiceOptions = {fromJSON(object: any): ServiceOptions {return {- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))@@ -4973,9 +4039,6 @@ export const ServiceOptions = {toJSON(message: ServiceOptions): unknown {const obj: any = {};- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }if (message.deprecated === true) {obj.deprecated = message.deprecated;}@@ -4990,9 +4053,6 @@ export const ServiceOptions = {},fromPartial(object: DeepPartial<ServiceOptions>): ServiceOptions {const message = createBaseServiceOptions();- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;message.deprecated = object.deprecated ?? false;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;@@ -5000,7 +4060,7 @@ export const ServiceOptions = {};function createBaseMethodOptions(): MethodOptions {- return { deprecated: false, idempotencyLevel: 0, features: undefined, uninterpretedOption: [] };+ return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] };}export const MethodOptions = {@@ -5011,9 +4071,6 @@ export const MethodOptions = {if (message.idempotencyLevel !== 0) {writer.uint32(272).int32(message.idempotencyLevel);}- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(282).fork()).ldelim();- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -5041,13 +4098,6 @@ export const MethodOptions = {message.idempotencyLevel = reader.int32() as any;continue;- case 35:- if (tag !== 282) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;case 999:if (tag !== 7994) {break;@@ -5070,7 +4120,6 @@ export const MethodOptions = {idempotencyLevel: isSet(object.idempotencyLevel)? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel): 0,- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -5085,9 +4134,6 @@ export const MethodOptions = {if (message.idempotencyLevel !== 0) {obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel);}- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -5101,9 +4147,6 @@ export const MethodOptions = {const message = createBaseMethodOptions();message.deprecated = object.deprecated ?? false;message.idempotencyLevel = object.idempotencyLevel ?? 0;- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -5346,318 +4389,6 @@ export const UninterpretedOption_NamePart = {},};-function createBaseFeatureSet(): FeatureSet {- return {- fieldPresence: 0,- enumType: 0,- repeatedFieldEncoding: 0,- utf8Validation: 0,- messageEncoding: 0,- jsonFormat: 0,- };-}--export const FeatureSet = {- encode(message: FeatureSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.fieldPresence !== 0) {- writer.uint32(8).int32(message.fieldPresence);- }- if (message.enumType !== 0) {- writer.uint32(16).int32(message.enumType);- }- if (message.repeatedFieldEncoding !== 0) {- writer.uint32(24).int32(message.repeatedFieldEncoding);- }- if (message.utf8Validation !== 0) {- writer.uint32(32).int32(message.utf8Validation);- }- if (message.messageEncoding !== 0) {- writer.uint32(40).int32(message.messageEncoding);- }- if (message.jsonFormat !== 0) {- writer.uint32(48).int32(message.jsonFormat);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): FeatureSet {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseFeatureSet();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 8) {- break;- }-- message.fieldPresence = reader.int32() as any;- continue;- case 2:- if (tag !== 16) {- break;- }-- message.enumType = reader.int32() as any;- continue;- case 3:- if (tag !== 24) {- break;- }-- message.repeatedFieldEncoding = reader.int32() as any;- continue;- case 4:- if (tag !== 32) {- break;- }-- message.utf8Validation = reader.int32() as any;- continue;- case 5:- if (tag !== 40) {- break;- }-- message.messageEncoding = reader.int32() as any;- continue;- case 6:- if (tag !== 48) {- break;- }-- message.jsonFormat = reader.int32() as any;- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): FeatureSet {- return {- fieldPresence: isSet(object.fieldPresence) ? featureSet_FieldPresenceFromJSON(object.fieldPresence) : 0,- enumType: isSet(object.enumType) ? featureSet_EnumTypeFromJSON(object.enumType) : 0,- repeatedFieldEncoding: isSet(object.repeatedFieldEncoding)- ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding)- : 0,- utf8Validation: isSet(object.utf8Validation) ? featureSet_Utf8ValidationFromJSON(object.utf8Validation) : 0,- messageEncoding: isSet(object.messageEncoding) ? featureSet_MessageEncodingFromJSON(object.messageEncoding) : 0,- jsonFormat: isSet(object.jsonFormat) ? featureSet_JsonFormatFromJSON(object.jsonFormat) : 0,- };- },-- toJSON(message: FeatureSet): unknown {- const obj: any = {};- if (message.fieldPresence !== 0) {- obj.fieldPresence = featureSet_FieldPresenceToJSON(message.fieldPresence);- }- if (message.enumType !== 0) {- obj.enumType = featureSet_EnumTypeToJSON(message.enumType);- }- if (message.repeatedFieldEncoding !== 0) {- obj.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingToJSON(message.repeatedFieldEncoding);- }- if (message.utf8Validation !== 0) {- obj.utf8Validation = featureSet_Utf8ValidationToJSON(message.utf8Validation);- }- if (message.messageEncoding !== 0) {- obj.messageEncoding = featureSet_MessageEncodingToJSON(message.messageEncoding);- }- if (message.jsonFormat !== 0) {- obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat);- }- return obj;- },-- create(base?: DeepPartial<FeatureSet>): FeatureSet {- return FeatureSet.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<FeatureSet>): FeatureSet {- const message = createBaseFeatureSet();- message.fieldPresence = object.fieldPresence ?? 0;- message.enumType = object.enumType ?? 0;- message.repeatedFieldEncoding = object.repeatedFieldEncoding ?? 0;- message.utf8Validation = object.utf8Validation ?? 0;- message.messageEncoding = object.messageEncoding ?? 0;- message.jsonFormat = object.jsonFormat ?? 0;- return message;- },-};--function createBaseFeatureSetDefaults(): FeatureSetDefaults {- return { defaults: [], minimumEdition: 0, maximumEdition: 0 };-}--export const FeatureSetDefaults = {- encode(message: FeatureSetDefaults, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- for (const v of message.defaults) {- FeatureSetDefaults_FeatureSetEditionDefault.encode(v!, writer.uint32(10).fork()).ldelim();- }- if (message.minimumEdition !== 0) {- writer.uint32(32).int32(message.minimumEdition);- }- if (message.maximumEdition !== 0) {- writer.uint32(40).int32(message.maximumEdition);- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): FeatureSetDefaults {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseFeatureSetDefaults();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 10) {- break;- }-- message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.decode(reader, reader.uint32()));- continue;- case 4:- if (tag !== 32) {- break;- }-- message.minimumEdition = reader.int32() as any;- continue;- case 5:- if (tag !== 40) {- break;- }-- message.maximumEdition = reader.int32() as any;- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): FeatureSetDefaults {- return {- defaults: globalThis.Array.isArray(object?.defaults)- ? object.defaults.map((e: any) => FeatureSetDefaults_FeatureSetEditionDefault.fromJSON(e))- : [],- minimumEdition: isSet(object.minimumEdition) ? editionFromJSON(object.minimumEdition) : 0,- maximumEdition: isSet(object.maximumEdition) ? editionFromJSON(object.maximumEdition) : 0,- };- },-- toJSON(message: FeatureSetDefaults): unknown {- const obj: any = {};- if (message.defaults?.length) {- obj.defaults = message.defaults.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.toJSON(e));- }- if (message.minimumEdition !== 0) {- obj.minimumEdition = editionToJSON(message.minimumEdition);- }- if (message.maximumEdition !== 0) {- obj.maximumEdition = editionToJSON(message.maximumEdition);- }- return obj;- },-- create(base?: DeepPartial<FeatureSetDefaults>): FeatureSetDefaults {- return FeatureSetDefaults.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<FeatureSetDefaults>): FeatureSetDefaults {- const message = createBaseFeatureSetDefaults();- message.defaults = object.defaults?.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(e)) || [];- message.minimumEdition = object.minimumEdition ?? 0;- message.maximumEdition = object.maximumEdition ?? 0;- return message;- },-};--function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault {- return { edition: 0, features: undefined };-}--export const FeatureSetDefaults_FeatureSetEditionDefault = {- encode(message: FeatureSetDefaults_FeatureSetEditionDefault, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.edition !== 0) {- writer.uint32(24).int32(message.edition);- }- if (message.features !== undefined) {- FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim();- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): FeatureSetDefaults_FeatureSetEditionDefault {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 3:- if (tag !== 24) {- break;- }-- message.edition = reader.int32() as any;- continue;- case 2:- if (tag !== 18) {- break;- }-- message.features = FeatureSet.decode(reader, reader.uint32());- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): FeatureSetDefaults_FeatureSetEditionDefault {- return {- edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0,- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,- };- },-- toJSON(message: FeatureSetDefaults_FeatureSetEditionDefault): unknown {- const obj: any = {};- if (message.edition !== 0) {- obj.edition = editionToJSON(message.edition);- }- if (message.features !== undefined) {- obj.features = FeatureSet.toJSON(message.features);- }- return obj;- },-- create(base?: DeepPartial<FeatureSetDefaults_FeatureSetEditionDefault>): FeatureSetDefaults_FeatureSetEditionDefault {- return FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(base ?? {});- },- fromPartial(- object: DeepPartial<FeatureSetDefaults_FeatureSetEditionDefault>,- ): FeatureSetDefaults_FeatureSetEditionDefault {- const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault();- message.edition = object.edition ?? 0;- message.features = (object.features !== undefined && object.features !== null)- ? FeatureSet.fromPartial(object.features)- : undefined;- return message;- },-};-function createBaseSourceCodeInfo(): SourceCodeInfo {return { location: [] };}diff --git a/frontend/src/types/proto/store/plan_check_run.ts b/frontend/src/types/proto/store/plan_check_run.tsindex 226ed20ff8..90d6d4357d 100644--- a/frontend/src/types/proto/store/plan_check_run.ts+++ b/frontend/src/types/proto/store/plan_check_run.ts@@ -13,6 +13,8 @@ export interface PlanCheckRunConfig {/** database_group_uid is optional. If it's set, it means the database is part of a database group. */databaseGroupUid?: Long | undefined;ghostFlags: { [key: string]: string };+ /** If set, a backup of the modified data will be created automatically before any changes are applied. */+ preUpdateBackupDetail?: PlanCheckRunConfig_PreUpdateBackupDetail | undefined;}export enum PlanCheckRunConfig_ChangeDatabaseType {@@ -71,6 +73,14 @@ export interface PlanCheckRunConfig_GhostFlagsEntry {value: string;}+export interface PlanCheckRunConfig_PreUpdateBackupDetail {+ /**+ * The database for keeping the backup data.+ * Format: instances/{instance}/databases/{database}+ */+ database: string;+}+export interface PlanCheckRunResult {results: PlanCheckRunResult_Result[];error: string;@@ -154,6 +164,7 @@ function createBasePlanCheckRunConfig(): PlanCheckRunConfig {databaseName: "",databaseGroupUid: undefined,ghostFlags: {},+ preUpdateBackupDetail: undefined,};}@@ -177,6 +188,9 @@ export const PlanCheckRunConfig = {Object.entries(message.ghostFlags).forEach(([key, value]) => {PlanCheckRunConfig_GhostFlagsEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).ldelim();});+ if (message.preUpdateBackupDetail !== undefined) {+ PlanCheckRunConfig_PreUpdateBackupDetail.encode(message.preUpdateBackupDetail, writer.uint32(58).fork()).ldelim();+ }return writer;},@@ -232,6 +246,13 @@ export const PlanCheckRunConfig = {message.ghostFlags[entry6.key] = entry6.value;}continue;+ case 7:+ if (tag !== 58) {+ break;+ }++ message.preUpdateBackupDetail = PlanCheckRunConfig_PreUpdateBackupDetail.decode(reader, reader.uint32());+ continue;}if ((tag & 7) === 4 || tag === 0) {break;@@ -256,6 +277,9 @@ export const PlanCheckRunConfig = {return acc;}, {}): {},+ preUpdateBackupDetail: isSet(object.preUpdateBackupDetail)+ ? PlanCheckRunConfig_PreUpdateBackupDetail.fromJSON(object.preUpdateBackupDetail)+ : undefined,};},@@ -285,6 +309,9 @@ export const PlanCheckRunConfig = {});}}+ if (message.preUpdateBackupDetail !== undefined) {+ obj.preUpdateBackupDetail = PlanCheckRunConfig_PreUpdateBackupDetail.toJSON(message.preUpdateBackupDetail);+ }return obj;},@@ -309,6 +336,10 @@ export const PlanCheckRunConfig = {},{},);+ message.preUpdateBackupDetail =+ (object.preUpdateBackupDetail !== undefined && object.preUpdateBackupDetail !== null)+ ? PlanCheckRunConfig_PreUpdateBackupDetail.fromPartial(object.preUpdateBackupDetail)+ : undefined;return message;},};@@ -387,6 +418,63 @@ export const PlanCheckRunConfig_GhostFlagsEntry = {},};+function createBasePlanCheckRunConfig_PreUpdateBackupDetail(): PlanCheckRunConfig_PreUpdateBackupDetail {+ return { database: "" };+}++export const PlanCheckRunConfig_PreUpdateBackupDetail = {+ encode(message: PlanCheckRunConfig_PreUpdateBackupDetail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.database !== "") {+ writer.uint32(10).string(message.database);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_PreUpdateBackupDetail {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBasePlanCheckRunConfig_PreUpdateBackupDetail();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.database = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): PlanCheckRunConfig_PreUpdateBackupDetail {+ return { database: isSet(object.database) ? globalThis.String(object.database) : "" };+ },++ toJSON(message: PlanCheckRunConfig_PreUpdateBackupDetail): unknown {+ const obj: any = {};+ if (message.database !== "") {+ obj.database = message.database;+ }+ return obj;+ },++ create(base?: DeepPartial<PlanCheckRunConfig_PreUpdateBackupDetail>): PlanCheckRunConfig_PreUpdateBackupDetail {+ return PlanCheckRunConfig_PreUpdateBackupDetail.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<PlanCheckRunConfig_PreUpdateBackupDetail>): PlanCheckRunConfig_PreUpdateBackupDetail {+ const message = createBasePlanCheckRunConfig_PreUpdateBackupDetail();+ message.database = object.database ?? "";+ return message;+ },+};+function createBasePlanCheckRunResult(): PlanCheckRunResult {return { results: [], error: "" };}diff --git a/frontend/src/types/sql-review-schema.yaml b/frontend/src/types/sql-review-schema.yamlindex 7965f402d7..065ee0ef54 100644--- a/frontend/src/types/sql-review-schema.yaml+++ b/frontend/src/types/sql-review-schema.yaml@@ -302,7 +302,7 @@ ruleList:engineList:- MYSQL- TIDB- - type: statement.disallow-mix-ddl-dml+ - type: statement.prior-backup-checkcategory: STATEMENTengineList:- MYSQLdiff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 682cffeecf..4c83d23ae2 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -132,6 +132,7 @@- [store/plan_check_run.proto](#store_plan_check_run-proto)- [PlanCheckRunConfig](#bytebase-store-PlanCheckRunConfig)- [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry)+ - [PlanCheckRunConfig.PreUpdateBackupDetail](#bytebase-store-PlanCheckRunConfig-PreUpdateBackupDetail)- [PlanCheckRunResult](#bytebase-store-PlanCheckRunResult)- [PlanCheckRunResult.Result](#bytebase-store-PlanCheckRunResult-Result)- [PlanCheckRunResult.Result.SqlReviewReport](#bytebase-store-PlanCheckRunResult-Result-SqlReviewReport)@@ -2099,6 +2100,7 @@ Type is the database change type.| database_name | [string](#string) | | || database_group_uid | [int64](#int64) | optional | database_group_uid is optional. If it's set, it means the database is part of a database group. || ghost_flags | [PlanCheckRunConfig.GhostFlagsEntry](#bytebase-store-PlanCheckRunConfig-GhostFlagsEntry) | repeated | |+| pre_update_backup_detail | [PlanCheckRunConfig.PreUpdateBackupDetail](#bytebase-store-PlanCheckRunConfig-PreUpdateBackupDetail) | optional | If set, a backup of the modified data will be created automatically before any changes are applied. |@@ -2121,6 +2123,21 @@ Type is the database change type.+<a name="bytebase-store-PlanCheckRunConfig-PreUpdateBackupDetail"></a>++### PlanCheckRunConfig.PreUpdateBackupDetail++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| database | [string](#string) | | The database for keeping the backup data. Format: instances/{instance}/databases/{database} |++++++<a name="bytebase-store-PlanCheckRunResult"></a>### PlanCheckRunResultdiff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 036f34606b..78d67b2b9e 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -701,6 +701,10 @@<a href="#bytebase.store.PlanCheckRunConfig.GhostFlagsEntry"><span class="badge">M</span>PlanCheckRunConfig.GhostFlagsEntry</a></li>+ <li>+ <a href="#bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail"><span class="badge">M</span>PlanCheckRunConfig.PreUpdateBackupDetail</a>+ </li>+<li><a href="#bytebase.store.PlanCheckRunResult"><span class="badge">M</span>PlanCheckRunResult</a></li>@@ -5542,6 +5546,13 @@ Use a generated title if empty. </p></td><td><p> </p></td></tr>+ <tr>+ <td>pre_update_backup_detail</td>+ <td><a href="#bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail">PlanCheckRunConfig.PreUpdateBackupDetail</a></td>+ <td>optional</td>+ <td><p>If set, a backup of the modified data will be created automatically before any changes are applied. </p></td>+ </tr>+</tbody></table>@@ -5580,6 +5591,31 @@ Use a generated title if empty. </p></td>+ <h3 id="bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail">PlanCheckRunConfig.PreUpdateBackupDetail</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>database</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The database for keeping the backup data.+Format: instances/{instance}/databases/{database} </p></td>+ </tr>++ </tbody>+ </table>+++++<h3 id="bytebase.store.PlanCheckRunResult">PlanCheckRunResult</h3><p></p>diff --git a/proto/generated-go/store/plan_check_run.pb.go b/proto/generated-go/store/plan_check_run.pb.goindex 5e344a2725..c67235bcdb 100644--- a/proto/generated-go/store/plan_check_run.pb.go+++ b/proto/generated-go/store/plan_check_run.pb.go@@ -139,6 +139,8 @@ type PlanCheckRunConfig struct {// database_group_uid is optional. If it's set, it means the database is part of a database group.DatabaseGroupUid *int64 `protobuf:"varint,5,opt,name=database_group_uid,json=databaseGroupUid,proto3,oneof" json:"database_group_uid,omitempty"`GhostFlags map[string]string `protobuf:"bytes,6,rep,name=ghost_flags,json=ghostFlags,proto3" json:"ghost_flags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`+ // If set, a backup of the modified data will be created automatically before any changes are applied.+ PreUpdateBackupDetail *PlanCheckRunConfig_PreUpdateBackupDetail `protobuf:"bytes,7,opt,name=pre_update_backup_detail,json=preUpdateBackupDetail,proto3,oneof" json:"pre_update_backup_detail,omitempty"`}func (x *PlanCheckRunConfig) Reset() {@@ -215,6 +217,13 @@ func (x *PlanCheckRunConfig) GetGhostFlags() map[string]string {return nil}+func (x *PlanCheckRunConfig) GetPreUpdateBackupDetail() *PlanCheckRunConfig_PreUpdateBackupDetail {+ if x != nil {+ return x.PreUpdateBackupDetail+ }+ return nil+}+type PlanCheckRunResult struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -270,6 +279,55 @@ func (x *PlanCheckRunResult) GetError() string {return ""}+type PlanCheckRunConfig_PreUpdateBackupDetail struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The database for keeping the backup data.+ // Format: instances/{instance}/databases/{database}+ Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`+}++func (x *PlanCheckRunConfig_PreUpdateBackupDetail) Reset() {+ *x = PlanCheckRunConfig_PreUpdateBackupDetail{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_plan_check_run_proto_msgTypes[3]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *PlanCheckRunConfig_PreUpdateBackupDetail) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*PlanCheckRunConfig_PreUpdateBackupDetail) ProtoMessage() {}++func (x *PlanCheckRunConfig_PreUpdateBackupDetail) ProtoReflect() protoreflect.Message {+ mi := &file_store_plan_check_run_proto_msgTypes[3]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use PlanCheckRunConfig_PreUpdateBackupDetail.ProtoReflect.Descriptor instead.+func (*PlanCheckRunConfig_PreUpdateBackupDetail) Descriptor() ([]byte, []int) {+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 1}+}++func (x *PlanCheckRunConfig_PreUpdateBackupDetail) GetDatabase() string {+ if x != nil {+ return x.Database+ }+ return ""+}+type PlanCheckRunResult_Result struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -289,7 +347,7 @@ type PlanCheckRunResult_Result struct {func (x *PlanCheckRunResult_Result) Reset() {*x = PlanCheckRunResult_Result{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[3]+ mi := &file_store_plan_check_run_proto_msgTypes[4]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -302,7 +360,7 @@ func (x *PlanCheckRunResult_Result) String() string {func (*PlanCheckRunResult_Result) ProtoMessage() {}func (x *PlanCheckRunResult_Result) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[3]+ mi := &file_store_plan_check_run_proto_msgTypes[4]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -398,7 +456,7 @@ type PlanCheckRunResult_Result_SqlSummaryReport struct {func (x *PlanCheckRunResult_Result_SqlSummaryReport) Reset() {*x = PlanCheckRunResult_Result_SqlSummaryReport{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[4]+ mi := &file_store_plan_check_run_proto_msgTypes[5]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -411,7 +469,7 @@ func (x *PlanCheckRunResult_Result_SqlSummaryReport) String() string {func (*PlanCheckRunResult_Result_SqlSummaryReport) ProtoMessage() {}func (x *PlanCheckRunResult_Result_SqlSummaryReport) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[4]+ mi := &file_store_plan_check_run_proto_msgTypes[5]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -470,7 +528,7 @@ type PlanCheckRunResult_Result_SqlReviewReport struct {func (x *PlanCheckRunResult_Result_SqlReviewReport) Reset() {*x = PlanCheckRunResult_Result_SqlReviewReport{}if protoimpl.UnsafeEnabled {- mi := &file_store_plan_check_run_proto_msgTypes[5]+ mi := &file_store_plan_check_run_proto_msgTypes[6]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -483,7 +541,7 @@ func (x *PlanCheckRunResult_Result_SqlReviewReport) String() string {func (*PlanCheckRunResult_Result_SqlReviewReport) ProtoMessage() {}func (x *PlanCheckRunResult_Result_SqlReviewReport) ProtoReflect() protoreflect.Message {- mi := &file_store_plan_check_run_proto_msgTypes[5]+ mi := &file_store_plan_check_run_proto_msgTypes[6]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -535,7 +593,7 @@ var file_store_plan_check_run_proto_rawDesc = []byte{0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x23, 0x73, 0x74,0x6f, 0x72, 0x65, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61,0x6e, 0x67, 0x65, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,- 0x6f, 0x22, 0xa6, 0x04, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,+ 0x6f, 0x22, 0xf0, 0x05, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x65, 0x65,0x74, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x68, 0x65,0x65, 0x74, 0x55, 0x69, 0x64, 0x12, 0x67, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f,@@ -557,75 +615,88 @@ var file_store_plan_check_run_proto_rawDesc = []byte{0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66,0x69, 0x67, 0x2e, 0x47, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74,- 0x72, 0x79, 0x52, 0x0a, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x1a, 0x3d,- 0x0a, 0x0f, 0x47, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72,- 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,- 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x64, 0x0a,- 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54,- 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41,- 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,- 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c,- 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53,- 0x44, 0x4c, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x44, 0x4c, 0x5f, 0x47, 0x48, 0x4f, 0x53,- 0x54, 0x10, 0x04, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,- 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69, 0x64, 0x22, 0xdf, 0x06, 0x0a, 0x12, 0x50,- 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c,- 0x74, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03,- 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,- 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e,- 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72,- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xed, 0x05, 0x0a,- 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,- 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,- 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75,- 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,- 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,- 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,- 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,- 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d,- 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,- 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,- 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52,- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c,- 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52,- 0x10, 0x73, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72,- 0x74, 0x12, 0x67, 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f,- 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62,+ 0x72, 0x79, 0x52, 0x0a, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x76,+ 0x0a, 0x18, 0x70, 0x72, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63,+ 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b,+ 0x32, 0x38, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,+ 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f,+ 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61,+ 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x48, 0x01, 0x52, 0x15, 0x70, 0x72,+ 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74,+ 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x47, 0x68, 0x6f, 0x73, 0x74, 0x46,+ 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,+ 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,+ 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x33, 0x0a, 0x15, 0x50, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x1a,+ 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x22, 0x64, 0x0a, 0x12, 0x43, 0x68,+ 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65,+ 0x12, 0x24, 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42,+ 0x41, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12,+ 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44, 0x4c, 0x10,+ 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x44, 0x4c, 0x5f, 0x47, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x04,+ 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72,+ 0x6f, 0x75, 0x70, 0x5f, 0x75, 0x69, 0x64, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x70, 0x72, 0x65, 0x5f,+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x65,+ 0x74, 0x61, 0x69, 0x6c, 0x22, 0xdf, 0x06, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,+ 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x72,+ 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62,0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c,0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,- 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65,- 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65,- 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53,- 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12,- 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63,- 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74,- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74,- 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d,- 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20,- 0x01, 0x28, 0x05, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77,- 0x73, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73,- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62,- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68,- 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10,- 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,- 0x1a, 0x69, 0x0a, 0x0f, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70,- 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,- 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d,- 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12,- 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,- 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53,- 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a,- 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e,- 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53,- 0x10, 0x03, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12,- 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f,- 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+ 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73,+ 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xed, 0x05, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c,+ 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,+ 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,+ 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52,+ 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61,+ 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74,+ 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c,+ 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63,+ 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,+ 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72,+ 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61,+ 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e,+ 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72,+ 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x10, 0x73, 0x71, 0x6c, 0x53, 0x75,+ 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x67, 0x0a, 0x11, 0x73,+ 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74,+ 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63,+ 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c,+ 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72,+ 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65,+ 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xc3, 0x01, 0x0a, 0x10, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d,+ 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a,+ 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73,+ 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e,+ 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74,+ 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x61,+ 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x4d, 0x0a, 0x11, 0x63,+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52,+ 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,+ 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x69, 0x0a, 0x0f, 0x53, 0x71,+ 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a,+ 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x69, 0x6e,+ 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,+ 0x05, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74,+ 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69,+ 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,+ 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,+ 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52,+ 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12,+ 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x42, 0x08, 0x0a, 0x06,+ 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,+ 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72,+ 0x6f, 0x74, 0x6f, 0x33,}var (@@ -641,31 +712,33 @@ func file_store_plan_check_run_proto_rawDescGZIP() []byte {}var file_store_plan_check_run_proto_enumTypes = make([]protoimpl.EnumInfo, 2)-var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 6)+var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 7)var file_store_plan_check_run_proto_goTypes = []interface{}{(PlanCheckRunConfig_ChangeDatabaseType)(0), // 0: bytebase.store.PlanCheckRunConfig.ChangeDatabaseType(PlanCheckRunResult_Result_Status)(0), // 1: bytebase.store.PlanCheckRunResult.Result.Status(*PlanCheckRunConfig)(nil), // 2: bytebase.store.PlanCheckRunConfig(*PlanCheckRunResult)(nil), // 3: bytebase.store.PlanCheckRunResultnil, // 4: bytebase.store.PlanCheckRunConfig.GhostFlagsEntry- (*PlanCheckRunResult_Result)(nil), // 5: bytebase.store.PlanCheckRunResult.Result- (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 6: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport- (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport- (*ChangedResources)(nil), // 8: bytebase.store.ChangedResources+ (*PlanCheckRunConfig_PreUpdateBackupDetail)(nil), // 5: bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail+ (*PlanCheckRunResult_Result)(nil), // 6: bytebase.store.PlanCheckRunResult.Result+ (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport+ (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 8: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport+ (*ChangedResources)(nil), // 9: bytebase.store.ChangedResources}var file_store_plan_check_run_proto_depIdxs = []int32{0, // 0: bytebase.store.PlanCheckRunConfig.change_database_type:type_name -> bytebase.store.PlanCheckRunConfig.ChangeDatabaseType4, // 1: bytebase.store.PlanCheckRunConfig.ghost_flags:type_name -> bytebase.store.PlanCheckRunConfig.GhostFlagsEntry- 5, // 2: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result- 1, // 3: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status- 6, // 4: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport- 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport- 8, // 6: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources- 7, // [7:7] is the sub-list for method output_type- 7, // [7:7] is the sub-list for method input_type- 7, // [7:7] is the sub-list for extension type_name- 7, // [7:7] is the sub-list for extension extendee- 0, // [0:7] is the sub-list for field type_name+ 5, // 2: bytebase.store.PlanCheckRunConfig.pre_update_backup_detail:type_name -> bytebase.store.PlanCheckRunConfig.PreUpdateBackupDetail+ 6, // 3: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result+ 1, // 4: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status+ 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport+ 8, // 6: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport+ 9, // 7: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.store.ChangedResources+ 8, // [8:8] is the sub-list for method output_type+ 8, // [8:8] is the sub-list for method input_type+ 8, // [8:8] is the sub-list for extension type_name+ 8, // [8:8] is the sub-list for extension extendee+ 0, // [0:8] is the sub-list for field type_name}func init() { file_store_plan_check_run_proto_init() }@@ -700,7 +773,7 @@ func file_store_plan_check_run_proto_init() {}}file_store_plan_check_run_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*PlanCheckRunResult_Result); i {+ switch v := v.(*PlanCheckRunConfig_PreUpdateBackupDetail); i {case 0:return &v.statecase 1:@@ -712,7 +785,7 @@ func file_store_plan_check_run_proto_init() {}}file_store_plan_check_run_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*PlanCheckRunResult_Result_SqlSummaryReport); i {+ switch v := v.(*PlanCheckRunResult_Result); i {case 0:return &v.statecase 1:@@ -724,6 +797,18 @@ func file_store_plan_check_run_proto_init() {}}file_store_plan_check_run_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*PlanCheckRunResult_Result_SqlSummaryReport); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_store_plan_check_run_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*PlanCheckRunResult_Result_SqlReviewReport); i {case 0:return &v.state@@ -737,7 +822,7 @@ func file_store_plan_check_run_proto_init() {}}file_store_plan_check_run_proto_msgTypes[0].OneofWrappers = []interface{}{}- file_store_plan_check_run_proto_msgTypes[3].OneofWrappers = []interface{}{+ file_store_plan_check_run_proto_msgTypes[4].OneofWrappers = []interface{}{(*PlanCheckRunResult_Result_SqlSummaryReport_)(nil),(*PlanCheckRunResult_Result_SqlReviewReport_)(nil),}@@ -747,7 +832,7 @@ func file_store_plan_check_run_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_store_plan_check_run_proto_rawDesc,NumEnums: 2,- NumMessages: 6,+ NumMessages: 7,NumExtensions: 0,NumServices: 0,},diff --git a/proto/store/plan_check_run.proto b/proto/store/plan_check_run.protoindex f7f22b94ed..8a9289f888 100644--- a/proto/store/plan_check_run.proto+++ b/proto/store/plan_check_run.proto@@ -16,6 +16,14 @@ message PlanCheckRunConfig {map<string, string> ghost_flags = 6;+ message PreUpdateBackupDetail {+ // The database for keeping the backup data.+ // Format: instances/{instance}/databases/{database}+ string database = 1;+ }+ // If set, a backup of the modified data will be created automatically before any changes are applied.+ optional PreUpdateBackupDetail pre_update_backup_detail = 7;+enum ChangeDatabaseType {CHANGE_DATABASE_TYPE_UNSPECIFIED = 0;DDL = 1;