Skip to content

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

chore: merge instance options (#15401)

Danny Xudd7c62c0cc0d
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index 0a390b58b7..0b4c32557d 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -9,6 +9,7 @@ import (
"go.uber.org/multierr"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
"github.com/bytebase/bytebase/backend/common"
@@ -262,8 +263,13 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
return nil, status.Errorf(codes.NotFound, "instance %q has been deleted", request.Instance.Name)
}
+ metadata, ok := proto.Clone(instance.Metadata).(*storepb.InstanceMetadata)
+ if !ok {
+ return nil, status.Errorf(codes.Internal, "failed to convert instance metadata type")
+ }
patch := &store.UpdateInstanceMessage{
ResourceID: instance.ResourceID,
+ Metadata: metadata,
}
for _, path := range request.UpdateMask.Paths {
switch path {
@@ -307,26 +313,17 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureCustomInstanceSynchronization, instance); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
- if patch.OptionsUpsert == nil {
- patch.OptionsUpsert = instance.Options
- }
- patch.OptionsUpsert.SyncInterval = request.Instance.GetSyncInterval()
+ patch.Metadata.SyncInterval = request.Instance.SyncInterval
case "maximum_connections":
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureCustomInstanceSynchronization, instance); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
- if patch.OptionsUpsert == nil {
- patch.OptionsUpsert = instance.Options
- }
- patch.OptionsUpsert.MaximumConnections = request.Instance.GetMaximumConnections()
+ patch.Metadata.MaximumConnections = request.Instance.MaximumConnections
case "sync_databases":
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureCustomInstanceSynchronization, instance); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
- if patch.OptionsUpsert == nil {
- patch.OptionsUpsert = instance.Options
- }
- patch.OptionsUpsert.SyncDatabases = request.Instance.GetSyncDatabases()
+ patch.Metadata.SyncDatabases = request.Instance.SyncDatabases
default:
return nil, status.Errorf(codes.InvalidArgument, `unsupported update_mask "%s"`, path)
}
@@ -1034,9 +1031,9 @@ func convertToInstance(instance *store.InstanceMessage) (*v1pb.Instance, error)
State: convertDeletedToState(instance.Deleted),
Environment: buildEnvironmentName(instance.EnvironmentID),
Activation: instance.Activation,
- SyncInterval: instance.Options.GetSyncInterval(),
- MaximumConnections: instance.Options.GetMaximumConnections(),
- SyncDatabases: instance.Options.GetSyncDatabases(),
+ SyncInterval: instance.Metadata.GetSyncInterval(),
+ MaximumConnections: instance.Metadata.GetMaximumConnections(),
+ SyncDatabases: instance.Metadata.GetSyncDatabases(),
Roles: convertToInstanceRoles(instance, instance.Metadata.GetRoles()),
}, nil
}
@@ -1087,7 +1084,7 @@ func (s *InstanceService) convertToInstanceMessage(instanceID string, instance *
DataSources: datasources,
EnvironmentID: environmentID,
Activation: instance.Activation,
- Options: &storepb.InstanceOptions{
+ Metadata: &storepb.InstanceMetadata{
SyncInterval: instance.GetSyncInterval(),
MaximumConnections: instance.GetMaximumConnections(),
SyncDatabases: instance.GetSyncDatabases(),
diff --git a/backend/migrator/migration/3.5/0005##instance_option.sql b/backend/migrator/migration/3.5/0005##instance_option.sql
new file mode 100644
index 0000000000..a38b573b2c
--- /dev/null
+++ b/backend/migrator/migration/3.5/0005##instance_option.sql
@@ -0,0 +1,2 @@
+UPDATE instance SET metadata = metadata || options;
+ALTER TABLE instance DROP COLUMN options;
\ No newline at end of file
diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sql
index 929ef165e6..4b5725eaba 100644
--- a/backend/migrator/migration/LATEST.sql
+++ b/backend/migrator/migration/LATEST.sql
@@ -122,7 +122,6 @@ CREATE TABLE instance (
resource_id text NOT NULL,
-- activation should set to be TRUE if users assign license to this instance.
activation boolean NOT NULL DEFAULT false,
- options jsonb NOT NULL DEFAULT '{}',
metadata jsonb NOT NULL DEFAULT '{}'
);
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 872066261b..fe5849fce7 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.4"), releaseVersion)
+ require.Equal(t, semver.MustParse("3.5.5"), releaseVersion)
}
diff --git a/backend/runner/plancheck/scheduler.go b/backend/runner/plancheck/scheduler.go
index 4c7e367911..88dbb38ad3 100644
--- a/backend/runner/plancheck/scheduler.go
+++ b/backend/runner/plancheck/scheduler.go
@@ -111,7 +111,7 @@ func (s *Scheduler) runPlanCheckRun(ctx context.Context, planCheckRun *store.Pla
return
}
- maximumConnections := int(instance.Options.GetMaximumConnections())
+ maximumConnections := int(instance.Metadata.GetMaximumConnections())
if s.stateCfg.InstanceOutstandingConnections.Increment(instance.ResourceID, maximumConnections) {
return
}
diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.go
index 006e24db41..e149129e4b 100644
--- a/backend/runner/schemasync/syncer.go
+++ b/backend/runner/schemasync/syncer.go
@@ -116,7 +116,7 @@ func (s *Syncer) Run(ctx context.Context, wg *sync.WaitGroup) {
log.BBError(err))
return true
}
- if s.stateCfg.InstanceOutstandingConnections.Increment(instance.ResourceID, int(instance.Options.GetMaximumConnections())) {
+ if s.stateCfg.InstanceOutstandingConnections.Increment(instance.ResourceID, int(instance.Metadata.GetMaximumConnections())) {
return true
}
@@ -288,10 +288,17 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessa
if err != nil {
return nil, nil, nil, err
}
+ metadata, ok := proto.Clone(instance.Metadata).(*storepb.InstanceMetadata)
+ if !ok {
+ return nil, nil, nil, errors.Errorf("failed to convert instance metadata type")
+ }
+ metadata.LastSyncTime = instanceMeta.Metadata.LastSyncTime
+ metadata.MysqlLowerCaseTableNames = instanceMeta.Metadata.MysqlLowerCaseTableNames
+ metadata.Roles = instanceMeta.Metadata.Roles
updateInstance := &store.UpdateInstanceMessage{
ResourceID: instance.ResourceID,
- Metadata: instanceMeta.Metadata,
+ Metadata: metadata,
}
if instanceMeta.Version != instance.EngineVersion {
updateInstance.EngineVersion = &instanceMeta.Version
@@ -309,7 +316,7 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessa
var filteredDatabaseMetadatas []*storepb.DatabaseSchemaMetadata
for _, databaseMetadata := range instanceMeta.Databases {
- if len(instance.Options.GetSyncDatabases()) > 0 && !slices.Contains(instance.Options.GetSyncDatabases(), databaseMetadata.Name) {
+ if len(instance.Metadata.GetSyncDatabases()) > 0 && !slices.Contains(instance.Metadata.GetSyncDatabases(), databaseMetadata.Name) {
continue
}
filteredDatabaseMetadatas = append(filteredDatabaseMetadatas, databaseMetadata)
@@ -733,13 +740,13 @@ func getOrDefaultSyncInterval(instance *store.InstanceMessage) time.Duration {
if !instance.Activation {
return defaultSyncInterval
}
- if !instance.Options.SyncInterval.IsValid() {
+ if !instance.Metadata.GetSyncInterval().IsValid() {
return defaultSyncInterval
}
- if instance.Options.SyncInterval.GetSeconds() == 0 && instance.Options.SyncInterval.GetNanos() == 0 {
+ if instance.Metadata.GetSyncInterval().GetSeconds() == 0 && instance.Metadata.GetSyncInterval().GetNanos() == 0 {
return defaultSyncInterval
}
- return instance.Options.SyncInterval.AsDuration()
+ return instance.Metadata.GetSyncInterval().AsDuration()
}
func getOrDefaultLastSyncTime(t *timestamppb.Timestamp) time.Time {
diff --git a/backend/runner/taskrun/schedulerv2.go b/backend/runner/taskrun/schedulerv2.go
index 3e0e789e26..3c325045d5 100644
--- a/backend/runner/taskrun/schedulerv2.go
+++ b/backend/runner/taskrun/schedulerv2.go
@@ -421,7 +421,7 @@ func (s *SchedulerV2) scheduleRunningTaskRuns(ctx context.Context) error {
)
continue
}
- maximumConnections := int(instance.Options.GetMaximumConnections())
+ maximumConnections := int(instance.Metadata.GetMaximumConnections())
if s.stateCfg.InstanceOutstandingConnections.Increment(task.InstanceID, maximumConnections) {
s.stateCfg.TaskRunSchedulerInfo.Store(taskRun.ID, &storepb.SchedulerInfo{
ReportTime: timestamppb.Now(),
diff --git a/backend/store/instance.go b/backend/store/instance.go
index 8db464f682..a83d2209f6 100644
--- a/backend/store/instance.go
+++ b/backend/store/instance.go
@@ -25,7 +25,6 @@ type InstanceMessage struct {
ExternalLink string
DataSources []*DataSourceMessage
Activation bool
- Options *storepb.InstanceOptions
EnvironmentID string
Deleted bool
EngineVersion string
@@ -42,8 +41,6 @@ type UpdateInstanceMessage struct {
DataSources *[]*DataSourceMessage
EngineVersion *string
Activation *bool
- // OptionsUpsert upserts the top-level messages of the instance options.
- OptionsUpsert *storepb.InstanceOptions
Metadata *storepb.InstanceMetadata
EnvironmentID *string
}
@@ -130,11 +127,6 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
where = fmt.Sprintf("WHERE (%s) < %d", countActivateInstanceQuery, maximumActivation)
}
- optionBytes, err := protojson.Marshal(instanceCreate.Options)
- if err != nil {
- return nil, err
- }
-
metadataBytes, err := protojson.Marshal(instanceCreate.Metadata)
if err != nil {
return nil, err
@@ -153,10 +145,9 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
engine,
external_link,
activation,
- options,
metadata
)
- SELECT $1, $2, $3, $4, $5, $6, $7, $8
+ SELECT $1, $2, $3, $4, $5, $6, $7
%s
RETURNING id
`, where),
@@ -166,7 +157,6 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
instanceCreate.Engine.String(),
instanceCreate.ExternalLink,
instanceCreate.Activation,
- optionBytes,
metadataBytes,
).Scan(&instanceID); err != nil {
return nil, err
@@ -197,7 +187,6 @@ func (s *Store) CreateInstanceV2(ctx context.Context, instanceCreate *InstanceMe
ExternalLink: instanceCreate.ExternalLink,
DataSources: instanceDataSourcesMap[instanceCreate.ResourceID],
Activation: instanceCreate.Activation,
- Options: instanceCreate.Options,
Metadata: instanceCreate.Metadata,
}
s.instanceCache.Add(getInstanceCacheKey(instance.ResourceID), instance)
@@ -240,13 +229,6 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
}
set, args = append(set, fmt.Sprintf(`deleted = $%d`, len(args)+1)), append(args, *v)
}
- if v := patch.OptionsUpsert; v != nil {
- options, err := protojson.Marshal(v)
- if err != nil {
- return nil, err
- }
- set, args = append(set, fmt.Sprintf("options = $%d", len(args)+1)), append(args, options)
- }
if v := patch.Metadata; v != nil {
metadata, err := protojson.Marshal(v)
if err != nil {
@@ -279,11 +261,10 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
external_link,
activation,
deleted,
- options,
metadata
`, strings.Join(where, " AND "))
var environment sql.NullString
- var options, metadata []byte
+ var metadata []byte
if err := tx.QueryRowContext(ctx, query, args...).Scan(
&instance.ResourceID,
&environment,
@@ -293,7 +274,6 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
&instance.ExternalLink,
&instance.Activation,
&instance.Deleted,
- &options,
&metadata,
); err != nil {
return nil, err
@@ -307,12 +287,6 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
}
instance.Engine = storepb.Engine(engineTypeValue)
- var instanceOptions storepb.InstanceOptions
- if err := common.ProtojsonUnmarshaler.Unmarshal(options, &instanceOptions); err != nil {
- return nil, err
- }
- instance.Options = &instanceOptions
-
var instanceMetadata storepb.InstanceMetadata
if err := common.ProtojsonUnmarshaler.Unmarshal(metadata, &instanceMetadata); err != nil {
return nil, err
@@ -379,7 +353,6 @@ func (s *Store) listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstan
external_link,
activation,
deleted,
- options,
metadata
FROM instance
WHERE %s
@@ -394,7 +367,7 @@ func (s *Store) listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstan
var instanceMessage InstanceMessage
var environment sql.NullString
var engine string
- var options, metadata []byte
+ var metadata []byte
if err := rows.Scan(
&instanceMessage.ResourceID,
&instanceMessage.Title,
@@ -404,7 +377,6 @@ func (s *Store) listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstan
&instanceMessage.ExternalLink,
&instanceMessage.Activation,
&instanceMessage.Deleted,
- &options,
&metadata,
); err != nil {
return nil, err
@@ -418,11 +390,6 @@ func (s *Store) listInstanceImplV2(ctx context.Context, tx *Tx, find *FindInstan
}
instanceMessage.Engine = storepb.Engine(engineTypeValue)
- var instanceOptions storepb.InstanceOptions
- if err := common.ProtojsonUnmarshaler.Unmarshal(options, &instanceOptions); err != nil {
- return nil, err
- }
- instanceMessage.Options = &instanceOptions
var instanceMetadata storepb.InstanceMetadata
if err := common.ProtojsonUnmarshaler.Unmarshal(metadata, &instanceMetadata); err != nil {
return nil, err
diff --git a/frontend/src/types/proto/store/instance.ts b/frontend/src/types/proto/store/instance.ts
index 27b4e0df03..be30b3a032 100644
--- a/frontend/src/types/proto/store/instance.ts
+++ b/frontend/src/types/proto/store/instance.ts
@@ -12,8 +12,15 @@ import { Timestamp } from "../google/protobuf/timestamp";
export const protobufPackage = "bytebase.store";
-/** InstanceOptions is the option for instances. */
-export interface InstanceOptions {
+/** InstanceMetadata is the metadata for instances. */
+export interface InstanceMetadata {
+ /**
+ * 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[];
/** How often the instance is synced. */
syncInterval:
| Duration
@@ -30,17 +37,6 @@ export interface InstanceOptions {
syncDatabases: string[];
}
-/** InstanceMetadata is the metadata for instances. */
-export interface InstanceMetadata {
- /**
- * 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. */
export interface InstanceRole {
/** The role name. */
@@ -61,104 +57,15 @@ export interface InstanceRole {
attribute?: string | undefined;
}
-function createBaseInstanceOptions(): InstanceOptions {
- return { syncInterval: undefined, maximumConnections: 0, syncDatabases: [] };
-}
-
-export const InstanceOptions: MessageFns<InstanceOptions> = {
- encode(message: InstanceOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.syncInterval !== undefined) {
- Duration.encode(message.syncInterval, writer.uint32(18).fork()).join();
- }
- if (message.maximumConnections !== 0) {
- writer.uint32(24).int32(message.maximumConnections);
- }
- for (const v of message.syncDatabases) {
- writer.uint32(34).string(v!);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): InstanceOptions {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseInstanceOptions();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.syncInterval = Duration.decode(reader, reader.uint32());
- continue;
- }
- case 3: {
- if (tag !== 24) {
- break;
- }
-
- message.maximumConnections = reader.int32();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.syncDatabases.push(reader.string());
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): InstanceOptions {
- return {
- 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))
- : [],
- };
- },
-
- toJSON(message: InstanceOptions): unknown {
- const obj: any = {};
- if (message.syncInterval !== undefined) {
- obj.syncInterval = Duration.toJSON(message.syncInterval);
- }
- if (message.maximumConnections !== 0) {
- obj.maximumConnections = Math.round(message.maximumConnections);
- }
- if (message.syncDatabases?.length) {
- obj.syncDatabases = message.syncDatabases;
- }
- return obj;
- },
-
- create(base?: DeepPartial<InstanceOptions>): InstanceOptions {
- return InstanceOptions.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<InstanceOptions>): InstanceOptions {
- const message = createBaseInstanceOptions();
- 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) || [];
- return message;
- },
-};
-
function createBaseInstanceMetadata(): InstanceMetadata {
- return { mysqlLowerCaseTableNames: 0, lastSyncTime: undefined, roles: [] };
+ return {
+ mysqlLowerCaseTableNames: 0,
+ lastSyncTime: undefined,
+ roles: [],
+ syncInterval: undefined,
+ maximumConnections: 0,
+ syncDatabases: [],
+ };
}
export const InstanceMetadata: MessageFns<InstanceMetadata> = {
@@ -172,6 +79,15 @@ export const InstanceMetadata: MessageFns<InstanceMetadata> = {
for (const v of message.roles) {
InstanceRole.encode(v!, writer.uint32(26).fork()).join();
}
+ if (message.syncInterval !== undefined) {
+ Duration.encode(message.syncInterval, writer.uint32(34).fork()).join();
+ }
+ if (message.maximumConnections !== 0) {
+ writer.uint32(40).int32(message.maximumConnections);
+ }
+ for (const v of message.syncDatabases) {
+ writer.uint32(50).string(v!);
+ }
return writer;
},
@@ -206,6 +122,30 @@ export const InstanceMetadata: MessageFns<InstanceMetadata> = {
message.roles.push(InstanceRole.decode(reader, reader.uint32()));
continue;
}
+ case 4: {
+ if (tag !== 34) {
+ break;
+ }
+
+ message.syncInterval = Duration.decode(reader, reader.uint32());
+ continue;
+ }
+ case 5: {
+ if (tag !== 40) {
+ break;
+ }
+
+ message.maximumConnections = reader.int32();
+ continue;
+ }
+ case 6: {
+ if (tag !== 50) {
+ break;
+ }
+
+ message.syncDatabases.push(reader.string());
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -222,6 +162,11 @@ export const InstanceMetadata: MessageFns<InstanceMetadata> = {
: 0,
lastSyncTime: isSet(object.lastSyncTime) ? fromJsonTimestamp(object.lastSyncTime) : undefined,
roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => InstanceRole.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))
+ : [],
};
},
@@ -236,6 +181,15 @@ export const InstanceMetadata: MessageFns<InstanceMetadata> = {
if (message.roles?.length) {
obj.roles = message.roles.map((e) => InstanceRole.toJSON(e));
}
+ if (message.syncInterval !== undefined) {
+ obj.syncInterval = Duration.toJSON(message.syncInterval);
+ }
+ if (message.maximumConnections !== 0) {
+ obj.maximumConnections = Math.round(message.maximumConnections);
+ }
+ if (message.syncDatabases?.length) {
+ obj.syncDatabases = message.syncDatabases;
+ }
return obj;
},
@@ -249,6 +203,11 @@ export const InstanceMetadata: MessageFns<InstanceMetadata> = {
? Timestamp.fromPartial(object.lastSyncTime)
: undefined;
message.roles = object.roles?.map((e) => InstanceRole.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) || [];
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 1fb88bfd9d..1f009ab2bc 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -162,7 +162,6 @@
- [store/instance.proto](#store_instance-proto)
- [InstanceMetadata](#bytebase-store-InstanceMetadata)
- - [InstanceOptions](#bytebase-store-InstanceOptions)
- [InstanceRole](#bytebase-store-InstanceRole)
- [store/instance_change_history.proto](#store_instance_change_history-proto)
@@ -2721,20 +2720,6 @@ InstanceMetadata is the metadata for instances.
| 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 | |
-
-
-
-
-
-
-<a name="bytebase-store-InstanceOptions"></a>
-
-### InstanceOptions
-InstanceOptions is the option for instances.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
| 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. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 8de0788e3d..ae836e434d 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -815,10 +815,6 @@
<a href="#bytebase.store.InstanceMetadata"><span class="badge">M</span>InstanceMetadata</a>
</li>
- <li>
- <a href="#bytebase.store.InstanceOptions"><span class="badge">M</span>InstanceOptions</a>
- </li>
-
<li>
<a href="#bytebase.store.InstanceRole"><span class="badge">M</span>InstanceRole</a>
</li>
@@ -7501,23 +7497,6 @@ It is used to determine whether the table names and database names are case sens
<td><p> </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.InstanceOptions">InstanceOptions</h3>
- <p>InstanceOptions is the option for instances.</p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
<tr>
<td>sync_interval</td>
<td><a href="#google.protobuf.Duration">google.protobuf.Duration</a></td>
diff --git a/proto/generated-go/store/instance.pb.go b/proto/generated-go/store/instance.pb.go
index e2882dd934..6b557cd1bb 100644
--- a/proto/generated-go/store/instance.pb.go
+++ b/proto/generated-go/store/instance.pb.go
@@ -23,35 +23,40 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
-// InstanceOptions is the option for instances.
-type InstanceOptions struct {
+// InstanceMetadata is the metadata for instances.
+type InstanceMetadata 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"`
// How often the instance is synced.
- SyncInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=sync_interval,json=syncInterval,proto3" json:"sync_interval,omitempty"`
+ SyncInterval *durationpb.Duration `protobuf:"bytes,4,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,3,opt,name=maximum_connections,json=maximumConnections,proto3" json:"maximum_connections,omitempty"`
+ MaximumConnections int32 `protobuf:"varint,5,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,4,rep,name=sync_databases,json=syncDatabases,proto3" json:"sync_databases,omitempty"`
+ SyncDatabases []string `protobuf:"bytes,6,rep,name=sync_databases,json=syncDatabases,proto3" json:"sync_databases,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
-func (x *InstanceOptions) Reset() {
- *x = InstanceOptions{}
+func (x *InstanceMetadata) Reset() {
+ *x = InstanceMetadata{}
mi := &file_store_instance_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *InstanceOptions) String() string {
+func (x *InstanceMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*InstanceOptions) ProtoMessage() {}
+func (*InstanceMetadata) ProtoMessage() {}
-func (x *InstanceOptions) ProtoReflect() protoreflect.Message {
+func (x *InstanceMetadata) ProtoReflect() protoreflect.Message {
mi := &file_store_instance_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -63,91 +68,49 @@ func (x *InstanceOptions) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use InstanceOptions.ProtoReflect.Descriptor instead.
-func (*InstanceOptions) Descriptor() ([]byte, []int) {
+// Deprecated: Use InstanceMetadata.ProtoReflect.Descriptor instead.
+func (*InstanceMetadata) Descriptor() ([]byte, []int) {
return file_store_instance_proto_rawDescGZIP(), []int{0}
}
-func (x *InstanceOptions) GetSyncInterval() *durationpb.Duration {
- if x != nil {
- return x.SyncInterval
- }
- return nil
-}
-
-func (x *InstanceOptions) GetMaximumConnections() int32 {
+func (x *InstanceMetadata) GetMysqlLowerCaseTableNames() int32 {
if x != nil {
- return x.MaximumConnections
+ return x.MysqlLowerCaseTableNames
}
return 0
}
-func (x *InstanceOptions) GetSyncDatabases() []string {
+func (x *InstanceMetadata) GetLastSyncTime() *timestamppb.Timestamp {
if x != nil {
- return x.SyncDatabases
+ return x.LastSyncTime
}
return nil
}
-// InstanceMetadata is the metadata for instances.
-type InstanceMetadata 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"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *InstanceMetadata) Reset() {
- *x = InstanceMetadata{}
- mi := &file_store_instance_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *InstanceMetadata) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*InstanceMetadata) ProtoMessage() {}
-
-func (x *InstanceMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_store_instance_proto_msgTypes[1]
+func (x *InstanceMetadata) GetRoles() []*InstanceRole {
if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
+ return x.Roles
}
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use InstanceMetadata.ProtoReflect.Descriptor instead.
-func (*InstanceMetadata) Descriptor() ([]byte, []int) {
- return file_store_instance_proto_rawDescGZIP(), []int{1}
+ return nil
}
-func (x *InstanceMetadata) GetMysqlLowerCaseTableNames() int32 {
+func (x *InstanceMetadata) GetSyncInterval() *durationpb.Duration {
if x != nil {
- return x.MysqlLowerCaseTableNames
+ return x.SyncInterval
}
- return 0
+ return nil
}
-func (x *InstanceMetadata) GetLastSyncTime() *timestamppb.Timestamp {
+func (x *InstanceMetadata) GetMaximumConnections() int32 {
if x != nil {
- return x.LastSyncTime
+ return x.MaximumConnections
}
- return nil
+ return 0
}
-func (x *InstanceMetadata) GetRoles() []*InstanceRole {
+func (x *InstanceMetadata) GetSyncDatabases() []string {
if x != nil {
- return x.Roles
+ return x.SyncDatabases
}
return nil
}
@@ -171,7 +134,7 @@ type InstanceRole struct {
func (x *InstanceRole) Reset() {
*x = InstanceRole{}
- mi := &file_store_instance_proto_msgTypes[2]
+ mi := &file_store_instance_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -183,7 +146,7 @@ func (x *InstanceRole) String() string {
func (*InstanceRole) ProtoMessage() {}
func (x *InstanceRole) ProtoReflect() protoreflect.Message {
- mi := &file_store_instance_proto_msgTypes[2]
+ mi := &file_store_instance_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -196,7 +159,7 @@ func (x *InstanceRole) ProtoReflect() protoreflect.Message {
// Deprecated: Use InstanceRole.ProtoReflect.Descriptor instead.
func (*InstanceRole) Descriptor() ([]byte, []int) {
- return file_store_instance_proto_rawDescGZIP(), []int{2}
+ return file_store_instance_proto_rawDescGZIP(), []int{1}
}
func (x *InstanceRole) GetName() string {
@@ -236,46 +199,44 @@ 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, 0xaf, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74,
- 0x61, 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x0d, 0x73,
- 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 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, 0x03, 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, 0x04,
- 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xc8, 0x01, 0x0a, 0x10, 0x49, 0x6e,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 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, 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, 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, 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, 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,
+ 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x02, 0x0a, 0x10, 0x49, 0x6e, 0x73, 0x74,
+ 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 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, 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, 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, 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, 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 (
@@ -290,18 +251,17 @@ func file_store_instance_proto_rawDescGZIP() []byte {
return file_store_instance_proto_rawDescData
}
-var file_store_instance_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_store_instance_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_store_instance_proto_goTypes = []any{
- (*InstanceOptions)(nil), // 0: bytebase.store.InstanceOptions
- (*InstanceMetadata)(nil), // 1: bytebase.store.InstanceMetadata
- (*InstanceRole)(nil), // 2: bytebase.store.InstanceRole
+ (*InstanceMetadata)(nil), // 0: bytebase.store.InstanceMetadata
+ (*InstanceRole)(nil), // 1: bytebase.store.InstanceRole
+ (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
(*durationpb.Duration)(nil), // 3: google.protobuf.Duration
- (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp
}
var file_store_instance_proto_depIdxs = []int32{
- 3, // 0: bytebase.store.InstanceOptions.sync_interval:type_name -> google.protobuf.Duration
- 4, // 1: bytebase.store.InstanceMetadata.last_sync_time:type_name -> google.protobuf.Timestamp
- 2, // 2: bytebase.store.InstanceMetadata.roles:type_name -> bytebase.store.InstanceRole
+ 2, // 0: bytebase.store.InstanceMetadata.last_sync_time:type_name -> google.protobuf.Timestamp
+ 1, // 1: bytebase.store.InstanceMetadata.roles:type_name -> bytebase.store.InstanceRole
+ 3, // 2: bytebase.store.InstanceMetadata.sync_interval:type_name -> google.protobuf.Duration
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
@@ -314,14 +274,14 @@ func file_store_instance_proto_init() {
if File_store_instance_proto != nil {
return
}
- file_store_instance_proto_msgTypes[2].OneofWrappers = []any{}
+ file_store_instance_proto_msgTypes[1].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_instance_proto_rawDesc), len(file_store_instance_proto_rawDesc)),
NumEnums: 0,
- NumMessages: 3,
+ NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/store/instance.proto b/proto/store/instance.proto
index 0e004ba7a4..087c6ffa4c 100644
--- a/proto/store/instance.proto
+++ b/proto/store/instance.proto
@@ -7,22 +7,6 @@ import "google/protobuf/timestamp.proto";
option go_package = "generated-go/store";
-// InstanceOptions is the option for instances.
-message InstanceOptions {
- reserved 1;
-
- // How often the instance is synced.
- google.protobuf.Duration sync_interval = 2;
-
- // The maximum number of connections.
- // The default is 10 if the value is unset or zero.
- int32 maximum_connections = 3;
-
- // Enable sync for following databases.
- // Default empty, means sync all schemas & databases.
- repeated string sync_databases = 4;
-}
-
// InstanceMetadata is the metadata for instances.
message InstanceMetadata {
// The lower_case_table_names config for MySQL instances.
@@ -32,6 +16,17 @@ message InstanceMetadata {
google.protobuf.Timestamp last_sync_time = 2;
repeated InstanceRole roles = 3;
+
+ // How often the instance is synced.
+ google.protobuf.Duration sync_interval = 4;
+
+ // The maximum number of connections.
+ // The default is 10 if the value is unset or zero.
+ int32 maximum_connections = 5;
+
+ // Enable sync for following databases.
+ // Default empty, means sync all schemas & databases.
+ repeated string sync_databases = 6;
}
// InstanceRole is the API message for instance role.