Skip to content

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

chore: move instance proto (#15407)

Danny Xu5f350cca2dd2
diff --git a/backend/api/lsp/handler.go b/backend/api/lsp/handler.go
index f9d57e49fa..3f9ddcaea7 100644
--- a/backend/api/lsp/handler.go
+++ b/backend/api/lsp/handler.go
@@ -154,7 +154,7 @@ func (h *Handler) getEngineType(ctx context.Context) storepb.Engine {
slog.Error("Instance not found", slog.String("instanceID", instanceID))
return storepb.Engine_ENGINE_UNSPECIFIED
}
- return instance.Engine
+ return instance.Metadata.GetEngine()
}
func (h *Handler) checkInitialized(req *jsonrpc2.Request) error {
diff --git a/backend/api/v1/database_service.go b/backend/api/v1/database_service.go
index a9654169f6..dd6c7a9b55 100644
--- a/backend/api/v1/database_service.go
+++ b/backend/api/v1/database_service.go
@@ -545,7 +545,7 @@ func (s *DatabaseService) GetDatabaseSchema(ctx context.Context, request *v1pb.G
// We only support MySQL engine for now.
schema := string(dbSchema.GetSchema())
if request.SdlFormat {
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
sdlSchema, err := transform.SchemaTransform(storepb.Engine_MYSQL, schema)
if err != nil {
@@ -664,7 +664,7 @@ func (s *DatabaseService) getParserEngine(ctx context.Context, request *v1pb.Dif
return engine, status.Errorf(codes.NotFound, "instance %q not found", instanceID)
}
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_POSTGRES:
engine = storepb.Engine_POSTGRES
case storepb.Engine_MYSQL, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
@@ -678,7 +678,7 @@ func (s *DatabaseService) getParserEngine(ctx context.Context, request *v1pb.Dif
case storepb.Engine_COCKROACHDB:
engine = storepb.Engine_COCKROACHDB
default:
- return engine, status.Errorf(codes.InvalidArgument, "invalid engine type %v", instance.Engine)
+ return engine, status.Errorf(codes.InvalidArgument, "invalid engine type %v", instance.Metadata.GetEngine())
}
return engine, nil
@@ -1314,13 +1314,13 @@ func (s *DatabaseService) AdviseIndex(ctx context.Context, request *v1pb.AdviseI
return nil, status.Errorf(codes.NotFound, "database %q not found", databaseName)
}
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_POSTGRES:
return s.pgAdviseIndex(ctx, request, database)
case storepb.Engine_MYSQL:
return s.mysqlAdviseIndex(ctx, request, instance, database)
default:
- return nil, status.Errorf(codes.InvalidArgument, "AdviseIndex is not implemented for engine: %v", instance.Engine)
+ return nil, status.Errorf(codes.InvalidArgument, "AdviseIndex is not implemented for engine: %v", instance.Metadata.GetEngine())
}
}
@@ -1332,7 +1332,7 @@ func (s *DatabaseService) mysqlAdviseIndex(ctx context.Context, request *v1pb.Ad
var schemas []*model.DatabaseSchema
// Deal with the cross database query.
- resources, err := base.ExtractResourceList(instance.Engine, database.DatabaseName, "", request.Statement)
+ resources, err := base.ExtractResourceList(instance.Metadata.GetEngine(), database.DatabaseName, "", request.Statement)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "Failed to extract resource list: %v", err)
}
diff --git a/backend/api/v1/database_service_changelog.go b/backend/api/v1/database_service_changelog.go
index f5142dcb79..89639d72fd 100644
--- a/backend/api/v1/database_service_changelog.go
+++ b/backend/api/v1/database_service_changelog.go
@@ -154,7 +154,7 @@ func (s *DatabaseService) GetChangelog(ctx context.Context, request *v1pb.GetCha
return nil, status.Errorf(codes.Internal, "failed to convert changelog, error: %v", err)
}
if request.SdlFormat {
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
sdlSchema, err := transform.SchemaTransform(storepb.Engine_MYSQL, converted.Schema)
if err != nil {
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index 96eb4b78a6..3edc166639 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -161,23 +161,21 @@ func (s *InstanceService) CreateInstance(ctx context.Context, request *v1pb.Crea
}
instanceCountLimit := s.licenseService.GetInstanceLicenseCount(ctx)
- if instanceMessage.Activation {
- if err := s.store.CheckActivationLimit(ctx, instanceCountLimit); err != nil {
- if common.ErrorCode(err) == common.Invalid {
- return nil, status.Error(codes.ResourceExhausted, err.Error())
- }
+ if instanceMessage.Metadata.GetActivation() {
+ count, err := s.store.GetActivatedInstanceCount(ctx)
+ if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
+ if count >= instanceCountLimit {
+ return nil, status.Errorf(codes.ResourceExhausted, instanceExceededError, instanceCountLimit)
+ }
}
if err := s.checkInstanceDataSources(instanceMessage, instanceMessage.Metadata.GetDataSources()); err != nil {
return nil, err
}
- instance, err := s.store.CreateInstanceV2(ctx,
- instanceMessage,
- instanceCountLimit,
- )
+ instance, err := s.store.CreateInstanceV2(ctx, instanceMessage)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -201,7 +199,7 @@ func (s *InstanceService) CreateInstance(ctx context.Context, request *v1pb.Crea
Name: metricapi.InstanceCreateMetricName,
Value: 1,
Labels: map[string]any{
- "engine": instance.Engine,
+ "engine": instance.Metadata.GetEngine(),
},
})
@@ -223,6 +221,8 @@ func (s *InstanceService) checkInstanceDataSources(instance *store.InstanceMessa
return nil
}
+var instanceExceededError = "activation instance count has reached the limit (%v)"
+
func (s *InstanceService) checkDataSource(instance *store.InstanceMessage, dataSource *storepb.DataSource) error {
if dataSource.GetId() == "" {
return status.Errorf(codes.InvalidArgument, "data source id is required")
@@ -271,10 +271,11 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
ResourceID: instance.ResourceID,
Metadata: metadata,
}
+ updateActivation := false
for _, path := range request.UpdateMask.Paths {
switch path {
case "title":
- patch.Title = &request.Instance.Title
+ patch.Metadata.Title = request.Instance.Title
case "environment":
environmentID, err := common.GetEnvironmentID(request.Instance.Environment)
if err != nil {
@@ -295,7 +296,7 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
}
patch.EnvironmentID = &environment.ResourceID
case "external_link":
- patch.ExternalLink = &request.Instance.ExternalLink
+ patch.Metadata.ExternalLink = request.Instance.ExternalLink
case "data_sources":
dataSources, err := s.convertV1DataSources(request.Instance.DataSources)
if err != nil {
@@ -306,9 +307,10 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
}
patch.Metadata.DataSources = dataSources
case "activation":
- if request.Instance.Activation != instance.Activation {
- patch.Activation = &request.Instance.Activation
+ if !instance.Metadata.GetActivation() && request.Instance.Activation {
+ updateActivation = true
}
+ patch.Metadata.Activation = request.Instance.Activation
case "sync_interval":
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureCustomInstanceSynchronization, instance); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
@@ -330,16 +332,17 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
}
instanceCountLimit := s.licenseService.GetInstanceLicenseCount(ctx)
- if v := patch.Activation; v != nil && *v {
- if err := s.store.CheckActivationLimit(ctx, instanceCountLimit); err != nil {
- if common.ErrorCode(err) == common.Invalid {
- return nil, status.Error(codes.ResourceExhausted, err.Error())
- }
+ if updateActivation {
+ count, err := s.store.GetActivatedInstanceCount(ctx)
+ if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
+ if count >= instanceCountLimit {
+ return nil, status.Errorf(codes.ResourceExhausted, instanceExceededError, instanceCountLimit)
+ }
}
- ins, err := s.store.UpdateInstanceV2(ctx, patch, instanceCountLimit)
+ ins, err := s.store.UpdateInstanceV2(ctx, patch)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -371,7 +374,7 @@ func (s *InstanceService) syncSlowQueriesForInstance(ctx context.Context, instan
}
func (s *InstanceService) syncSlowQueriesImpl(ctx context.Context, project *store.ProjectMessage, instance *store.InstanceMessage) error {
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MYSQL:
driver, err := s.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
if err != nil {
@@ -437,7 +440,7 @@ func (s *InstanceService) syncSlowQueriesImpl(ctx context.Context, project *stor
}
s.stateCfg.InstanceSlowQuerySyncChan <- message
default:
- return status.Errorf(codes.InvalidArgument, "unsupported engine %q", instance.Engine)
+ return status.Errorf(codes.InvalidArgument, "unsupported engine %q", instance.Metadata.GetEngine())
}
return nil
}
@@ -463,7 +466,7 @@ func (s *InstanceService) syncSlowQueriesForProject(ctx context.Context, project
return nil, status.Errorf(codes.Internal, "failed to get instance %q: %s", database.InstanceID, err.Error())
}
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MYSQL, storepb.Engine_POSTGRES:
if instance.Deleted {
continue
@@ -540,10 +543,16 @@ func (s *InstanceService) DeleteInstance(ctx context.Context, request *v1pb.Dele
}
}
+ metadata, ok := proto.Clone(instance.Metadata).(*storepb.Instance)
+ if !ok {
+ return nil, status.Errorf(codes.Internal, "failed to convert instance metadata type")
+ }
+ metadata.Activation = false
if _, err := s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{
ResourceID: instance.ResourceID,
Deleted: &deletePatch,
- }, -1 /* don't need to pass the instance limition */); err != nil {
+ Metadata: metadata,
+ }); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -563,7 +572,7 @@ func (s *InstanceService) UndeleteInstance(ctx context.Context, request *v1pb.Un
ins, err := s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{
ResourceID: instance.ResourceID,
Deleted: &undeletePatch,
- }, -1 /* don't need to pass the instance limition */)
+ })
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -687,7 +696,7 @@ func (s *InstanceService) AddDataSource(ctx context.Context, request *v1pb.AddDa
return nil, status.Error(codes.Internal, "failed to convert instance metadata type")
}
metadata.DataSources = append(metadata.DataSources, dataSource)
- instance, err = s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{ResourceID: instance.ResourceID, Metadata: metadata}, -1)
+ instance, err = s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{ResourceID: instance.ResourceID, Metadata: metadata})
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -849,7 +858,7 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, request *v1pb.Up
return convertInstanceMessage(instance)
}
- instance, err = s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{ResourceID: instance.ResourceID, Metadata: metadata}, -1)
+ instance, err = s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{ResourceID: instance.ResourceID, Metadata: metadata})
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -893,7 +902,7 @@ func (s *InstanceService) RemoveDataSource(ctx context.Context, request *v1pb.Re
}
metadata.DataSources = updatedDataSources
- instance, err = s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{ResourceID: instance.ResourceID, Metadata: metadata}, -1)
+ instance, err = s.store.UpdateInstanceV2(ctx, &store.UpdateInstanceMessage{ResourceID: instance.ResourceID, Metadata: metadata})
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -966,7 +975,7 @@ func buildEnvironmentName(environmentID string) string {
}
func convertInstanceMessage(instance *store.InstanceMessage) (*v1pb.Instance, error) {
- engine := convertToEngine(instance.Engine)
+ engine := convertToEngine(instance.Metadata.GetEngine())
dataSources, err := convertDataSources(instance.Metadata.GetDataSources())
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert data source with error: %v", err.Error())
@@ -974,14 +983,14 @@ func convertInstanceMessage(instance *store.InstanceMessage) (*v1pb.Instance, er
return &v1pb.Instance{
Name: buildInstanceName(instance.ResourceID),
- Title: instance.Title,
+ Title: instance.Metadata.GetTitle(),
Engine: engine,
- EngineVersion: instance.EngineVersion,
- ExternalLink: instance.ExternalLink,
+ EngineVersion: instance.Metadata.GetVersion(),
+ ExternalLink: instance.Metadata.GetExternalLink(),
DataSources: dataSources,
State: convertDeletedToState(instance.Deleted),
Environment: buildEnvironmentName(instance.EnvironmentID),
- Activation: instance.Activation,
+ Activation: instance.Metadata.GetActivation(),
SyncInterval: instance.Metadata.GetSyncInterval(),
MaximumConnections: instance.Metadata.GetMaximumConnections(),
SyncDatabases: instance.Metadata.GetSyncDatabases(),
@@ -1029,12 +1038,12 @@ func (s *InstanceService) convertInstanceToInstanceMessage(instanceID string, in
return &store.InstanceMessage{
ResourceID: instanceID,
- Title: instance.Title,
- Engine: convertEngine(instance.Engine),
- ExternalLink: instance.ExternalLink,
EnvironmentID: environmentID,
- Activation: instance.Activation,
Metadata: &storepb.Instance{
+ Title: instance.GetTitle(),
+ Engine: convertEngine(instance.Engine),
+ ExternalLink: instance.GetExternalLink(),
+ Activation: instance.GetActivation(),
DataSources: datasources,
SyncInterval: instance.GetSyncInterval(),
MaximumConnections: instance.GetMaximumConnections(),
diff --git a/backend/api/v1/predicate_columns_check.go b/backend/api/v1/predicate_columns_check.go
index 254b6e5866..8dd38eb8ed 100644
--- a/backend/api/v1/predicate_columns_check.go
+++ b/backend/api/v1/predicate_columns_check.go
@@ -64,7 +64,7 @@ func (s *QueryResultMasker) getSensitiveColumnsForPredicate(
action storepb.MaskingExceptionPolicy_MaskingException_Action,
currentPrincipal *store.UserMessage,
) ([]base.ColumnResource, error) {
- if instance != nil && !isPredicateColumnsCheckEnabled(instance.Engine) {
+ if instance != nil && !isPredicateColumnsCheckEnabled(instance.Metadata.GetEngine()) {
return nil, nil
}
diff --git a/backend/api/v1/query_result_masker.go b/backend/api/v1/query_result_masker.go
index 7e2f90b1ad..5cae9ea30f 100644
--- a/backend/api/v1/query_result_masker.go
+++ b/backend/api/v1/query_result_masker.go
@@ -130,7 +130,7 @@ func (s *QueryResultMasker) getMaskerForColumnResource(
action storepb.MaskingExceptionPolicy_MaskingException_Action,
currentPrincipal *store.UserMessage,
) (masker.Masker, error) {
- if instance != nil && !isMaskingSupported(instance.Engine) {
+ if instance != nil && !isMaskingSupported(instance.Metadata.GetEngine()) {
return masker.NewNoneMasker(), nil
}
database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
diff --git a/backend/api/v1/release_service_check.go b/backend/api/v1/release_service_check.go
index 6115b1122f..7eb68a64dd 100644
--- a/backend/api/v1/release_service_check.go
+++ b/backend/api/v1/release_service_check.go
@@ -119,7 +119,7 @@ func (s *ReleaseService) CheckRelease(ctx context.Context, request *v1pb.CheckRe
return nil, status.Errorf(codes.NotFound, "instance %q not found", database.InstanceID)
}
- catalog, err := catalog.NewCatalog(ctx, s.store, database.InstanceID, database.DatabaseName, instance.Engine, store.IsObjectCaseSensitive(instance), nil)
+ catalog, err := catalog.NewCatalog(ctx, s.store, database.InstanceID, database.DatabaseName, instance.Metadata.GetEngine(), store.IsObjectCaseSensitive(instance), nil)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create catalog: %v", err)
}
@@ -149,7 +149,7 @@ func (s *ReleaseService) CheckRelease(ctx context.Context, request *v1pb.CheckRe
}
// Check if any syntax error in the statement.
- _, syntaxAdvices := s.sheetManager.GetASTsForChecks(instance.Engine, file.Statement)
+ _, syntaxAdvices := s.sheetManager.GetASTsForChecks(instance.Metadata.GetEngine(), file.Statement)
if len(syntaxAdvices) > 0 {
for _, advice := range syntaxAdvices {
checkResult.Advices = append(checkResult.Advices, convertToV1Advice(advice))
@@ -241,7 +241,7 @@ func (s *ReleaseService) runSQLReviewCheckForFile(
changeType storepb.PlanCheckRunConfig_ChangeDatabaseType,
statement string,
) (storepb.Advice_Status, []*v1pb.Advice, error) {
- if !isSQLReviewSupported(instance.Engine) || database == nil {
+ if !isSQLReviewSupported(instance.Metadata.GetEngine()) || database == nil {
return storepb.Advice_SUCCESS, nil, nil
}
@@ -280,7 +280,7 @@ func (s *ReleaseService) runSQLReviewCheckForFile(
Collation: dbMetadata.Collation,
ChangeType: changeType,
DBSchema: dbMetadata,
- DbType: instance.Engine,
+ DbType: instance.Metadata.GetEngine(),
Catalog: catalog,
Driver: connection,
CurrentDatabase: database.DatabaseName,
@@ -374,7 +374,7 @@ func (s *ReleaseService) calculateRiskLevel(
"project_id": database.ProjectID,
"database_name": database.DatabaseName,
// convert to string type otherwise cel-go will complain that storepb.Engine is not string type.
- "db_engine": instance.Engine.String(),
+ "db_engine": instance.Metadata.GetEngine().String(),
"sql_statement": statement,
}
diff --git a/backend/api/v1/rollout_service.go b/backend/api/v1/rollout_service.go
index 7bb14f39df..5bbfc599af 100644
--- a/backend/api/v1/rollout_service.go
+++ b/backend/api/v1/rollout_service.go
@@ -363,7 +363,7 @@ func (s *RolloutService) GetTaskRunSession(ctx context.Context, request *v1pb.Ge
}
defer driver.Close(ctx)
- session, err := getSession(ctx, instance.Engine, driver.GetDB(), connID)
+ session, err := getSession(ctx, instance.Metadata.GetEngine(), driver.GetDB(), connID)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get session, error: %v", err)
}
@@ -921,7 +921,7 @@ func (s *RolloutService) PreviewTaskRunRollback(ctx context.Context, request *v1
var results []string
for _, item := range backupDetail.Items {
- restore, err := base.GenerateRestoreSQL(ctx, instance.Engine, base.RestoreContext{
+ restore, err := base.GenerateRestoreSQL(ctx, instance.Metadata.GetEngine(), base.RestoreContext{
InstanceID: instance.ResourceID,
GetDatabaseMetadataFunc: BuildGetDatabaseMetadataFunc(s.store),
ListDatabaseNamesFunc: BuildListDatabaseNamesFunc(s.store),
diff --git a/backend/api/v1/rollout_service_task.go b/backend/api/v1/rollout_service_task.go
index 78f2f7d418..98ceababb0 100644
--- a/backend/api/v1/rollout_service_task.go
+++ b/backend/api/v1/rollout_service_task.go
@@ -142,7 +142,7 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
if err != nil {
return nil, err
}
- if instance.Engine == storepb.Engine_ORACLE || instance.Engine == storepb.Engine_OCEANBASE_ORACLE {
+ if instance.Metadata.GetEngine() == storepb.Engine_ORACLE || instance.Metadata.GetEngine() == storepb.Engine_OCEANBASE_ORACLE {
return nil, errors.Errorf("creating Oracle database is not supported")
}
@@ -164,22 +164,22 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
return nil, err
}
- if instance.Engine == storepb.Engine_MONGODB && c.Table == "" {
+ if instance.Metadata.GetEngine() == storepb.Engine_MONGODB && c.Table == "" {
return nil, errors.Errorf("collection name is required for MongoDB")
}
taskCreates, err := func() ([]*store.TaskMessage, error) {
- if err := checkCharacterSetCollationOwner(instance.Engine, c.CharacterSet, c.Collation, c.Owner); err != nil {
+ if err := checkCharacterSetCollationOwner(instance.Metadata.GetEngine(), c.CharacterSet, c.Collation, c.Owner); err != nil {
return nil, err
}
if c.Database == "" {
return nil, errors.Errorf("database name is required")
}
- if instance.Engine == storepb.Engine_SNOWFLAKE {
+ if instance.Metadata.GetEngine() == storepb.Engine_SNOWFLAKE {
// Snowflake needs to use upper case of DatabaseName.
c.Database = strings.ToUpper(c.Database)
}
- if instance.Engine == storepb.Engine_MONGODB && c.Table == "" {
+ if instance.Metadata.GetEngine() == storepb.Engine_MONGODB && c.Table == "" {
return nil, common.Errorf(common.Invalid, "Failed to create issue, collection name missing for MongoDB")
}
// Validate the labels. Labels are set upon task completion.
@@ -191,10 +191,10 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
// Get admin data source username.
adminDataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
if adminDataSource == nil {
- return nil, common.Errorf(common.Internal, "admin data source not found for instance %q", instance.Title)
+ return nil, common.Errorf(common.Internal, "admin data source not found for instance %q", instance.ResourceID)
}
databaseName := c.Database
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_SNOWFLAKE:
// Snowflake needs to use upper case of DatabaseName.
databaseName = strings.ToUpper(databaseName)
@@ -204,7 +204,7 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
// And also, meet an error in here is not a big deal, we will just use the original DatabaseName.
driver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
if err != nil {
- slog.Warn("failed to get admin database driver for instance %q, please check the connection for admin data source", log.BBError(err), slog.String("instance", instance.Title))
+ slog.Warn("failed to get admin database driver for instance %q, please check the connection for admin data source", log.BBError(err), slog.String("instance", instance.ResourceID))
break
}
defer driver.Close(ctx)
@@ -212,7 +212,7 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
var unused any
db := driver.GetDB()
if err := db.QueryRowContext(ctx, "SHOW VARIABLES LIKE 'lower_case_table_names'").Scan(&unused, &lowerCaseTableNames); err != nil {
- slog.Warn("failed to get lower_case_table_names for instance %q", log.BBError(err), slog.String("instance", instance.Title))
+ slog.Warn("failed to get lower_case_table_names for instance %q", log.BBError(err), slog.String("instance", instance.ResourceID))
break
}
if lowerCaseTableNames == 1 {
@@ -220,7 +220,7 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
}
}
- statement, err := getCreateDatabaseStatement(instance.Engine, c, databaseName, adminDataSource.GetUsername())
+ statement, err := getCreateDatabaseStatement(instance.Metadata.GetEngine(), c, databaseName, adminDataSource.GetUsername())
if err != nil {
return nil, err
}
@@ -230,7 +230,7 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
Title: fmt.Sprintf("Sheet for creating database %v", databaseName),
Statement: statement,
Payload: &storepb.SheetPayload{
- Engine: instance.Engine,
+ Engine: instance.Metadata.GetEngine(),
},
})
if err != nil {
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index d26e1ec671..44f1513933 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -183,7 +183,7 @@ func (s *SQLService) Query(ctx context.Context, request *v1pb.QueryRequest) (*v1
// Validate the request.
// New query ACL experience.
- if !request.Explain && !queryNewACLSupportEngines[instance.Engine] {
+ if !request.Explain && !queryNewACLSupportEngines[instance.Metadata.GetEngine()] {
if err := validateQueryRequest(instance, statement); err != nil {
return nil, err
}
@@ -299,7 +299,7 @@ func getSchemaMetadata(engine storepb.Engine, dbSchema *model.DatabaseSchema) *m
}
func replaceBackupTableWithSource(ctx context.Context, stores *store.Store, instance *store.InstanceMessage, database *store.DatabaseMessage, spans []*base.QuerySpan) error {
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_POSTGRES:
// Don't need to check the database name for postgres here.
// We backup the table to the same database with bbdataarchive schema for Postgres.
@@ -316,15 +316,15 @@ func replaceBackupTableWithSource(ctx context.Context, stores *store.Store, inst
if err != nil {
return err
}
- schema := getSchemaMetadata(instance.Engine, dbSchema)
+ schema := getSchemaMetadata(instance.Metadata.GetEngine(), dbSchema)
if schema == nil {
return nil
}
for _, span := range spans {
- span.SourceColumns = generateNewSourceColumnSet(instance.Engine, span.SourceColumns, schema)
+ span.SourceColumns = generateNewSourceColumnSet(instance.Metadata.GetEngine(), span.SourceColumns, schema)
for _, result := range span.Results {
- result.SourceColumns = generateNewSourceColumnSet(instance.Engine, result.SourceColumns, schema)
+ result.SourceColumns = generateNewSourceColumnSet(instance.Metadata.GetEngine(), result.SourceColumns, schema)
}
}
return nil
@@ -412,9 +412,9 @@ func queryRetry(
InstanceID: instance.ResourceID,
GetDatabaseMetadataFunc: BuildGetDatabaseMetadataFunc(stores),
ListDatabaseNamesFunc: BuildListDatabaseNamesFunc(stores),
- GetLinkedDatabaseMetadataFunc: BuildGetLinkedDatabaseMetadataFunc(stores, instance.Engine),
+ GetLinkedDatabaseMetadataFunc: BuildGetLinkedDatabaseMetadataFunc(stores, instance.Metadata.GetEngine()),
},
- instance.Engine,
+ instance.Metadata.GetEngine(),
statement,
database.DatabaseName,
queryContext.Schema,
@@ -480,9 +480,9 @@ func queryRetry(
InstanceID: instance.ResourceID,
GetDatabaseMetadataFunc: BuildGetDatabaseMetadataFunc(stores),
ListDatabaseNamesFunc: BuildListDatabaseNamesFunc(stores),
- GetLinkedDatabaseMetadataFunc: BuildGetLinkedDatabaseMetadataFunc(stores, instance.Engine),
+ GetLinkedDatabaseMetadataFunc: BuildGetLinkedDatabaseMetadataFunc(stores, instance.Metadata.GetEngine()),
},
- instance.Engine,
+ instance.Metadata.GetEngine(),
statement,
database.DatabaseName,
queryContext.Schema,
@@ -513,7 +513,7 @@ func queryRetry(
if licenseService.IsFeatureEnabledForInstance(api.FeatureSensitiveData, instance) == nil && !queryContext.Explain {
// TODO(zp): Refactor Document Database and RDBMS to use the same masking logic.
- if instance.Engine == storepb.Engine_COSMOSDB {
+ if instance.Metadata.GetEngine() == storepb.Engine_COSMOSDB {
objectSchema, err := getCosmosDBContainerObjectSchema(ctx, stores, database.InstanceID, database.DatabaseName, queryContext.Container)
if err != nil {
return nil, nil, duration, status.Error(codes.Internal, err.Error())
@@ -694,7 +694,7 @@ func (s *SQLService) Export(ctx context.Context, request *v1pb.ExportRequest) (*
// Validate the request.
// New query ACL experience.
- if instance.Engine != storepb.Engine_MYSQL {
+ if instance.Metadata.GetEngine() != storepb.Engine_MYSQL {
if err := validateQueryRequest(instance, statement); err != nil {
return nil, err
}
@@ -846,15 +846,15 @@ func DoExport(
return nil, duration, err
}
case v1pb.ExportFormat_SQL:
- resourceList, err := extractResourceList(ctx, storeInstance, instance.Engine, database.DatabaseName, request.Statement, instance)
+ resourceList, err := extractResourceList(ctx, storeInstance, instance.Metadata.GetEngine(), database.DatabaseName, request.Statement, instance)
if err != nil {
return nil, 0, status.Errorf(codes.InvalidArgument, "failed to extract resource list: %v", err)
}
- statementPrefix, err := getSQLStatementPrefix(instance.Engine, resourceList, result.ColumnNames)
+ statementPrefix, err := getSQLStatementPrefix(instance.Metadata.GetEngine(), resourceList, result.ColumnNames)
if err != nil {
return nil, 0, err
}
- content, err = exportSQL(instance.Engine, statementPrefix, result)
+ content, err = exportSQL(instance.Metadata.GetEngine(), statementPrefix, result)
if err != nil {
return nil, duration, err
}
@@ -1170,7 +1170,7 @@ func (s *SQLService) accessCheck(
for _, span := range spans {
// New query ACL experience.
- if queryNewACLSupportEngines[instance.Engine] {
+ if queryNewACLSupportEngines[instance.Metadata.GetEngine()] {
var permission iam.Permission
switch span.Type {
case base.QueryTypeUnknown:
@@ -1320,7 +1320,7 @@ func (s *SQLService) prepareRelatedMessage(ctx context.Context, requestName stri
}
func validateQueryRequest(instance *store.InstanceMessage, statement string) error {
- ok, _, err := base.ValidateSQLForEditor(instance.Engine, statement)
+ ok, _, err := base.ValidateSQLForEditor(instance.Metadata.GetEngine(), statement)
if err != nil {
syntaxErr, ok := err.(*base.SyntaxError)
if ok {
@@ -1471,7 +1471,7 @@ func (s *SQLService) SQLReviewCheck(
instance *store.InstanceMessage,
database *store.DatabaseMessage,
) (storepb.Advice_Status, []*v1pb.Advice, error) {
- if !isSQLReviewSupported(instance.Engine) || database == nil {
+ if !isSQLReviewSupported(instance.Metadata.GetEngine()) || database == nil {
return storepb.Advice_SUCCESS, nil, nil
}
@@ -1493,7 +1493,7 @@ func (s *SQLService) SQLReviewCheck(
}
dbMetadata := dbSchema.GetMetadata()
- catalog, err := catalog.NewCatalog(ctx, s.store, database.InstanceID, database.DatabaseName, instance.Engine, store.IsObjectCaseSensitive(instance), dbMetadata)
+ catalog, err := catalog.NewCatalog(ctx, s.store, database.InstanceID, database.DatabaseName, instance.Metadata.GetEngine(), store.IsObjectCaseSensitive(instance), dbMetadata)
if err != nil {
return storepb.Advice_ERROR, nil, status.Errorf(codes.Internal, "failed to create a catalog: %v", err)
}
@@ -1515,7 +1515,7 @@ func (s *SQLService) SQLReviewCheck(
Collation: dbMetadata.Collation,
ChangeType: changeType,
DBSchema: dbMetadata,
- DbType: instance.Engine,
+ DbType: instance.Metadata.GetEngine(),
Catalog: catalog,
Driver: connection,
CurrentDatabase: database.DatabaseName,
@@ -1562,7 +1562,7 @@ func (s *SQLService) SQLReviewCheck(
}
func getUseDatabaseOwner(ctx context.Context, stores *store.Store, instance *store.InstanceMessage, database *store.DatabaseMessage, changeType storepb.PlanCheckRunConfig_ChangeDatabaseType) (bool, error) {
- if instance.Engine != storepb.Engine_POSTGRES || changeType == storepb.PlanCheckRunConfig_SQL_EDITOR {
+ if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES || changeType == storepb.PlanCheckRunConfig_SQL_EDITOR {
return false, nil
}
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.go
index a826002367..6442f573b7 100644
--- a/backend/component/dbfactory/dbfactory.go
+++ b/backend/component/dbfactory/dbfactory.go
@@ -39,7 +39,7 @@ func New(store *store.Store, mysqlBinDir, mongoBinDir, pgBinDir, dataDir, secret
func (d *DBFactory) GetAdminDatabaseDriver(ctx context.Context, instance *store.InstanceMessage, database *store.DatabaseMessage, connectionContext db.ConnectionContext) (db.Driver, error) {
dataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
if dataSource == nil {
- return nil, common.Errorf(common.Internal, "admin data source not found for instance %q", instance.Title)
+ return nil, common.Errorf(common.Internal, "admin data source not found for instance %q", instance.ResourceID)
}
databaseName := ""
if database != nil {
@@ -55,9 +55,8 @@ func (d *DBFactory) GetAdminDatabaseDriver(ctx context.Context, instance *store.
// GetDataSourceDriver returns the database driver for a data source.
func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.InstanceMessage, dataSource *storepb.DataSource, databaseName string, datashare, readOnly bool, connectionContext db.ConnectionContext) (db.Driver, error) {
dbBinDir := ""
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
- // TODO(d): use maria mysqlbinlog for MariaDB.
dbBinDir = d.mysqlBinDir
case storepb.Engine_POSTGRES, storepb.Engine_RISINGWAVE:
dbBinDir = d.pgBinDir
@@ -131,12 +130,12 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.Ins
dbSaslConfig = nil
}
connectionContext.InstanceID = instance.ResourceID
- connectionContext.EngineVersion = instance.EngineVersion
+ connectionContext.EngineVersion = instance.Metadata.GetVersion()
maximumSQLResultSize := d.store.GetMaximumSQLResultLimit(ctx)
driver, err := db.Open(
ctx,
- instance.Engine,
+ instance.Metadata.GetEngine(),
db.DriverConfig{
DbBinDir: dbBinDir,
},
diff --git a/backend/enterprise/service/license.go b/backend/enterprise/service/license.go
index 4ec55a919b..12f2c5aa04 100644
--- a/backend/enterprise/service/license.go
+++ b/backend/enterprise/service/license.go
@@ -90,7 +90,7 @@ func (s *LicenseService) IsFeatureEnabledForInstance(feature api.FeatureType, in
// If the feature not exists in the limit map, we just need to check the feature for current plan.
return nil
}
- if !instance.Activation {
+ if !instance.Metadata.GetActivation() {
return errors.Errorf(`feature "%s" is not available for instance %s, please assign license to the instance to enable it`, feature.Name(), instance.ResourceID)
}
return nil
diff --git a/backend/migrator/migration/3.5/0009##instance_meta.sql b/backend/migrator/migration/3.5/0009##instance_meta.sql
new file mode 100644
index 0000000000..a82c96b241
--- /dev/null
+++ b/backend/migrator/migration/3.5/0009##instance_meta.sql
@@ -0,0 +1,11 @@
+UPDATE instance SET metadata = metadata || jsonb_build_object('title', name);
+UPDATE instance SET metadata = metadata || jsonb_build_object('engine', engine);
+UPDATE instance SET metadata = metadata || jsonb_build_object('version', engine_version);
+UPDATE instance SET metadata = metadata || jsonb_build_object('externalLink', external_link);
+UPDATE instance SET metadata = metadata || jsonb_build_object('activation', activation);
+
+ALTER TABLE instance DROP COLUMN name;
+ALTER TABLE instance DROP COLUMN engine;
+ALTER TABLE instance DROP COLUMN engine_version;
+ALTER TABLE instance DROP COLUMN external_link;
+ALTER TABLE instance DROP COLUMN activation;
\ No newline at end of file
diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sql
index 806ddc2a11..a7ec5c2dfd 100644
--- a/backend/migrator/migration/LATEST.sql
+++ b/backend/migrator/migration/LATEST.sql
@@ -115,13 +115,7 @@ CREATE TABLE instance (
id serial PRIMARY KEY,
deleted boolean NOT NULL DEFAULT FALSE,
environment text REFERENCES environment(resource_id),
- name text NOT NULL,
- engine text NOT NULL,
- engine_version text NOT NULL DEFAULT '',
- external_link text NOT NULL DEFAULT '',
resource_id text NOT NULL,
- -- activation should set to be TRUE if users assign license to this instance.
- activation boolean NOT NULL DEFAULT false,
metadata jsonb NOT NULL DEFAULT '{}'
);
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 14001668ca..29e36a99fc 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -212,5 +212,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("3.5.8"), releaseVersion)
+ require.Equal(t, semver.MustParse("3.5.9"), releaseVersion)
}
diff --git a/backend/runner/approval/runner.go b/backend/runner/approval/runner.go
index 54803ebef9..9b9b7511f6 100644
--- a/backend/runner/approval/runner.go
+++ b/backend/runner/approval/runner.go
@@ -493,7 +493,7 @@ func (r *Runner) getDatabaseGeneralIssueRisk(ctx context.Context, issue *store.I
"project_id": issue.Project.ResourceID,
"database_name": databaseName,
// convert to string type otherwise cel-go will complain that storepb.Engine is not string type.
- "db_engine": instance.Engine.String(),
+ "db_engine": instance.Metadata.GetEngine().String(),
"sql_statement": taskStatement,
}
@@ -653,7 +653,7 @@ func (r *Runner) getDatabaseDataExportIssueRisk(ctx context.Context, issue *stor
"environment_id": environmentID,
"project_id": issue.Project.ResourceID,
"database_name": databaseName,
- "db_engine": instance.Engine.String(),
+ "db_engine": instance.Metadata.GetEngine().String(),
}
vars, err := e.PartialVars(args)
@@ -801,7 +801,7 @@ func (r *Runner) getGrantRequestIssueRisk(ctx context.Context, issue *store.Issu
"project_id": issue.Project.ResourceID,
"database_name": database.DatabaseName,
// convert to string type otherwise cel-go will complain that storepb.Engine is not string type.
- "db_engine": instance.Engine.String(),
+ "db_engine": instance.Metadata.GetEngine().String(),
"expiration_days": expirationDays,
}
if riskSource == store.RiskRequestExport {
diff --git a/backend/runner/mail/slow_query_weekly_mail.go b/backend/runner/mail/slow_query_weekly_mail.go
index 68147fd5fe..67bf229e74 100644
--- a/backend/runner/mail/slow_query_weekly_mail.go
+++ b/backend/runner/mail/slow_query_weekly_mail.go
@@ -327,8 +327,8 @@ func (s *SlowQueryWeeklyMailSender) generateWeeklyEmailForProject(ctx context.Co
hasSlowQuery := false
sort.Slice(databases, func(i, j int) bool {
- lEngine := engineOrder(instanceMap[databases[i].InstanceID].Engine)
- rEngine := engineOrder(instanceMap[databases[j].InstanceID].Engine)
+ lEngine := engineOrder(instanceMap[databases[i].InstanceID].Metadata.GetEngine())
+ rEngine := engineOrder(instanceMap[databases[j].InstanceID].Metadata.GetEngine())
if lEngine != rEngine {
return lEngine < rEngine
}
@@ -381,7 +381,7 @@ func (s *SlowQueryWeeklyMailSender) generateWeeklyEmailForProject(ctx context.Co
for i, log := range logs {
var item string
if i == 0 {
- item = strings.ReplaceAll(string(tableItem), "{{DB_TYPE}}", engineTypeString(instance.Engine))
+ item = strings.ReplaceAll(string(tableItem), "{{DB_TYPE}}", engineTypeString(instance.Metadata.GetEngine()))
item = strings.ReplaceAll(item, "{{DB_NAME}}", database.DatabaseName)
} else {
item = strings.ReplaceAll(string(tableItem), "{{DB_TYPE}}", "")
@@ -608,7 +608,7 @@ func (s *SlowQueryWeeklyMailSender) generateEnvironmentContent(
}
sort.Slice(instances, func(i, j int) bool {
- return engineOrder(instances[i].Engine) < engineOrder(instances[j].Engine)
+ return engineOrder(instances[i].Metadata.GetEngine()) < engineOrder(instances[j].Metadata.GetEngine())
})
hasSlowQueryInEnvironment := false
@@ -646,7 +646,7 @@ func (s *SlowQueryWeeklyMailSender) generateEnvironmentContent(
endUnix := endDate.Truncate(24 * time.Hour).Add(-1 * time.Second).UTC().Unix()
instanceURL := fmt.Sprintf("%s/slow-query?instance=%s&fromTime=%d&toTime=%d", strings.TrimSuffix(visitURL, "/"), instance.ResourceID, beginUnix, endUnix)
instanceHeaderString := strings.ReplaceAll(string(instanceHeader), "{{INSTANCE_LINK}}", instanceURL)
- instanceHeaderString = strings.ReplaceAll(instanceHeaderString, "{{INSTANCE_NAME}}", instance.Title)
+ instanceHeaderString = strings.ReplaceAll(instanceHeaderString, "{{INSTANCE_NAME}}", instance.Metadata.GetTitle())
if _, err := buf.WriteString(instanceHeaderString); err != nil {
return err
}
diff --git a/backend/runner/plancheck/statement_advise_executor.go b/backend/runner/plancheck/statement_advise_executor.go
index fb2b93926d..bac9d77120 100644
--- a/backend/runner/plancheck/statement_advise_executor.go
+++ b/backend/runner/plancheck/statement_advise_executor.go
@@ -100,12 +100,12 @@ func (e *StatementAdviseExecutor) Run(ctx context.Context, config *storepb.PlanC
if instance == nil {
return nil, errors.Errorf("instance %s not found", config.InstanceId)
}
- if !common.StatementAdviseEngines[instance.Engine] {
+ if !common.StatementAdviseEngines[instance.Metadata.GetEngine()] {
return []*storepb.PlanCheckRunResult_Result{
{
Status: storepb.PlanCheckRunResult_Result_SUCCESS,
Code: common.Ok.Int32(),
- Title: fmt.Sprintf("Statement advise is not supported for %s", instance.Engine),
+ Title: fmt.Sprintf("Statement advise is not supported for %s", instance.Metadata.GetEngine()),
Content: "",
},
}, nil
@@ -167,7 +167,7 @@ func (e *StatementAdviseExecutor) runReview(
}
}
- catalog, err := catalog.NewCatalog(ctx, e.store, database.InstanceID, database.DatabaseName, instance.Engine, store.IsObjectCaseSensitive(instance), nil /* Override Metadata */)
+ catalog, err := catalog.NewCatalog(ctx, e.store, database.InstanceID, database.DatabaseName, instance.Metadata.GetEngine(), store.IsObjectCaseSensitive(instance), nil /* Override Metadata */)
if err != nil {
return nil, common.Wrapf(err, common.Internal, "failed to create a catalog")
}
@@ -196,7 +196,7 @@ func (e *StatementAdviseExecutor) runReview(
Collation: dbSchema.GetMetadata().Collation,
DBSchema: dbSchema.GetMetadata(),
ChangeType: changeType,
- DbType: instance.Engine,
+ DbType: instance.Metadata.GetEngine(),
Catalog: catalog,
Driver: connection,
PreUpdateBackupDetail: preUpdateBackupDetail,
diff --git a/backend/runner/plancheck/statement_report_executor.go b/backend/runner/plancheck/statement_report_executor.go
index 90613aff12..c19886575e 100644
--- a/backend/runner/plancheck/statement_report_executor.go
+++ b/backend/runner/plancheck/statement_report_executor.go
@@ -76,12 +76,12 @@ func (e *StatementReportExecutor) Run(ctx context.Context, config *storepb.PlanC
if instance == nil {
return nil, errors.Errorf("instance %s not found", config.InstanceId)
}
- if !common.StatementReportEngines[instance.Engine] {
+ if !common.StatementReportEngines[instance.Metadata.GetEngine()] {
return []*storepb.PlanCheckRunResult_Result{
{
Status: storepb.PlanCheckRunResult_Result_SUCCESS,
Code: common.Ok.Int32(),
- Title: fmt.Sprintf("Statement report is not supported for %s", instance.Engine),
+ Title: fmt.Sprintf("Statement report is not supported for %s", instance.Metadata.GetEngine()),
Content: "",
},
}, nil
@@ -96,7 +96,7 @@ func (e *StatementReportExecutor) Run(ctx context.Context, config *storepb.PlanC
}
// Check statement syntax error.
- _, syntaxAdvices := e.sheetManager.GetASTsForChecks(instance.Engine, statement)
+ _, syntaxAdvices := e.sheetManager.GetASTsForChecks(instance.Metadata.GetEngine(), statement)
if len(syntaxAdvices) > 0 {
advice := syntaxAdvices[0]
return []*storepb.PlanCheckRunResult_Result{
@@ -154,7 +154,7 @@ func GetSQLSummaryReport(ctx context.Context, stores *store.Store, sheetManager
return nil, errors.Errorf("instance not found: %s", database.InstanceID)
}
- asts, syntaxAdvices := sheetManager.GetASTsForChecks(instance.Engine, statement)
+ asts, syntaxAdvices := sheetManager.GetASTsForChecks(instance.Metadata.GetEngine(), statement)
if len(syntaxAdvices) > 0 {
// Return nil as it should already be checked before running this function.
return nil, nil
@@ -175,7 +175,7 @@ func GetSQLSummaryReport(ctx context.Context, stores *store.Store, sheetManager
}
defer driver.Close(ctx)
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_POSTGRES:
pd, ok := driver.(*pgdriver.Driver)
if !ok {
@@ -208,7 +208,7 @@ func GetSQLSummaryReport(ctx context.Context, stores *store.Store, sheetManager
}
explainCalculator = md.CountAffectedRows
- if instance.Engine != storepb.Engine_OCEANBASE {
+ if instance.Metadata.GetEngine() != storepb.Engine_OCEANBASE {
sqlTypes, err = mysqlparser.GetStatementTypes(asts)
if err != nil {
return nil, err
@@ -235,7 +235,7 @@ func GetSQLSummaryReport(ctx context.Context, stores *store.Store, sheetManager
}
explainCalculator = od.CountAffectedRows
- if instance.Engine != storepb.Engine_OCEANBASE_ORACLE {
+ if instance.Metadata.GetEngine() != storepb.Engine_OCEANBASE_ORACLE {
sqlTypes, err = plsql.GetStatementTypes(asts)
if err != nil {
return nil, err
@@ -262,7 +262,7 @@ func GetSQLSummaryReport(ctx context.Context, stores *store.Store, sheetManager
materials := utils.GetSecretMapFromDatabaseMessage(database)
// To avoid leaking the rendered statement, the error message should use the original statement and not the rendered statement.
renderedStatement := utils.RenderStatement(statement, materials)
- changeSummary, err := base.ExtractChangedResources(instance.Engine, database.DatabaseName, defaultSchema, databaseSchema, asts, renderedStatement)
+ changeSummary, err := base.ExtractChangedResources(instance.Metadata.GetEngine(), database.DatabaseName, defaultSchema, databaseSchema, asts, renderedStatement)
if err != nil {
return nil, errors.Wrapf(err, "failed to extract changed resources")
}
@@ -276,7 +276,7 @@ func GetSQLSummaryReport(ctx context.Context, stores *store.Store, sheetManager
}
func getUseDatabaseOwner(ctx context.Context, stores *store.Store, instance *store.InstanceMessage, database *store.DatabaseMessage) (bool, error) {
- if instance.Engine != storepb.Engine_POSTGRES {
+ if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {
return false, nil
}
diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.go
index afb31d1379..4243613c4e 100644
--- a/backend/runner/schemasync/syncer.go
+++ b/backend/runner/schemasync/syncer.go
@@ -300,10 +300,10 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessa
ResourceID: instance.ResourceID,
Metadata: metadata,
}
- if instanceMeta.Version != instance.EngineVersion {
- updateInstance.EngineVersion = &instanceMeta.Version
+ if instanceMeta.Version != instance.Metadata.GetVersion() {
+ metadata.Version = instanceMeta.Version
}
- updatedInstance, err := s.store.UpdateInstanceV2(ctx, updateInstance, -1)
+ updatedInstance, err := s.store.UpdateInstanceV2(ctx, updateInstance)
if err != nil {
return nil, nil, nil, err
}
@@ -404,7 +404,7 @@ func (s *Syncer) SyncDatabaseSchemaToHistory(ctx context.Context, database *stor
return 0, errors.Wrapf(err, `failed to get classification config by id "%s"`, project.DataClassificationConfigID)
}
- if instance.Engine != storepb.Engine_MYSQL && instance.Engine != storepb.Engine_POSTGRES {
+ if instance.Metadata.GetEngine() != storepb.Engine_MYSQL && instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {
// Force to disable classification from comment if the engine is not MYSQL or PG.
classificationConfig.ClassificationFromConfig = true
}
@@ -512,7 +512,7 @@ func (s *Syncer) SyncDatabaseSchema(ctx context.Context, database *store.Databas
return errors.Wrapf(err, `failed to get classification config by id "%s"`, project.DataClassificationConfigID)
}
- if instance.Engine != storepb.Engine_MYSQL && instance.Engine != storepb.Engine_POSTGRES {
+ if instance.Metadata.GetEngine() != storepb.Engine_MYSQL && instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {
// Force to disable classification from comment if the engine is not MYSQL or PG.
classificationConfig.ClassificationFromConfig = true
}
@@ -563,7 +563,7 @@ func (s *Syncer) SyncDatabaseSchema(ctx context.Context, database *store.Databas
if s.licenseService.IsFeatureEnabledForInstance(api.FeatureSchemaDrift, instance) == nil {
if err := func() error {
// Redis and MongoDB are schemaless.
- if disableSchemaDriftAnomalyCheck(instance.Engine) {
+ if disableSchemaDriftAnomalyCheck(instance.Metadata.GetEngine()) {
return nil
}
limit := 1
@@ -619,7 +619,7 @@ func (s *Syncer) SyncDatabaseSchema(ctx context.Context, database *store.Databas
}
func (s *Syncer) hasBackupSchema(ctx context.Context, instance *store.InstanceMessage, dbSchema *storepb.DatabaseSchemaMetadata) bool {
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_POSTGRES:
if dbSchema == nil {
return false
@@ -737,7 +737,7 @@ func setUserCommentFromComment(dbSchema *storepb.DatabaseSchemaMetadata) {
}
func getOrDefaultSyncInterval(instance *store.InstanceMessage) time.Duration {
- if !instance.Activation {
+ if !instance.Metadata.GetActivation() {
return defaultSyncInterval
}
if !instance.Metadata.GetSyncInterval().IsValid() {
diff --git a/backend/runner/slowquerysync/syncer.go b/backend/runner/slowquerysync/syncer.go
index 93eca697cd..8fd4e065c3 100644
--- a/backend/runner/slowquerysync/syncer.go
+++ b/backend/runner/slowquerysync/syncer.go
@@ -115,13 +115,13 @@ func (s *Syncer) syncInstanceSlowQuery(ctx context.Context, instance *store.Inst
return nil
}
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MYSQL:
return s.syncMySQLSlowQuery(ctx, instance)
case storepb.Engine_POSTGRES:
return s.syncPostgreSQLSlowQuery(ctx, instance)
default:
- return errors.Errorf("unsupported database engine: %s", instance.Engine)
+ return errors.Errorf("unsupported database engine: %s", instance.Metadata.GetEngine())
}
}
diff --git a/backend/runner/taskrun/data_update_executor.go b/backend/runner/taskrun/data_update_executor.go
index c3f576351f..6b8238d7b9 100644
--- a/backend/runner/taskrun/data_update_executor.go
+++ b/backend/runner/taskrun/data_update_executor.go
@@ -178,7 +178,7 @@ func (exec *DataUpdateExecutor) backupData(
return nil, errors.Wrap(err, "failed to parse backup database")
}
- if instance.Engine != storepb.Engine_POSTGRES {
+ if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {
backupDatabase, err = exec.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{InstanceID: &backupInstanceID, DatabaseName: &backupDatabaseName})
if err != nil {
return nil, errors.Wrap(err, "failed to get backup database")
@@ -211,7 +211,7 @@ func (exec *DataUpdateExecutor) backupData(
ListDatabaseNamesFunc: BuildListDatabaseNamesFunc(exec.store),
IsCaseSensitive: store.IsObjectCaseSensitive(instance),
}
- if instance.Engine == storepb.Engine_ORACLE {
+ if instance.Metadata.GetEngine() == storepb.Engine_ORACLE {
oracleDriver, ok := driver.(*oracle.Driver)
if ok {
if version, err := oracleDriver.GetVersion(); err == nil {
@@ -225,12 +225,12 @@ func (exec *DataUpdateExecutor) backupData(
}
prefix := "_" + time.Now().Format("20060102150405")
- statements, err := base.TransformDMLToSelect(ctx, instance.Engine, tc, originStatement, database.DatabaseName, backupDatabaseName, prefix)
+ statements, err := base.TransformDMLToSelect(ctx, instance.Metadata.GetEngine(), tc, originStatement, database.DatabaseName, backupDatabaseName, prefix)
if err != nil {
return nil, errors.Wrap(err, "failed to transform DML to select")
}
- preAppendStatements, err := getPreAppendStatements(instance.Engine, originStatement)
+ preAppendStatements, err := getPreAppendStatements(instance.Metadata.GetEngine(), originStatement)
if err != nil {
return nil, errors.Wrap(err, "failed to get pre append statements")
}
@@ -248,7 +248,7 @@ func (exec *DataUpdateExecutor) backupData(
if _, err := driver.Execute(driverCtx, backupStatement, db.ExecuteOptions{}); err != nil {
return nil, errors.Wrapf(err, "failed to execute backup statement %q", backupStatement)
}
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_TIDB:
if _, err := driver.Execute(driverCtx, fmt.Sprintf("ALTER TABLE `%s`.`%s` COMMENT = '%s, source table (%s, %s)'", backupDatabaseName, statement.TargetTableName, bbSource, database.DatabaseName, statement.SourceTableName), db.ExecuteOptions{}); err != nil {
return nil, errors.Wrap(err, "failed to set table comment")
@@ -293,7 +293,7 @@ func (exec *DataUpdateExecutor) backupData(
StartPosition: statement.StartPosition,
EndPosition: statement.EndPosition,
}
- if instance.Engine == storepb.Engine_POSTGRES {
+ if instance.Metadata.GetEngine() == storepb.Engine_POSTGRES {
item.TargetTable = &storepb.PriorBackupDetail_Item_Table{
Database: sourceDatabaseName,
// postgres uses schema as the backup database name currently.
@@ -326,7 +326,7 @@ func (exec *DataUpdateExecutor) backupData(
}
}
- if instance.Engine != storepb.Engine_POSTGRES {
+ if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {
if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, backupDatabase); err != nil {
slog.Error("failed to sync backup database schema",
slog.String("database", payload.PreUpdateBackupDetail.Database),
diff --git a/backend/runner/taskrun/database_create_executor.go b/backend/runner/taskrun/database_create_executor.go
index 30d352946c..d84e4d0cca 100644
--- a/backend/runner/taskrun/database_create_executor.go
+++ b/backend/runner/taskrun/database_create_executor.go
@@ -79,7 +79,7 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conte
return true, nil, err
}
- if cannotCreateDatabase[instance.Engine] {
+ if cannotCreateDatabase[instance.Metadata.GetEngine()] {
return true, nil, errors.Errorf("Creating database is not supported")
}
@@ -100,7 +100,7 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conte
// Create database.
slog.Debug("Start creating database...",
- slog.String("instance", instance.Title),
+ slog.String("instance", instance.Metadata.GetTitle()),
slog.String("database", payload.DatabaseName),
slog.String("statement", statement),
)
@@ -132,7 +132,7 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conte
}
var defaultDBDriver db.Driver
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MONGODB:
// For MongoDB, it allows us to connect to the non-existing database. So we pass the database name to driver to let us connect to the specific database.
// And run the create collection statement later.
@@ -186,7 +186,7 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conte
if peerSchema != "" {
// Better displaying schema in the task.
- connectionStmt, err := getConnectionStatement(instance.Engine, payload.DatabaseName)
+ connectionStmt, err := getConnectionStatement(instance.Metadata.GetEngine(), payload.DatabaseName)
if err != nil {
return true, nil, err
}
@@ -476,11 +476,11 @@ func (exec *DatabaseCreateExecutor) getSchemaFromPeerTenantDatabase(ctx context.
defer driver.Close(ctx)
dbSchema := (*storepb.DatabaseSchemaMetadata)(nil)
- if similarDBInstance.Engine == storepb.Engine_MYSQL || similarDBInstance.Engine == storepb.Engine_POSTGRES {
+ if similarDBInstance.Metadata.GetEngine() == storepb.Engine_MYSQL || similarDBInstance.Metadata.GetEngine() == storepb.Engine_POSTGRES {
// Use new driver to sync the schema to avoid the session state change, such as SET ROLE in PostgreSQL.
syncDriver, err := exec.dbFactory.GetAdminDatabaseDriver(ctx, similarDBInstance, similarDB, db.ConnectionContext{})
if err != nil {
- return nil, "", errors.Wrapf(err, "failed to get driver for instance %q", similarDBInstance.Title)
+ return nil, "", errors.Wrapf(err, "failed to get driver for instance %q", similarDBInstance.Metadata.GetTitle())
}
defer syncDriver.Close(ctx)
dbSchema, err = syncDriver.SyncDBSchema(ctx)
@@ -503,7 +503,7 @@ func (exec *DatabaseCreateExecutor) getPeerTenantDatabasesFromDatabaseGroup(ctx
}
allDatabases, err := exec.store.ListDatabases(ctx, &store.FindDatabaseMessage{
ProjectID: &project.ResourceID,
- Engine: &instance.Engine,
+ Engine: &instance.Metadata.Engine,
})
if err != nil {
return nil, errors.Wrapf(err, "Failed to fetch databases in project %s", project.ResourceID)
diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.go
index bbb905e812..994aa7d22a 100644
--- a/backend/runner/taskrun/executor.go
+++ b/backend/runner/taskrun/executor.go
@@ -227,7 +227,7 @@ func getCreateTaskRunLog(ctx context.Context, taskRunUID int, s *store.Store, pr
}
func getUseDatabaseOwner(ctx context.Context, stores *store.Store, instance *store.InstanceMessage, database *store.DatabaseMessage) (bool, error) {
- if instance.Engine != storepb.Engine_POSTGRES {
+ if instance.Metadata.GetEngine() != storepb.Engine_POSTGRES {
return false, nil
}
@@ -289,7 +289,7 @@ func doMigrationWithFunc(
if stateCfg != nil {
switch mc.task.Type {
case api.TaskDatabaseSchemaUpdate, api.TaskDatabaseDataUpdate:
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_OCEANBASE,
storepb.Engine_STARROCKS, storepb.Engine_DORIS, storepb.Engine_POSTGRES,
storepb.Engine_REDSHIFT, storepb.Engine_RISINGWAVE, storepb.Engine_ORACLE,
diff --git a/backend/runner/utils/sdl_utils.go b/backend/runner/utils/sdl_utils.go
index ed81b7fb56..670c8048d5 100644
--- a/backend/runner/utils/sdl_utils.go
+++ b/backend/runner/utils/sdl_utils.go
@@ -46,13 +46,13 @@ func ComputeDatabaseSchemaDiff(ctx context.Context, instance *store.InstanceMess
}
var engine storepb.Engine
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_POSTGRES, storepb.Engine_RISINGWAVE:
engine = storepb.Engine_POSTGRES
case storepb.Engine_MYSQL, storepb.Engine_TIDB, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
engine = storepb.Engine_MYSQL
default:
- return "", errors.Errorf("unsupported database engine %q", instance.Engine)
+ return "", errors.Errorf("unsupported database engine %q", instance.Metadata.GetEngine())
}
sdlFormat, err := transform.SchemaTransform(engine, schema.String())
diff --git a/backend/server/onboard.go b/backend/server/onboard.go
index 6aec2a3387..409f0b7f2d 100644
--- a/backend/server/onboard.go
+++ b/backend/server/onboard.go
@@ -37,11 +37,13 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
// Test Sample Instance
testInstance, err := s.store.CreateInstanceV2(ctx, &store.InstanceMessage{
- ResourceID: "test-sample-instance",
- Title: "Test Sample Instance",
- Engine: storepb.Engine_POSTGRES,
- ExternalLink: "",
+ ResourceID: "test-sample-instance",
+ EnvironmentID: api.DefaultTestEnvironmentID,
Metadata: &storepb.Instance{
+ Title: "Test Sample Instance",
+ Engine: storepb.Engine_POSTGRES,
+ ExternalLink: "",
+ Activation: false,
DataSources: []*storepb.DataSource{
{
Id: "admin",
@@ -54,9 +56,7 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
},
},
},
- EnvironmentID: api.DefaultTestEnvironmentID,
- Activation: false,
- }, -1)
+ })
if err != nil {
return errors.Wrapf(err, "failed to create test onboarding instance")
}
@@ -98,11 +98,13 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
// Prod Sample Instance
prodInstance, err := s.store.CreateInstanceV2(ctx, &store.InstanceMessage{
- ResourceID: "prod-sample-instance",
- Title: "Prod Sample Instance",
- Engine: storepb.Engine_POSTGRES,
- ExternalLink: "",
+ ResourceID: "prod-sample-instance",
+ EnvironmentID: api.DefaultProdEnvironmentID,
Metadata: &storepb.Instance{
+ Title: "Prod Sample Instance",
+ Engine: storepb.Engine_POSTGRES,
+ ExternalLink: "",
+ Activation: false,
DataSources: []*storepb.DataSource{
{
Id: "admin",
@@ -115,9 +117,7 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
},
},
},
- EnvironmentID: api.DefaultProdEnvironmentID,
- Activation: false,
- }, -1)
+ })
if err != nil {
return errors.Wrapf(err, "failed to create prod onboarding instance")
}
@@ -216,7 +216,7 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
Statement: "ALTER TABLE employee ADD COLUMN IF NOT EXISTS email TEXT DEFAULT '';",
Payload: &storepb.SheetPayload{
- Engine: testInstance.Engine,
+ Engine: testInstance.Metadata.GetEngine(),
},
})
if err != nil {
@@ -229,7 +229,7 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
Title: "Alter table to prod sample instance for sample issue",
Statement: "ALTER TABLE employee ADD COLUMN IF NOT EXISTS email TEXT DEFAULT '';",
Payload: &storepb.SheetPayload{
- Engine: prodInstance.Engine,
+ Engine: prodInstance.Metadata.GetEngine(),
},
})
if err != nil {
diff --git a/backend/store/database.go b/backend/store/database.go
index 40efb0871d..f1dab5d50a 100644
--- a/backend/store/database.go
+++ b/backend/store/database.go
@@ -338,7 +338,7 @@ func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabase
}
}
if v := find.Engine; v != nil {
- where, args = append(where, fmt.Sprintf("instance.engine = $%d", len(args)+1)), append(args, *v)
+ where, args = append(where, fmt.Sprintf("instance.metadata->>'engine' = $%d", len(args)+1)), append(args, *v)
}
if !find.ShowDeleted {
where, args = append(where, fmt.Sprintf(`
diff --git a/backend/store/db_schema.go b/backend/store/db_schema.go
index 41aa2aca59..0cd247e56f 100644
--- a/backend/store/db_schema.go
+++ b/backend/store/db_schema.go
@@ -180,5 +180,5 @@ func (s *Store) convertMetadataAndConfig(ctx context.Context, metadata, schema,
if err != nil {
return nil, err
}
- return model.NewDatabaseSchema(&databaseSchema, schema, &databaseConfig, instance.Engine, IsObjectCaseSensitive(instance)), nil
+ return model.NewDatabaseSchema(&databaseSchema, schema, &databaseConfig, instance.Metadata.GetEngine(), IsObjectCaseSensitive(instance)), nil
}
diff --git a/backend/store/instance.go b/backend/store/instance.go
index 71952f75dc..41e41b9fae 100644
--- a/backend/store/instance.go
+++ b/backend/store/instance.go
@@ -19,13 +19,8 @@ import (
// InstanceMessage is the message for instance.
type InstanceMessage struct {
ResourceID string
- Title string
- Engine storepb.Engine
- ExternalLink string
- Activation bool
EnvironmentID string
Deleted bool
- EngineVersion string
Metadata *storepb.Instance
}
@@ -33,13 +28,9 @@ type InstanceMessage struct {
type UpdateInstanceMessage struct {
ResourceID string
- Title *string
- ExternalLink *string
Deleted *bool
- EngineVersion *string
- Activation *bool
- Metadata *storepb.Instance
EnvironmentID *string
+ Metadata *storepb.Instance
}
// FindInstanceMessage is the message for finding instances.
@@ -100,7 +91,7 @@ func (s *Store) ListInstancesV2(ctx context.Context, find *FindInstanceMessage)
}
// CreateInstanceV2 creates the instance.
-func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMessage, maximumActivation int) (*InstanceMessage, error) {
+func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMessage) (*InstanceMessage, error) {
if err := validateDataSources(instanceCreate.Metadata); err != nil {
return nil, err
}
@@ -111,11 +102,6 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
}
defer tx.Rollback()
- where := ""
- if instanceCreate.Activation {
- where = fmt.Sprintf("WHERE (%s) < %d", countActivateInstanceQuery, maximumActivation)
- }
-
metadataBytes, err := protojson.Marshal(instanceCreate.Metadata)
if err != nil {
return nil, err
@@ -125,25 +111,15 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
if instanceCreate.EnvironmentID != "" {
environment = &instanceCreate.EnvironmentID
}
- if _, err := tx.ExecContext(ctx, fmt.Sprintf(`
+ if _, err := tx.ExecContext(ctx, `
INSERT INTO instance (
resource_id,
environment,
- name,
- engine,
- external_link,
- activation,
metadata
- )
- SELECT $1, $2, $3, $4, $5, $6, $7
- %s
- `, where),
+ ) VALUES ($1, $2, $3)
+ `,
instanceCreate.ResourceID,
environment,
- instanceCreate.Title,
- instanceCreate.Engine.String(),
- instanceCreate.ExternalLink,
- instanceCreate.Activation,
metadataBytes,
); err != nil {
return nil, err
@@ -156,10 +132,6 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
instance := &InstanceMessage{
EnvironmentID: instanceCreate.EnvironmentID,
ResourceID: instanceCreate.ResourceID,
- Title: instanceCreate.Title,
- Engine: instanceCreate.Engine,
- ExternalLink: instanceCreate.ExternalLink,
- Activation: instanceCreate.Activation,
Metadata: instanceCreate.Metadata,
}
s.instanceCache.Add(getInstanceCacheKey(instance.ResourceID), instance)
@@ -167,33 +139,12 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
}
// UpdateInstanceV2 updates an instance.
-func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessage, maximumActivation int) (*InstanceMessage, error) {
+func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessage) (*InstanceMessage, error) {
set, args, where := []string{}, []any{}, []string{}
- if v := patch.Title; v != nil {
- set, args = append(set, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *v)
- }
if v := patch.EnvironmentID; v != nil {
set, args = append(set, fmt.Sprintf("environment = $%d", len(args)+1)), append(args, *v)
}
- if v := patch.ExternalLink; v != nil {
- set, args = append(set, fmt.Sprintf("external_link = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.EngineVersion; v != nil {
- set, args = append(set, fmt.Sprintf("engine_version = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.Activation; v != nil {
- set, args = append(set, fmt.Sprintf("activation = $%d", len(args)+1)), append(args, *v)
- if *v {
- where = append(where, fmt.Sprintf("(%s) < %d", countActivateInstanceQuery, maximumActivation))
- }
- }
if v := patch.Deleted; v != nil {
- if patch.Activation != nil {
- return nil, errors.Errorf(`cannot set "activation" and "deleted" at the same time`)
- }
- if *patch.Deleted {
- set, args = append(set, fmt.Sprintf("activation = $%d", len(args)+1)), append(args, false)
- }
set, args = append(set, fmt.Sprintf(`deleted = $%d`, len(args)+1)), append(args, *v)
}
if v := patch.Metadata; v != nil {
@@ -214,7 +165,6 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
instance := &InstanceMessage{}
if len(set) > 0 {
- var engine string
query := fmt.Sprintf(`
UPDATE instance
SET `+strings.Join(set, ", ")+`
@@ -222,11 +172,6 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
RETURNING
resource_id,
environment,
- name,
- engine,
- engine_version,
- external_link,
- activation,
deleted,
metadata
`, strings.Join(where, " AND "))
@@ -235,11 +180,6 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
if err := tx.QueryRowContext(ctx, query, args...).Scan(
&instance.ResourceID,
&environment,
- &instance.Title,
- &engine,
- &instance.EngineVersion,
- &instance.ExternalLink,
- &instance.Activation,
&instance.Deleted,
&metadata,
); err != nil {
@@ -248,11 +188,6 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
if environment.Valid {
instance.EnvironmentID = environment.String
}
- engineTypeValue, ok := storepb.Engine_value[engine]
- if !ok {
- return nil, errors.Errorf("invalid engine %s", engine)
- }
- instance.Engine = storepb.Engine(engineTypeValue)
var instanceMetadata storepb.Instance
if err := common.ProtojsonUnmarshaler.Unmarshal(metadata, &instanceMetadata); err != nil {
@@ -293,12 +228,7 @@ func listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstanceMessage)
rows, err := tx.QueryContext(ctx, fmt.Sprintf(`
SELECT
resource_id,
- name,
environment,
- engine,
- engine_version,
- external_link,
- activation,
deleted,
metadata
FROM instance
@@ -313,16 +243,10 @@ func listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstanceMessage)
for rows.Next() {
var instanceMessage InstanceMessage
var environment sql.NullString
- var engine string
var metadata []byte
if err := rows.Scan(
&instanceMessage.ResourceID,
- &instanceMessage.Title,
&environment,
- &engine,
- &instanceMessage.EngineVersion,
- &instanceMessage.ExternalLink,
- &instanceMessage.Activation,
&instanceMessage.Deleted,
&metadata,
); err != nil {
@@ -331,11 +255,6 @@ func listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstanceMessage)
if environment.Valid {
instanceMessage.EnvironmentID = environment.String
}
- engineTypeValue, ok := storepb.Engine_value[engine]
- if !ok {
- return nil, errors.Errorf("invalid engine %s", engine)
- }
- instanceMessage.Engine = storepb.Engine(engineTypeValue)
var instanceMetadata storepb.Instance
if err := common.ProtojsonUnmarshaler.Unmarshal(metadata, &instanceMetadata); err != nil {
@@ -351,19 +270,15 @@ func listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstanceMessage)
return instanceMessages, nil
}
-var countActivateInstanceQuery = "SELECT COUNT(*) FROM instance WHERE activation = TRUE AND deleted = FALSE"
+var countActivateInstanceQuery = "SELECT COUNT(1) FROM instance WHERE (metadata ? 'activation') AND (metadata->>'activation')::boolean = TRUE AND deleted = FALSE"
-// CheckActivationLimit checks if activation instance count reaches the limit.
-func (s *Store) CheckActivationLimit(ctx context.Context, maximumActivation int) error {
- count := 0
+// GetActivatedInstanceCount gets the number of activated instances.
+func (s *Store) GetActivatedInstanceCount(ctx context.Context) (int, error) {
+ var count int
if err := s.db.db.QueryRowContext(ctx, countActivateInstanceQuery).Scan(&count); err != nil {
- return err
- }
-
- if count >= maximumActivation {
- return common.Errorf(common.Invalid, "activation instance count has reached the limit (%v)", count)
+ return 0, err
}
- return nil
+ return count, nil
}
func validateDataSources(metadata *storepb.Instance) error {
@@ -386,7 +301,7 @@ func validateDataSources(metadata *storepb.Instance) error {
// IsObjectCaseSensitive returns true if the engine ignores database and table case sensitive.
func IsObjectCaseSensitive(instance *InstanceMessage) bool {
- switch instance.Engine {
+ switch instance.Metadata.GetEngine() {
case storepb.Engine_TIDB:
return false
case storepb.Engine_MYSQL, storepb.Engine_MARIADB:
diff --git a/frontend/src/types/proto/store/instance.ts b/frontend/src/types/proto/store/instance.ts
index fc3e2f91fd..bcaa8690dd 100644
--- a/frontend/src/types/proto/store/instance.ts
+++ b/frontend/src/types/proto/store/instance.ts
@@ -9,6 +9,7 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import Long from "long";
import { Duration } from "../google/protobuf/duration";
import { Timestamp } from "../google/protobuf/timestamp";
+import { Engine, engineFromJSON, engineToJSON, engineToNumber } from "./common";
export const protobufPackage = "bytebase.store";
@@ -67,13 +68,12 @@ export function dataSourceTypeToNumber(object: DataSourceType): number {
/** Instance is the proto for instances. */
export interface Instance {
- /**
- * The lower_case_table_names config for MySQL instances.
- * It is used to determine whether the table names and database names are case sensitive.
- */
- mysqlLowerCaseTableNames: number;
- lastSyncTime: Timestamp | undefined;
- roles: InstanceRole[];
+ title: string;
+ engine: Engine;
+ activation: boolean;
+ version: string;
+ externalLink: string;
+ dataSources: DataSource[];
/** How often the instance is synced. */
syncInterval:
| Duration
@@ -88,7 +88,13 @@ export interface Instance {
* Default empty, means sync all schemas & databases.
*/
syncDatabases: string[];
- dataSources: DataSource[];
+ /**
+ * The lower_case_table_names config for MySQL instances.
+ * It is used to determine whether the table names and database names are case sensitive.
+ */
+ mysqlLowerCaseTableNames: number;
+ lastSyncTime: Timestamp | undefined;
+ roles: InstanceRole[];
}
/** InstanceRole is the API message for instance role. */
@@ -548,38 +554,58 @@ export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(
function createBaseInstance(): Instance {
return {
- mysqlLowerCaseTableNames: 0,
- lastSyncTime: undefined,
- roles: [],
+ title: "",
+ engine: Engine.ENGINE_UNSPECIFIED,
+ activation: false,
+ version: "",
+ externalLink: "",
+ dataSources: [],
syncInterval: undefined,
maximumConnections: 0,
syncDatabases: [],
- dataSources: [],
+ mysqlLowerCaseTableNames: 0,
+ lastSyncTime: undefined,
+ roles: [],
};
}
export const Instance: MessageFns<Instance> = {
encode(message: Instance, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.mysqlLowerCaseTableNames !== 0) {
- writer.uint32(8).int32(message.mysqlLowerCaseTableNames);
+ if (message.title !== "") {
+ writer.uint32(10).string(message.title);
}
- if (message.lastSyncTime !== undefined) {
- Timestamp.encode(message.lastSyncTime, writer.uint32(18).fork()).join();
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ writer.uint32(16).int32(engineToNumber(message.engine));
}
- for (const v of message.roles) {
- InstanceRole.encode(v!, writer.uint32(26).fork()).join();
+ if (message.activation !== false) {
+ writer.uint32(24).bool(message.activation);
+ }
+ if (message.version !== "") {
+ writer.uint32(34).string(message.version);
+ }
+ if (message.externalLink !== "") {
+ writer.uint32(42).string(message.externalLink);
+ }
+ for (const v of message.dataSources) {
+ DataSource.encode(v!, writer.uint32(50).fork()).join();
}
if (message.syncInterval !== undefined) {
- Duration.encode(message.syncInterval, writer.uint32(34).fork()).join();
+ Duration.encode(message.syncInterval, writer.uint32(58).fork()).join();
}
if (message.maximumConnections !== 0) {
- writer.uint32(40).int32(message.maximumConnections);
+ writer.uint32(64).int32(message.maximumConnections);
}
for (const v of message.syncDatabases) {
- writer.uint32(50).string(v!);
+ writer.uint32(74).string(v!);
}
- for (const v of message.dataSources) {
- DataSource.encode(v!, writer.uint32(58).fork()).join();
+ if (message.mysqlLowerCaseTableNames !== 0) {
+ writer.uint32(80).int32(message.mysqlLowerCaseTableNames);
+ }
+ if (message.lastSyncTime !== undefined) {
+ Timestamp.encode(message.lastSyncTime, writer.uint32(90).fork()).join();
+ }
+ for (const v of message.roles) {
+ InstanceRole.encode(v!, writer.uint32(98).fork()).join();
}
return writer;
},
@@ -592,27 +618,27 @@ export const Instance: MessageFns<Instance> = {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
- if (tag !== 8) {
+ if (tag !== 10) {
break;
}
- message.mysqlLowerCaseTableNames = reader.int32();
+ message.title = reader.string();
continue;
}
case 2: {
- if (tag !== 18) {
+ if (tag !== 16) {
break;
}
- message.lastSyncTime = Timestamp.decode(reader, reader.uint32());
+ message.engine = engineFromJSON(reader.int32());
continue;
}
case 3: {
- if (tag !== 26) {
+ if (tag !== 24) {
break;
}
- message.roles.push(InstanceRole.decode(reader, reader.uint32()));
+ message.activation = reader.bool();
continue;
}
case 4: {
@@ -620,15 +646,15 @@ export const Instance: MessageFns<Instance> = {
break;
}
- message.syncInterval = Duration.decode(reader, reader.uint32());
+ message.version = reader.string();
continue;
}
case 5: {
- if (tag !== 40) {
+ if (tag !== 42) {
break;
}
- message.maximumConnections = reader.int32();
+ message.externalLink = reader.string();
continue;
}
case 6: {
@@ -636,7 +662,7 @@ export const Instance: MessageFns<Instance> = {
break;
}
- message.syncDatabases.push(reader.string());
+ message.dataSources.push(DataSource.decode(reader, reader.uint32()));
continue;
}
case 7: {
@@ -644,7 +670,47 @@ export const Instance: MessageFns<Instance> = {
break;
}
- message.dataSources.push(DataSource.decode(reader, reader.uint32()));
+ message.syncInterval = Duration.decode(reader, reader.uint32());
+ continue;
+ }
+ case 8: {
+ if (tag !== 64) {
+ break;
+ }
+
+ message.maximumConnections = reader.int32();
+ continue;
+ }
+ case 9: {
+ if (tag !== 74) {
+ break;
+ }
+
+ message.syncDatabases.push(reader.string());
+ continue;
+ }
+ case 10: {
+ if (tag !== 80) {
+ break;
+ }
+
+ message.mysqlLowerCaseTableNames = reader.int32();
+ continue;
+ }
+ case 11: {
+ if (tag !== 90) {
+ break;
+ }
+
+ message.lastSyncTime = Timestamp.decode(reader, reader.uint32());
+ continue;
+ }
+ case 12: {
+ if (tag !== 98) {
+ break;
+ }
+
+ message.roles.push(InstanceRole.decode(reader, reader.uint32()));
continue;
}
}
@@ -658,32 +724,46 @@ export const Instance: MessageFns<Instance> = {
fromJSON(object: any): Instance {
return {
- mysqlLowerCaseTableNames: isSet(object.mysqlLowerCaseTableNames)
- ? globalThis.Number(object.mysqlLowerCaseTableNames)
- : 0,
- lastSyncTime: isSet(object.lastSyncTime) ? fromJsonTimestamp(object.lastSyncTime) : undefined,
- roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => InstanceRole.fromJSON(e)) : [],
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : Engine.ENGINE_UNSPECIFIED,
+ activation: isSet(object.activation) ? globalThis.Boolean(object.activation) : false,
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
+ externalLink: isSet(object.externalLink) ? globalThis.String(object.externalLink) : "",
+ dataSources: globalThis.Array.isArray(object?.dataSources)
+ ? object.dataSources.map((e: any) => DataSource.fromJSON(e))
+ : [],
syncInterval: isSet(object.syncInterval) ? Duration.fromJSON(object.syncInterval) : undefined,
maximumConnections: isSet(object.maximumConnections) ? globalThis.Number(object.maximumConnections) : 0,
syncDatabases: globalThis.Array.isArray(object?.syncDatabases)
? object.syncDatabases.map((e: any) => globalThis.String(e))
: [],
- dataSources: globalThis.Array.isArray(object?.dataSources)
- ? object.dataSources.map((e: any) => DataSource.fromJSON(e))
- : [],
+ mysqlLowerCaseTableNames: isSet(object.mysqlLowerCaseTableNames)
+ ? globalThis.Number(object.mysqlLowerCaseTableNames)
+ : 0,
+ lastSyncTime: isSet(object.lastSyncTime) ? fromJsonTimestamp(object.lastSyncTime) : undefined,
+ roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => InstanceRole.fromJSON(e)) : [],
};
},
toJSON(message: Instance): unknown {
const obj: any = {};
- if (message.mysqlLowerCaseTableNames !== 0) {
- obj.mysqlLowerCaseTableNames = Math.round(message.mysqlLowerCaseTableNames);
+ if (message.title !== "") {
+ obj.title = message.title;
}
- if (message.lastSyncTime !== undefined) {
- obj.lastSyncTime = fromTimestamp(message.lastSyncTime).toISOString();
+ if (message.engine !== Engine.ENGINE_UNSPECIFIED) {
+ obj.engine = engineToJSON(message.engine);
}
- if (message.roles?.length) {
- obj.roles = message.roles.map((e) => InstanceRole.toJSON(e));
+ if (message.activation !== false) {
+ obj.activation = message.activation;
+ }
+ if (message.version !== "") {
+ obj.version = message.version;
+ }
+ if (message.externalLink !== "") {
+ obj.externalLink = message.externalLink;
+ }
+ if (message.dataSources?.length) {
+ obj.dataSources = message.dataSources.map((e) => DataSource.toJSON(e));
}
if (message.syncInterval !== undefined) {
obj.syncInterval = Duration.toJSON(message.syncInterval);
@@ -694,8 +774,14 @@ export const Instance: MessageFns<Instance> = {
if (message.syncDatabases?.length) {
obj.syncDatabases = message.syncDatabases;
}
- if (message.dataSources?.length) {
- obj.dataSources = message.dataSources.map((e) => DataSource.toJSON(e));
+ if (message.mysqlLowerCaseTableNames !== 0) {
+ obj.mysqlLowerCaseTableNames = Math.round(message.mysqlLowerCaseTableNames);
+ }
+ if (message.lastSyncTime !== undefined) {
+ obj.lastSyncTime = fromTimestamp(message.lastSyncTime).toISOString();
+ }
+ if (message.roles?.length) {
+ obj.roles = message.roles.map((e) => InstanceRole.toJSON(e));
}
return obj;
},
@@ -705,17 +791,22 @@ export const Instance: MessageFns<Instance> = {
},
fromPartial(object: DeepPartial<Instance>): Instance {
const message = createBaseInstance();
- message.mysqlLowerCaseTableNames = object.mysqlLowerCaseTableNames ?? 0;
- message.lastSyncTime = (object.lastSyncTime !== undefined && object.lastSyncTime !== null)
- ? Timestamp.fromPartial(object.lastSyncTime)
- : undefined;
- message.roles = object.roles?.map((e) => InstanceRole.fromPartial(e)) || [];
+ message.title = object.title ?? "";
+ message.engine = object.engine ?? Engine.ENGINE_UNSPECIFIED;
+ message.activation = object.activation ?? false;
+ message.version = object.version ?? "";
+ message.externalLink = object.externalLink ?? "";
+ message.dataSources = object.dataSources?.map((e) => DataSource.fromPartial(e)) || [];
message.syncInterval = (object.syncInterval !== undefined && object.syncInterval !== null)
? Duration.fromPartial(object.syncInterval)
: undefined;
message.maximumConnections = object.maximumConnections ?? 0;
message.syncDatabases = object.syncDatabases?.map((e) => e) || [];
- message.dataSources = object.dataSources?.map((e) => DataSource.fromPartial(e)) || [];
+ message.mysqlLowerCaseTableNames = object.mysqlLowerCaseTableNames ?? 0;
+ message.lastSyncTime = (object.lastSyncTime !== undefined && object.lastSyncTime !== null)
+ ? Timestamp.fromPartial(object.lastSyncTime)
+ : undefined;
+ message.roles = object.roles?.map((e) => InstanceRole.fromPartial(e)) || [];
return message;
},
};
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 29fc74a0d2..65260e1143 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -9764,19 +9764,49 @@ components:
Instance:
type: object
properties:
- mysqlLowerCaseTableNames:
- type: integer
- description: |-
- The lower_case_table_names config for MySQL instances.
- It is used to determine whether the table names and database names are case sensitive.
- format: int32
- lastSyncTime:
+ title:
type: string
- format: date-time
- roles:
+ engine:
+ enum:
+ - ENGINE_UNSPECIFIED
+ - CLICKHOUSE
+ - MYSQL
+ - POSTGRES
+ - SNOWFLAKE
+ - SQLITE
+ - TIDB
+ - MONGODB
+ - REDIS
+ - ORACLE
+ - SPANNER
+ - MSSQL
+ - REDSHIFT
+ - MARIADB
+ - OCEANBASE
+ - DM
+ - RISINGWAVE
+ - OCEANBASE_ORACLE
+ - STARROCKS
+ - DORIS
+ - HIVE
+ - ELASTICSEARCH
+ - BIGQUERY
+ - DYNAMODB
+ - DATABRICKS
+ - COCKROACHDB
+ - COSMOSDB
+ type: string
+ format: enum
+ activation:
+ type: boolean
+ version:
+ type: string
+ externalLink:
+ type: string
+ dataSources:
type: array
items:
- $ref: '#/components/schemas/InstanceRole'
+ $ref: '#/components/schemas/DataSource'
syncInterval:
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
type: string
@@ -9794,10 +9824,19 @@ components:
description: |-
Enable sync for following databases.
Default empty, means sync all schemas & databases.
- dataSources:
+ mysqlLowerCaseTableNames:
+ type: integer
+ description: |-
+ The lower_case_table_names config for MySQL instances.
+ It is used to determine whether the table names and database names are case sensitive.
+ format: int32
+ lastSyncTime:
+ type: string
+ format: date-time
+ roles:
type: array
items:
- $ref: '#/components/schemas/DataSource'
+ $ref: '#/components/schemas/InstanceRole'
description: Instance is the proto for instances.
InstanceResource:
type: object
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index ba58cc8230..1d9a5a3002 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -2622,13 +2622,18 @@ Instance is the proto for instances.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| mysql_lower_case_table_names | [int32](#int32) | | The lower_case_table_names config for MySQL instances. It is used to determine whether the table names and database names are case sensitive. |
-| last_sync_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
-| roles | [InstanceRole](#bytebase-store-InstanceRole) | repeated | |
+| title | [string](#string) | | |
+| engine | [Engine](#bytebase-store-Engine) | | |
+| activation | [bool](#bool) | | |
+| version | [string](#string) | | |
+| external_link | [string](#string) | | |
+| data_sources | [DataSource](#bytebase-store-DataSource) | repeated | |
| sync_interval | [google.protobuf.Duration](#google-protobuf-Duration) | | How often the instance is synced. |
| maximum_connections | [int32](#int32) | | The maximum number of connections. The default is 10 if the value is unset or zero. |
| sync_databases | [string](#string) | repeated | Enable sync for following databases. Default empty, means sync all schemas &amp; databases. |
-| data_sources | [DataSource](#bytebase-store-DataSource) | repeated | |
+| mysql_lower_case_table_names | [int32](#int32) | | The lower_case_table_names config for MySQL instances. It is used to determine whether the table names and database names are case sensitive. |
+| last_sync_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
+| roles | [InstanceRole](#bytebase-store-InstanceRole) | repeated | |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 85177e8c3a..7eb3ff897b 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -7292,23 +7292,43 @@ For PostgreSQL HA, this can be used to set target_session_attrs=read-write </p><
<tbody>
<tr>
- <td>mysql_lower_case_table_names</td>
- <td><a href="#int32">int32</a></td>
+ <td>title</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p>The lower_case_table_names config for MySQL instances.
-It is used to determine whether the table names and database names are case sensitive. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>last_sync_time</td>
- <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td>engine</td>
+ <td><a href="#bytebase.store.Engine">Engine</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>roles</td>
- <td><a href="#bytebase.store.InstanceRole">InstanceRole</a></td>
+ <td>activation</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>version</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>external_link</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>data_sources</td>
+ <td><a href="#bytebase.store.DataSource">DataSource</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
@@ -7337,8 +7357,23 @@ Default empty, means sync all schemas &amp; databases. </p></td>
</tr>
<tr>
- <td>data_sources</td>
- <td><a href="#bytebase.store.DataSource">DataSource</a></td>
+ <td>mysql_lower_case_table_names</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The lower_case_table_names config for MySQL instances.
+It is used to determine whether the table names and database names are case sensitive. </p></td>
+ </tr>
+
+ <tr>
+ <td>last_sync_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>roles</td>
+ <td><a href="#bytebase.store.InstanceRole">InstanceRole</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
diff --git a/proto/generated-go/store/instance.pb.go b/proto/generated-go/store/instance.pb.go
index 31a2318c50..9b2296d3ea 100644
--- a/proto/generated-go/store/instance.pb.go
+++ b/proto/generated-go/store/instance.pb.go
@@ -336,23 +336,28 @@ func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) EnumDescriptor() ([
// Instance is the proto for instances.
type Instance struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The lower_case_table_names config for MySQL instances.
- // It is used to determine whether the table names and database names are case sensitive.
- MysqlLowerCaseTableNames int32 `protobuf:"varint,1,opt,name=mysql_lower_case_table_names,json=mysqlLowerCaseTableNames,proto3" json:"mysql_lower_case_table_names,omitempty"`
- LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"`
- Roles []*InstanceRole `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"`
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
+ Engine Engine `protobuf:"varint,2,opt,name=engine,proto3,enum=bytebase.store.Engine" json:"engine,omitempty"`
+ Activation bool `protobuf:"varint,3,opt,name=activation,proto3" json:"activation,omitempty"`
+ Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
+ ExternalLink string `protobuf:"bytes,5,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"`
+ DataSources []*DataSource `protobuf:"bytes,6,rep,name=data_sources,json=dataSources,proto3" json:"data_sources,omitempty"`
// How often the instance is synced.
- SyncInterval *durationpb.Duration `protobuf:"bytes,4,opt,name=sync_interval,json=syncInterval,proto3" json:"sync_interval,omitempty"`
+ SyncInterval *durationpb.Duration `protobuf:"bytes,7,opt,name=sync_interval,json=syncInterval,proto3" json:"sync_interval,omitempty"`
// The maximum number of connections.
// The default is 10 if the value is unset or zero.
- MaximumConnections int32 `protobuf:"varint,5,opt,name=maximum_connections,json=maximumConnections,proto3" json:"maximum_connections,omitempty"`
+ MaximumConnections int32 `protobuf:"varint,8,opt,name=maximum_connections,json=maximumConnections,proto3" json:"maximum_connections,omitempty"`
// Enable sync for following databases.
// Default empty, means sync all schemas & databases.
- SyncDatabases []string `protobuf:"bytes,6,rep,name=sync_databases,json=syncDatabases,proto3" json:"sync_databases,omitempty"`
- DataSources []*DataSource `protobuf:"bytes,7,rep,name=data_sources,json=dataSources,proto3" json:"data_sources,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ SyncDatabases []string `protobuf:"bytes,9,rep,name=sync_databases,json=syncDatabases,proto3" json:"sync_databases,omitempty"`
+ // The lower_case_table_names config for MySQL instances.
+ // It is used to determine whether the table names and database names are case sensitive.
+ MysqlLowerCaseTableNames int32 `protobuf:"varint,10,opt,name=mysql_lower_case_table_names,json=mysqlLowerCaseTableNames,proto3" json:"mysql_lower_case_table_names,omitempty"`
+ LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"`
+ Roles []*InstanceRole `protobuf:"bytes,12,rep,name=roles,proto3" json:"roles,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Instance) Reset() {
@@ -385,23 +390,44 @@ func (*Instance) Descriptor() ([]byte, []int) {
return file_store_instance_proto_rawDescGZIP(), []int{0}
}
-func (x *Instance) GetMysqlLowerCaseTableNames() int32 {
+func (x *Instance) GetTitle() string {
if x != nil {
- return x.MysqlLowerCaseTableNames
+ return x.Title
}
- return 0
+ return ""
}
-func (x *Instance) GetLastSyncTime() *timestamppb.Timestamp {
+func (x *Instance) GetEngine() Engine {
if x != nil {
- return x.LastSyncTime
+ return x.Engine
}
- return nil
+ return Engine_ENGINE_UNSPECIFIED
}
-func (x *Instance) GetRoles() []*InstanceRole {
+func (x *Instance) GetActivation() bool {
if x != nil {
- return x.Roles
+ return x.Activation
+ }
+ return false
+}
+
+func (x *Instance) GetVersion() string {
+ if x != nil {
+ return x.Version
+ }
+ return ""
+}
+
+func (x *Instance) GetExternalLink() string {
+ if x != nil {
+ return x.ExternalLink
+ }
+ return ""
+}
+
+func (x *Instance) GetDataSources() []*DataSource {
+ if x != nil {
+ return x.DataSources
}
return nil
}
@@ -427,9 +453,23 @@ func (x *Instance) GetSyncDatabases() []string {
return nil
}
-func (x *Instance) GetDataSources() []*DataSource {
+func (x *Instance) GetMysqlLowerCaseTableNames() int32 {
if x != nil {
- return x.DataSources
+ return x.MysqlLowerCaseTableNames
+ }
+ return 0
+}
+
+func (x *Instance) GetLastSyncTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.LastSyncTime
+ }
+ return nil
+}
+
+func (x *Instance) GetRoles() []*InstanceRole {
+ if x != nil {
+ return x.Roles
}
return nil
}
@@ -1360,266 +1400,278 @@ var file_store_instance_proto_rawDesc = string([]byte{
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
- 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x03, 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74,
- 0x61, 0x6e, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x1c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x6c, 0x6f,
+ 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63,
+ 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x04, 0x0a, 0x08,
+ 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c,
+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2e,
+ 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
+ 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x1e,
+ 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x08, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18,
+ 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65,
+ 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x3d, 0x0a,
+ 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52,
+ 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0d,
+ 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c,
+ 0x73, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x13,
+ 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x69, 0x6d,
+ 0x75, 0x6d, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a,
+ 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x18,
+ 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x1c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x6c, 0x6f,
0x77, 0x65, 0x72, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e,
- 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x6d, 0x79, 0x73, 0x71,
+ 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x6d, 0x79, 0x73, 0x71,
0x6c, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e,
0x61, 0x6d, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x6e,
- 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
+ 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79,
0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18,
- 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52,
- 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0d, 0x73, 0x79,
- 0x6e, 0x63, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x73, 0x79,
- 0x6e, 0x63, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x13, 0x6d, 0x61,
- 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d,
- 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73,
- 0x79, 0x6e, 0x63, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x06, 0x20,
- 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63,
- 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0xce, 0x01, 0x0a, 0x0c, 0x49,
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
+ 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69,
+ 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12,
+ 0x24, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74,
+ 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x63, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x0e, 0x0a,
+ 0x0c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x42, 0x0c, 0x0a,
+ 0x0a, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x9b, 0x11, 0x0a, 0x0a,
+ 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79,
+ 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f,
- 0x75, 0x72, 0x63, 0x65, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
- 0x73, 0x22, 0xce, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x6f,
- 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
- 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69,
- 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f,
- 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x76,
- 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09,
- 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48,
- 0x02, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42,
- 0x13, 0x0a, 0x11, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c,
- 0x69, 0x6d, 0x69, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75,
- 0x6e, 0x74, 0x69, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
- 0x74, 0x65, 0x22, 0x9b, 0x11, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63,
- 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
- 0x64, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52,
- 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,
- 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,
- 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12,
- 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
- 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x1e, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x2a, 0x0a, 0x11, 0x6f,
- 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x63, 0x61,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74,
- 0x65, 0x64, 0x53, 0x73, 0x6c, 0x43, 0x61, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x62, 0x66, 0x75, 0x73,
- 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64,
- 0x53, 0x73, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x62, 0x66, 0x75, 0x73,
- 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53,
- 0x73, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72,
- 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a,
- 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x72, 0x76,
- 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x73, 0x72, 0x76, 0x12, 0x37, 0x0a, 0x17, 0x61,
- 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x61, 0x75,
- 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f,
- 0x73, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x69,
- 0x63, 0x61, 0x53, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69,
- 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73,
- 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73,
- 0x68, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73,
- 0x68, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x70, 0x6f, 0x72,
- 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68, 0x50, 0x6f, 0x72, 0x74,
- 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x11, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x73,
- 0x73, 0x68, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61,
- 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x73, 0x73,
- 0x68, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77,
- 0x6f, 0x72, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x73, 0x73, 0x68, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73,
- 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65,
- 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x73, 0x73, 0x68, 0x4f, 0x62, 0x66, 0x75,
- 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79,
- 0x12, 0x51, 0x0a, 0x25, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f,
- 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x22, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50,
- 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61,
- 0x74, 0x65, 0x64, 0x12, 0x51, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f,
- 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62,
+ 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a,
+ 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x6f, 0x62,
+ 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
+ 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61,
+ 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75,
+ 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73,
+ 0x65, 0x53, 0x73, 0x6c, 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74,
+ 0x65, 0x64, 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x63, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x0f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x73, 0x6c, 0x43, 0x61,
+ 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73,
+ 0x73, 0x6c, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6f,
+ 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x73, 0x6c, 0x43, 0x65, 0x72, 0x74,
+ 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73,
+ 0x73, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x62,
+ 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x73, 0x6c, 0x4b, 0x65, 0x79, 0x12, 0x12,
+ 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f,
+ 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x72, 0x76, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52,
+ 0x03, 0x73, 0x72, 0x76, 0x12, 0x37, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18,
+ 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a,
+ 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x12, 0x10,
+ 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64,
+ 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
+ 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18,
+ 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19,
+ 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x07, 0x73, 0x73, 0x68, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68,
+ 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68,
+ 0x55, 0x73, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x73, 0x68, 0x5f, 0x6f, 0x62, 0x66, 0x75,
+ 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18,
+ 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x73, 0x73, 0x68, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63,
+ 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3b, 0x0a, 0x1a,
+ 0x73, 0x73, 0x68, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70,
+ 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x17, 0x73, 0x73, 0x68, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50,
+ 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x51, 0x0a, 0x25, 0x61, 0x75, 0x74,
+ 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x76,
+ 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74,
+ 0x65, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x22, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e,
+ 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b,
+ 0x65, 0x79, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x51, 0x0a, 0x0f,
+ 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18,
+ 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52,
+ 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12,
+ 0x5e, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x62,
0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61,
- 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
- 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
- 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x5e, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e,
- 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x16, 0x20,
- 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e,
- 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79,
- 0x70, 0x65, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x6d, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
- 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69,
- 0x61, 0x6c, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f,
- 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65,
- 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x16, 0x63,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65,
- 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x61, 0x73, 0x6c, 0x5f, 0x63, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x41, 0x53, 0x4c,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x73, 0x61, 0x73, 0x6c, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x12, 0x55, 0x0a, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
- 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b,
- 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x41, 0x64, 0x64,
- 0x72, 0x65, 0x73, 0x73, 0x52, 0x13, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
- 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x72,
- 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1b,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x6e,
- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e,
- 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x21,
- 0x0a, 0x0c, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x1d,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49,
- 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
- 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61,
- 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x75, 0x73, 0x65,
- 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x73,
- 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x6d,
- 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64,
- 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x18, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65,
- 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x64,
- 0x69, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44,
- 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x54,
- 0x79, 0x70, 0x65, 0x52, 0x09, 0x72, 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18,
- 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x79, 0x0a, 0x1b, 0x65, 0x78, 0x74, 0x72,
- 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72,
- 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x24, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44,
- 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43,
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
- 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x19, 0x65, 0x78, 0x74, 0x72, 0x61, 0x43,
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
- 0x65, 0x72, 0x73, 0x1a, 0x77, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63,
- 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1b, 0x0a,
- 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c,
- 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e,
- 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
- 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x1a, 0x31, 0x0a, 0x07,
- 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70,
- 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a,
- 0x4c, 0x0a, 0x1e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
+ 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x12, 0x61, 0x75, 0x74,
+ 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12,
+ 0x6d, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
+ 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x17, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
+ 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x6c,
+ 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e,
+ 0x74, 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65,
+ 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x3b,
+ 0x0a, 0x0b, 0x73, 0x61, 0x73, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x18, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x41, 0x53, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
+ 0x0a, 0x73, 0x61, 0x73, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x55, 0x0a, 0x14, 0x61,
+ 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
+ 0x73, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x13, 0x61,
+ 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
+ 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
+ 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x61, 0x72, 0x65, 0x68,
+ 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77,
+ 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61,
+ 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x0a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d,
+ 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x20,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72,
+ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6f,
+ 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
+ 0x72, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72,
+ 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
+ 0x72, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x64, 0x69, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65,
+ 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72,
+ 0x63, 0x65, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x72, 0x65,
+ 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74,
+ 0x65, 0x72, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65,
+ 0x72, 0x12, 0x79, 0x0a, 0x1b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
+ 0x18, 0x24, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72,
+ 0x63, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 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, 0x7c, 0x0a,
- 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54,
- 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43,
- 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
- 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10,
- 0x01, 0x12, 0x18, 0x0a, 0x14, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x43, 0x4c, 0x4f, 0x55,
- 0x44, 0x5f, 0x53, 0x51, 0x4c, 0x5f, 0x49, 0x41, 0x4d, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x41,
- 0x57, 0x53, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x49, 0x41, 0x4d, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09,
- 0x41, 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x49, 0x41, 0x4d, 0x10, 0x04, 0x22, 0x52, 0x0a, 0x09, 0x52,
- 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x44, 0x49,
- 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
- 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x4c, 0x4f,
- 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x45, 0x4e, 0x54, 0x49, 0x4e, 0x45, 0x4c,
- 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x10, 0x03, 0x42,
- 0x0f, 0x0a, 0x0d, 0x69, 0x61, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x22, 0x5a, 0x0a, 0x0a, 0x53, 0x41, 0x53, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f,
- 0x0a, 0x0a, 0x6b, 0x72, 0x62, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x4b, 0x65, 0x72, 0x62, 0x65, 0x72, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x48, 0x00, 0x52, 0x09, 0x6b, 0x72, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42,
- 0x0b, 0x0a, 0x09, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x22, 0xe0, 0x01, 0x0a,
- 0x0e, 0x4b, 0x65, 0x72, 0x62, 0x65, 0x72, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
- 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73,
- 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73,
- 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x6b,
- 0x65, 0x79, 0x74, 0x61, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6b, 0x65, 0x79,
- 0x74, 0x61, 0x62, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19,
- 0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x07, 0x6b, 0x64, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x6b, 0x64, 0x63,
- 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x63, 0x6f, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6b, 0x64, 0x63, 0x54, 0x72,
- 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22,
- 0x81, 0x07, 0x0a, 0x18, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78,
- 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x54, 0x0a, 0x0b,
- 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x33, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74,
- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x72,
- 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79,
- 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x03, 0x75, 0x72, 0x6c, 0x12, 0x4e, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70,
- 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75,
- 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65,
- 0x74, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68,
- 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x6f, 0x6c, 0x65,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x79, 0x52, 0x19, 0x65, 0x78, 0x74, 0x72, 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x77, 0x0a, 0x16,
+ 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74,
+ 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e,
+ 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64,
+ 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65,
+ 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53,
+ 0x65, 0x63, 0x72, 0x65, 0x74, 0x1a, 0x31, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
+ 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
+ 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x4c, 0x0a, 0x1e, 0x45, 0x78, 0x74, 0x72,
+ 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d,
+ 0x65, 0x74, 0x65, 0x72, 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, 0x7c, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e,
+ 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x1a,
+ 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08,
+ 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x47, 0x4f,
+ 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x5f, 0x53, 0x51, 0x4c, 0x5f, 0x49,
+ 0x41, 0x4d, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x57, 0x53, 0x5f, 0x52, 0x44, 0x53, 0x5f,
+ 0x49, 0x41, 0x4d, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x49,
+ 0x41, 0x4d, 0x10, 0x04, 0x22, 0x52, 0x0a, 0x09, 0x52, 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70,
+ 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x44, 0x49, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a,
+ 0x0a, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x4c, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a,
+ 0x08, 0x53, 0x45, 0x4e, 0x54, 0x49, 0x4e, 0x45, 0x4c, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43,
+ 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x10, 0x03, 0x42, 0x0f, 0x0a, 0x0d, 0x69, 0x61, 0x6d, 0x5f,
+ 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x0a, 0x53, 0x41, 0x53,
+ 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x0a, 0x6b, 0x72, 0x62, 0x5f, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4b, 0x65, 0x72,
+ 0x62, 0x65, 0x72, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x09, 0x6b,
+ 0x72, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x0b, 0x0a, 0x09, 0x6d, 0x65, 0x63, 0x68,
+ 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x22, 0xe0, 0x01, 0x0a, 0x0e, 0x4b, 0x65, 0x72, 0x62, 0x65, 0x72,
+ 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x6d,
+ 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61,
+ 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x14,
+ 0x0a, 0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72,
+ 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x12, 0x19, 0x0a, 0x08,
+ 0x6b, 0x64, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+ 0x6b, 0x64, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f, 0x70,
+ 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64, 0x63, 0x50, 0x6f,
+ 0x72, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x6b, 0x64, 0x63, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70,
+ 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x07, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x14, 0x6b, 0x64, 0x63, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
+ 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x81, 0x07, 0x0a, 0x18, 0x44, 0x61, 0x74,
+ 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53,
+ 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x54, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61,
+ 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65,
+ 0x63, 0x72, 0x65, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52,
+ 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75,
+ 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x4e, 0x0a,
+ 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e,
+ 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
+ 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65,
+ 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54,
+ 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a,
+ 0x08, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c,
+ 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x61,
+ 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f,
+ 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12,
+ 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65,
+ 0x12, 0x2a, 0x0a, 0x11, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6b, 0x65, 0x79,
+ 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x73,
+ 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x8a, 0x02, 0x0a,
+ 0x11, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69,
+ 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73,
+ 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+ 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x49, 0x64, 0x12, 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74,
0x2e, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x61, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a,
- 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05,
- 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f,
- 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69,
- 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
- 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63,
- 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x70, 0x61, 0x73, 0x73, 0x77,
- 0x6f, 0x72, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4b, 0x65, 0x79, 0x4e,
- 0x61, 0x6d, 0x65, 0x1a, 0x8a, 0x02, 0x0a, 0x11, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x41,
- 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c,
- 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65,
- 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x49, 0x64, 0x12,
- 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44,
- 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61,
- 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x41,
- 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74,
- 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f,
- 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
- 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x45, 0x0a, 0x0a, 0x53, 0x65, 0x63,
- 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x45, 0x43, 0x52, 0x45,
- 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
- 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x12,
- 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x56, 0x49, 0x52, 0x4f, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02,
- 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c,
- 0x0a, 0x18, 0x53, 0x41, 0x45, 0x43, 0x52, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
- 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b,
- 0x56, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x4b, 0x56, 0x5f, 0x56, 0x32, 0x10, 0x01, 0x12, 0x17, 0x0a,
- 0x13, 0x41, 0x57, 0x53, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x53, 0x5f, 0x4d, 0x41, 0x4e,
- 0x41, 0x47, 0x45, 0x52, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x47, 0x43, 0x50, 0x5f, 0x53, 0x45,
- 0x43, 0x52, 0x45, 0x54, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x03, 0x22, 0x44,
- 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55,
- 0x54, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
- 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x01,
- 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x5f, 0x52, 0x4f,
- 0x4c, 0x45, 0x10, 0x02, 0x42, 0x0d, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6f, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x2a, 0x47, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63,
- 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x53, 0x4f,
- 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
- 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a,
- 0x09, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 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,
+ 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
+ 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x74,
+ 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x61,
+ 0x74, 0x68, 0x22, 0x45, 0x0a, 0x0a, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65,
+ 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a,
+ 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x56, 0x49,
+ 0x52, 0x4f, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x65, 0x63,
+ 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x41, 0x45, 0x43, 0x52,
+ 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x4b,
+ 0x56, 0x5f, 0x56, 0x32, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x57, 0x53, 0x5f, 0x53, 0x45,
+ 0x43, 0x52, 0x45, 0x54, 0x53, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x02, 0x12,
+ 0x16, 0x0a, 0x12, 0x47, 0x43, 0x50, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x5f, 0x4d, 0x41,
+ 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x03, 0x22, 0x44, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x54,
+ 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09,
+ 0x0a, 0x05, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x41, 0x55,
+ 0x4c, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x0d, 0x0a,
+ 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x47, 0x0a, 0x0e,
+ 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b,
+ 0x0a, 0x17, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e,
+ 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41,
+ 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x4f,
+ 0x4e, 0x4c, 0x59, 0x10, 0x02, 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 (
@@ -1653,32 +1705,34 @@ var file_store_instance_proto_goTypes = []any{
(*DataSource_Address)(nil), // 13: bytebase.store.DataSource.Address
nil, // 14: bytebase.store.DataSource.ExtraConnectionParametersEntry
(*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 15: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
- (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp
+ (Engine)(0), // 16: bytebase.store.Engine
(*durationpb.Duration)(nil), // 17: google.protobuf.Duration
+ (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp
}
var file_store_instance_proto_depIdxs = []int32{
- 16, // 0: bytebase.store.Instance.last_sync_time:type_name -> google.protobuf.Timestamp
- 7, // 1: bytebase.store.Instance.roles:type_name -> bytebase.store.InstanceRole
+ 16, // 0: bytebase.store.Instance.engine:type_name -> bytebase.store.Engine
+ 8, // 1: bytebase.store.Instance.data_sources:type_name -> bytebase.store.DataSource
17, // 2: bytebase.store.Instance.sync_interval:type_name -> google.protobuf.Duration
- 8, // 3: bytebase.store.Instance.data_sources:type_name -> bytebase.store.DataSource
- 0, // 4: bytebase.store.DataSource.type:type_name -> bytebase.store.DataSourceType
- 11, // 5: bytebase.store.DataSource.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
- 1, // 6: bytebase.store.DataSource.authentication_type:type_name -> bytebase.store.DataSource.AuthenticationType
- 12, // 7: bytebase.store.DataSource.client_secret_credential:type_name -> bytebase.store.DataSource.ClientSecretCredential
- 9, // 8: bytebase.store.DataSource.sasl_config:type_name -> bytebase.store.SASLConfig
- 13, // 9: bytebase.store.DataSource.additional_addresses:type_name -> bytebase.store.DataSource.Address
- 2, // 10: bytebase.store.DataSource.redis_type:type_name -> bytebase.store.DataSource.RedisType
- 14, // 11: bytebase.store.DataSource.extra_connection_parameters:type_name -> bytebase.store.DataSource.ExtraConnectionParametersEntry
- 10, // 12: bytebase.store.SASLConfig.krb_config:type_name -> bytebase.store.KerberosConfig
- 3, // 13: bytebase.store.DataSourceExternalSecret.secret_type:type_name -> bytebase.store.DataSourceExternalSecret.SecretType
- 4, // 14: bytebase.store.DataSourceExternalSecret.auth_type:type_name -> bytebase.store.DataSourceExternalSecret.AuthType
- 15, // 15: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
- 5, // 16: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
- 17, // [17:17] is the sub-list for method output_type
- 17, // [17:17] is the sub-list for method input_type
- 17, // [17:17] is the sub-list for extension type_name
- 17, // [17:17] is the sub-list for extension extendee
- 0, // [0:17] is the sub-list for field type_name
+ 18, // 3: bytebase.store.Instance.last_sync_time:type_name -> google.protobuf.Timestamp
+ 7, // 4: bytebase.store.Instance.roles:type_name -> bytebase.store.InstanceRole
+ 0, // 5: bytebase.store.DataSource.type:type_name -> bytebase.store.DataSourceType
+ 11, // 6: bytebase.store.DataSource.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
+ 1, // 7: bytebase.store.DataSource.authentication_type:type_name -> bytebase.store.DataSource.AuthenticationType
+ 12, // 8: bytebase.store.DataSource.client_secret_credential:type_name -> bytebase.store.DataSource.ClientSecretCredential
+ 9, // 9: bytebase.store.DataSource.sasl_config:type_name -> bytebase.store.SASLConfig
+ 13, // 10: bytebase.store.DataSource.additional_addresses:type_name -> bytebase.store.DataSource.Address
+ 2, // 11: bytebase.store.DataSource.redis_type:type_name -> bytebase.store.DataSource.RedisType
+ 14, // 12: bytebase.store.DataSource.extra_connection_parameters:type_name -> bytebase.store.DataSource.ExtraConnectionParametersEntry
+ 10, // 13: bytebase.store.SASLConfig.krb_config:type_name -> bytebase.store.KerberosConfig
+ 3, // 14: bytebase.store.DataSourceExternalSecret.secret_type:type_name -> bytebase.store.DataSourceExternalSecret.SecretType
+ 4, // 15: bytebase.store.DataSourceExternalSecret.auth_type:type_name -> bytebase.store.DataSourceExternalSecret.AuthType
+ 15, // 16: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
+ 5, // 17: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
+ 18, // [18:18] is the sub-list for method output_type
+ 18, // [18:18] is the sub-list for method input_type
+ 18, // [18:18] is the sub-list for extension type_name
+ 18, // [18:18] is the sub-list for extension extendee
+ 0, // [0:18] is the sub-list for field type_name
}
func init() { file_store_instance_proto_init() }
@@ -1686,6 +1740,7 @@ func file_store_instance_proto_init() {
if File_store_instance_proto != nil {
return
}
+ file_store_common_proto_init()
file_store_instance_proto_msgTypes[1].OneofWrappers = []any{}
file_store_instance_proto_msgTypes[2].OneofWrappers = []any{
(*DataSource_ClientSecretCredential_)(nil),
diff --git a/proto/store/instance.proto b/proto/store/instance.proto
index 1094cf86f5..faa9b81838 100644
--- a/proto/store/instance.proto
+++ b/proto/store/instance.proto
@@ -4,31 +4,38 @@ package bytebase.store;
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
+import "store/common.proto";
option go_package = "generated-go/store";
// Instance is the proto for instances.
message Instance {
- // The lower_case_table_names config for MySQL instances.
- // It is used to determine whether the table names and database names are case sensitive.
- int32 mysql_lower_case_table_names = 1;
+ string title = 1;
+ Engine engine = 2;
+ bool activation = 3;
+ string version = 4;
+ string external_link = 5;
- google.protobuf.Timestamp last_sync_time = 2;
-
- repeated InstanceRole roles = 3;
+ repeated DataSource data_sources = 6;
// How often the instance is synced.
- google.protobuf.Duration sync_interval = 4;
+ google.protobuf.Duration sync_interval = 7;
// The maximum number of connections.
// The default is 10 if the value is unset or zero.
- int32 maximum_connections = 5;
+ int32 maximum_connections = 8;
// Enable sync for following databases.
// Default empty, means sync all schemas & databases.
- repeated string sync_databases = 6;
+ repeated string sync_databases = 9;
+
+ // The lower_case_table_names config for MySQL instances.
+ // It is used to determine whether the table names and database names are case sensitive.
+ int32 mysql_lower_case_table_names = 10;
+
+ google.protobuf.Timestamp last_sync_time = 11;
- repeated DataSource data_sources = 7;
+ repeated InstanceRole roles = 12;
}
// InstanceRole is the API message for instance role.