Skip to content

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

refactor: db schema (#15398)

Danny Xuae4f4f7499ad
diff --git a/backend/api/v1/database_service.go b/backend/api/v1/database_service.go
index b6e26642f6..19ff2dc063 100644
--- a/backend/api/v1/database_service.go
+++ b/backend/api/v1/database_service.go
@@ -17,8 +17,8 @@ import (
openai "github.com/sashabaranov/go-openai"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
- "google.golang.org/protobuf/types/known/timestamppb"
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/component/config"
@@ -270,6 +270,7 @@ func (s *DatabaseService) UpdateDatabase(ctx context.Context, request *v1pb.Upda
patch := &store.UpdateDatabaseMessage{
InstanceID: instanceID,
DatabaseName: databaseName,
+ Metadata: proto.Clone(databaseMessage.Metadata).(*storepb.DatabaseMetadata),
}
for _, path := range request.UpdateMask.Paths {
switch path {
@@ -293,15 +294,8 @@ func (s *DatabaseService) UpdateDatabase(ctx context.Context, request *v1pb.Upda
}
patch.ProjectID = &project.ResourceID
case "labels":
- labels := request.Database.Labels
- if labels == nil {
- labels = map[string]string{}
- }
- patch.MetadataUpsert = &storepb.DatabaseMetadata{
- Labels: labels,
- }
+ patch.Metadata.Labels = request.Database.Labels
case "environment":
- patch.UpdateEnvironmentID = true
if request.Database.Environment != "" {
environmentID, err := common.GetEnvironmentID(request.Database.Environment)
if err != nil {
@@ -320,7 +314,10 @@ func (s *DatabaseService) UpdateDatabase(ctx context.Context, request *v1pb.Upda
if environment.Deleted {
return nil, status.Errorf(codes.FailedPrecondition, "environment %q is deleted", environmentID)
}
- patch.EnvironmentID = environment.ResourceID
+ patch.EnvironmentID = &environmentID
+ } else {
+ unsetEnvironment := ""
+ patch.EnvironmentID = &unsetEnvironment
}
}
}
@@ -757,7 +754,7 @@ func (s *DatabaseService) ListSecrets(ctx context.Context, request *v1pb.ListSec
}
return &v1pb.ListSecretsResponse{
- Secrets: stripeAndConvertToServiceSecrets(database.Secrets, database.InstanceID, database.DatabaseName),
+ Secrets: convertToV1Secrets(database.Metadata.GetSecrets(), database.InstanceID, database.DatabaseName),
}, nil
}
@@ -800,17 +797,12 @@ func (s *DatabaseService) UpdateSecret(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.NotFound, "database %q not found", databaseName)
}
- // We retrieve the secret from the database, convert secrets to map, upsert the new secret and store it back.
- // But if two processes are doing this at the same time, the second one will override the first one.
- // It is not a big deal for now because it's not a common case and users can find that secret he set is not existed or not correct.
- secretsMap := make(map[string]*storepb.SecretItem)
- if database.Secrets != nil {
- for _, secret := range database.Secrets.Items {
- secretsMap[secret.Name] = secret
- }
+ secretsMap := make(map[string]*storepb.Secret)
+ for _, secret := range database.Metadata.GetSecrets() {
+ secretsMap[secret.Name] = secret
}
- var newSecret storepb.SecretItem
+ newSecret := &storepb.Secret{}
if _, ok := secretsMap[updateSecretName]; !ok {
// If the secret is not existed and allow_missing is false, we will not create it.
if !request.AllowMissing {
@@ -836,34 +828,30 @@ func (s *DatabaseService) UpdateSecret(ctx context.Context, request *v1pb.Update
}
}
}
- if err := isSecretValid(&newSecret); err != nil {
+ if err := isSecretValid(newSecret); err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
}
+ secretsMap[updateSecretName] = newSecret
- secretsMap[updateSecretName] = &newSecret
- // Flatten the map to a slice.
- var secretItems []*storepb.SecretItem
+ var secrets []*storepb.Secret
for _, secret := range secretsMap {
- secretItems = append(secretItems, secret)
+ secrets = append(secrets, secret)
}
- var updateDatabaseMessage store.UpdateDatabaseMessage
- updateDatabaseMessage.Secrets = &storepb.Secrets{
- Items: secretItems,
+
+ metadata, ok := proto.Clone(database.Metadata).(*storepb.DatabaseMetadata)
+ if !ok {
+ return nil, errors.Errorf("failed to convert database metadata type")
}
- updateDatabaseMessage.InstanceID = database.InstanceID
- updateDatabaseMessage.DatabaseName = database.DatabaseName
- updatedDatabase, err := s.store.UpdateDatabase(ctx, &updateDatabaseMessage)
- if err != nil {
+ metadata.Secrets = secrets
+ if _, err := s.store.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{
+ InstanceID: database.InstanceID,
+ DatabaseName: database.DatabaseName,
+ Metadata: metadata,
+ }); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
- // Get the secret from the updated database.
- for _, secret := range updatedDatabase.Secrets.Items {
- if secret.Name == updateSecretName {
- return stripeAndConvertToServiceSecret(secret, updatedDatabase.InstanceID, updatedDatabase.DatabaseName), nil
- }
- }
- return &v1pb.Secret{}, nil
+ return convertToV1Secret(newSecret, database.InstanceID, database.DatabaseName), nil
}
// DeleteSecret deletes a secret of a database.
@@ -899,29 +887,26 @@ func (s *DatabaseService) DeleteSecret(ctx context.Context, request *v1pb.Delete
return nil, status.Errorf(codes.NotFound, "database %q not found", databaseName)
}
- // We retrieve the secret from the database, convert secrets to map, upsert the new secret and store it back.
- // But if two processes are doing this at the same time, the second one will override the first one.
- // It is not a big deal for now because it's not a common case and users can find that secret he set is not existed or not correct.
- secretsMap := make(map[string]*storepb.SecretItem)
- if database.Secrets != nil {
- for _, secret := range database.Secrets.Items {
- secretsMap[secret.Name] = secret
- }
+ secretsMap := make(map[string]*storepb.Secret)
+ for _, secret := range database.Metadata.GetSecrets() {
+ secretsMap[secret.Name] = secret
}
delete(secretsMap, secretName)
-
- // Flatten the map to a slice.
- var secretItems []*storepb.SecretItem
+ var secrets []*storepb.Secret
for _, secret := range secretsMap {
- secretItems = append(secretItems, secret)
+ secrets = append(secrets, secret)
}
- var updateDatabaseMessage store.UpdateDatabaseMessage
- updateDatabaseMessage.Secrets = &storepb.Secrets{
- Items: secretItems,
+
+ metadata, ok := proto.Clone(database.Metadata).(*storepb.DatabaseMetadata)
+ if !ok {
+ return nil, errors.Errorf("failed to convert database metadata type")
}
- updateDatabaseMessage.InstanceID = database.InstanceID
- updateDatabaseMessage.DatabaseName = database.DatabaseName
- if _, err := s.store.UpdateDatabase(ctx, &updateDatabaseMessage); err != nil {
+ metadata.Secrets = secrets
+ if _, err := s.store.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{
+ InstanceID: database.InstanceID,
+ DatabaseName: database.DatabaseName,
+ Metadata: metadata,
+ }); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -1234,7 +1219,7 @@ func (s *DatabaseService) convertToDatabase(ctx context.Context, database *store
return &v1pb.Database{
Name: common.FormatDatabase(database.InstanceID, database.DatabaseName),
State: convertDeletedToState(database.Deleted),
- SuccessfulSyncTime: timestamppb.New(database.SyncAt),
+ SuccessfulSyncTime: database.Metadata.GetLastSyncTime(),
Project: common.FormatProject(database.ProjectID),
Environment: environment,
EffectiveEnvironment: effectiveEnvironment,
@@ -1250,26 +1235,22 @@ type metadataFilter struct {
table string
}
-func stripeAndConvertToServiceSecrets(secrets *storepb.Secrets, instanceID, databaseName string) []*v1pb.Secret {
- var serviceSecrets []*v1pb.Secret
- if secrets == nil || len(secrets.Items) == 0 {
- return serviceSecrets
- }
- for _, secret := range secrets.Items {
- serviceSecrets = append(serviceSecrets, stripeAndConvertToServiceSecret(secret, instanceID, databaseName))
+func convertToV1Secrets(secrets []*storepb.Secret, instanceID, databaseName string) []*v1pb.Secret {
+ var v1Secrets []*v1pb.Secret
+ for _, secret := range secrets {
+ v1Secrets = append(v1Secrets, convertToV1Secret(secret, instanceID, databaseName))
}
- return serviceSecrets
+ return v1Secrets
}
-func stripeAndConvertToServiceSecret(secretEntry *storepb.SecretItem, instanceID, databaseName string) *v1pb.Secret {
+func convertToV1Secret(secret *storepb.Secret, instanceID, databaseName string) *v1pb.Secret {
return &v1pb.Secret{
- Name: fmt.Sprintf("%s%s/%s%s/%s%s", common.InstanceNamePrefix, instanceID, common.DatabaseIDPrefix, databaseName, common.SecretNamePrefix, secretEntry.Name),
+ Name: fmt.Sprintf("%s%s/%s%s/%s%s", common.InstanceNamePrefix, instanceID, common.DatabaseIDPrefix, databaseName, common.SecretNamePrefix, secret.Name),
Value: "", /* stripped */
- Description: secretEntry.Description,
+ Description: secret.Description,
}
}
-
-func isSecretValid(secret *storepb.SecretItem) error {
+func isSecretValid(secret *storepb.Secret) error {
// Names can not be empty.
if secret.Name == "" {
return errors.Errorf("invalid secret name: %s, name can not be empty", secret.Name)
diff --git a/backend/api/v1/database_service_test.go b/backend/api/v1/database_service_test.go
index 5bfa872500..42030dfe2e 100644
--- a/backend/api/v1/database_service_test.go
+++ b/backend/api/v1/database_service_test.go
@@ -10,12 +10,12 @@ import (
func TestIsSecretValid(t *testing.T) {
testCases := []struct {
- item *storepb.SecretItem
+ item *storepb.Secret
wantErr bool
}{
// Disallow empty name.
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "",
Value: "pwd",
Description: "",
@@ -24,7 +24,7 @@ func TestIsSecretValid(t *testing.T) {
},
// Disallow empty value.
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NAME",
Value: "",
Description: "",
@@ -33,7 +33,7 @@ func TestIsSecretValid(t *testing.T) {
},
// Name cannot start with a number.
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "1NAME",
Value: "pwd",
Description: "",
@@ -42,7 +42,7 @@ func TestIsSecretValid(t *testing.T) {
},
// Name cannot start with the 'BYTEBASE_' prefix.
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "BYTEBASE_NAME",
Value: "pwd",
Description: "",
@@ -51,7 +51,7 @@ func TestIsSecretValid(t *testing.T) {
},
// Names can only contain alphanumeric characters ([A-Z], [0-9]) or underscores (_). Spaces are not allowed.
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NAME WITH SPACE",
Value: "pwd",
Description: "",
@@ -59,7 +59,7 @@ func TestIsSecretValid(t *testing.T) {
wantErr: true,
},
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NAME-WITH-DASH",
Value: "pwd",
Description: "",
@@ -67,7 +67,7 @@ func TestIsSecretValid(t *testing.T) {
wantErr: true,
},
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NAME_WITH_SPECIAL_CHARACTER_©",
Value: "pwd",
Description: "",
@@ -75,7 +75,7 @@ func TestIsSecretValid(t *testing.T) {
wantErr: true,
},
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NAME_WITH_SPECIAL_CHARACTER_ç",
Value: "pwd",
Description: "",
@@ -83,7 +83,7 @@ func TestIsSecretValid(t *testing.T) {
wantErr: true,
},
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NAME_WITH_SPECIAL_CHARACTER_Ⅷ",
Value: "pwd",
Description: "",
@@ -91,7 +91,7 @@ func TestIsSecretValid(t *testing.T) {
wantErr: true,
},
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NAME_WITH_LOWER_CASE_a",
Value: "pwd",
Description: "",
@@ -99,7 +99,7 @@ func TestIsSecretValid(t *testing.T) {
wantErr: true,
},
{
- item: &storepb.SecretItem{
+ item: &storepb.Secret{
Name: "NORMAL_NAME",
Value: "pwd",
Description: "",
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index be17b35df4..40d234f850 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -270,27 +270,24 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
case "title":
patch.Title = &request.Instance.Title
case "environment":
- patch.UpdateEnvironmentID = true
- if request.Instance.Environment != "" {
- environmentID, err := common.GetEnvironmentID(request.Instance.Environment)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- environment, err := s.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{
- ResourceID: &environmentID,
- ShowDeleted: true,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if environment == nil {
- return nil, status.Errorf(codes.NotFound, "environment %q not found", environmentID)
- }
- if environment.Deleted {
- return nil, status.Errorf(codes.FailedPrecondition, "environment %q is deleted", environmentID)
- }
- patch.EnvironmentID = environment.ResourceID
+ environmentID, err := common.GetEnvironmentID(request.Instance.Environment)
+ if err != nil {
+ return nil, status.Error(codes.InvalidArgument, err.Error())
+ }
+ environment, err := s.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{
+ ResourceID: &environmentID,
+ ShowDeleted: true,
+ })
+ if err != nil {
+ return nil, status.Error(codes.Internal, err.Error())
+ }
+ if environment == nil {
+ return nil, status.Errorf(codes.NotFound, "environment %q not found", environmentID)
+ }
+ if environment.Deleted {
+ return nil, status.Errorf(codes.FailedPrecondition, "environment %q is deleted", environmentID)
}
+ patch.EnvironmentID = &environment.ResourceID
case "external_link":
patch.ExternalLink = &request.Instance.ExternalLink
case "data_sources":
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index 28cca184c3..db55140d5e 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -177,7 +177,7 @@ func (s *SQLService) Query(ctx context.Context, request *v1pb.QueryRequest) (*v1
statement := request.Statement
// In Redshift datashare, Rewrite query used for parser.
- if database.DataShare {
+ if database.Metadata.GetDatashare() {
statement = strings.ReplaceAll(statement, fmt.Sprintf("%s.", database.DatabaseName), "")
}
@@ -193,7 +193,7 @@ func (s *SQLService) Query(ctx context.Context, request *v1pb.QueryRequest) (*v1
if err != nil {
return nil, err
}
- driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.DataShare, dataSource.Type == api.RO /* readOnly */, db.ConnectionContext{})
+ driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.Metadata.GetDatashare(), dataSource.Type == api.RO /* readOnly */, db.ConnectionContext{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get database driver: %v", err)
}
@@ -688,7 +688,7 @@ func (s *SQLService) Export(ctx context.Context, request *v1pb.ExportRequest) (*
statement := request.Statement
// In Redshift datashare, Rewrite query used for parser.
- if database.DataShare {
+ if database.Metadata.GetDatashare() {
statement = strings.ReplaceAll(statement, fmt.Sprintf("%s.", database.DatabaseName), "")
}
@@ -794,7 +794,7 @@ func DoExport(
if err != nil {
return nil, 0, err
}
- driver, err := dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.DataShare, true /* readOnly */, db.ConnectionContext{})
+ driver, err := dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.Metadata.GetDatashare(), true /* readOnly */, db.ConnectionContext{})
if err != nil {
return nil, 0, status.Errorf(codes.Internal, "failed to get database driver: %v", err)
}
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.go
index 73890620ed..fa663c7b4d 100644
--- a/backend/component/dbfactory/dbfactory.go
+++ b/backend/component/dbfactory/dbfactory.go
@@ -47,7 +47,7 @@ func (d *DBFactory) GetAdminDatabaseDriver(ctx context.Context, instance *store.
databaseName = database.DatabaseName
}
datashare := false
- if database != nil && database.DataShare {
+ if database != nil && database.Metadata.GetDatashare() {
datashare = true
}
return d.GetDataSourceDriver(ctx, instance, dataSource, databaseName, datashare, false /* readOnly */, connectionContext)
diff --git a/backend/migrator/migration/3.5/0004##db_version.sql b/backend/migrator/migration/3.5/0004##db_version.sql
new file mode 100644
index 0000000000..b6cfab9779
--- /dev/null
+++ b/backend/migrator/migration/3.5/0004##db_version.sql
@@ -0,0 +1,6 @@
+ALTER TABLE db DROP COLUMN IF EXISTS sync_at;
+ALTER TABLE db DROP COLUMN IF EXISTS schema_version;
+ALTER TABLE db DROP COLUMN IF EXISTS secrets;
+ALTER TABLE db DROP COLUMN IF EXISTS datashare;
+ALTER TABLE db DROP COLUMN IF EXISTS service_name;
+
diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sql
index 0dea1abbf2..929ef165e6 100644
--- a/backend/migrator/migration/LATEST.sql
+++ b/backend/migrator/migration/LATEST.sql
@@ -139,12 +139,6 @@ CREATE TABLE db (
instance text NOT NULL REFERENCES instance(resource_id),
name text NOT NULL,
environment text REFERENCES environment(resource_id),
- sync_at timestamptz NOT NULL DEFAULT now(),
- schema_version text NOT NULL,
- secrets jsonb NOT NULL DEFAULT '{}',
- datashare boolean NOT NULL DEFAULT FALSE,
- -- service_name is the Oracle specific field.
- service_name text NOT NULL DEFAULT '',
metadata jsonb NOT NULL DEFAULT '{}'
);
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 21e474743d..872066261b 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.3"), releaseVersion)
+ require.Equal(t, semver.MustParse("3.5.4"), releaseVersion)
}
diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.go
index 252e15af98..006e24db41 100644
--- a/backend/runner/schemasync/syncer.go
+++ b/backend/runner/schemasync/syncer.go
@@ -14,6 +14,7 @@ import (
"github.com/pkg/errors"
"github.com/sourcegraph/conc/pool"
"google.golang.org/protobuf/encoding/protojson"
+ "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/bytebase/bytebase/backend/common"
@@ -319,8 +320,6 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessa
newDatabase, err := s.store.CreateDatabaseDefault(ctx, &store.DatabaseMessage{
InstanceID: instance.ResourceID,
DatabaseName: databaseMetadata.Name,
- DataShare: databaseMetadata.Datashare,
- ServiceName: databaseMetadata.ServiceName,
ProjectID: api.DefaultProjectID,
})
if err != nil {
@@ -411,16 +410,18 @@ func (s *Syncer) SyncDatabaseSchemaToHistory(ctx context.Context, database *stor
}
d := false
- ts := time.Now()
+ metadata, ok := proto.Clone(database.Metadata).(*storepb.DatabaseMetadata)
+ if !ok {
+ return 0, errors.Errorf("failed to convert database metadata type")
+ }
+ metadata.LastSyncTime = timestamppb.New(time.Now())
+ metadata.BackupAvailable = s.hasBackupSchema(ctx, instance, databaseMetadata)
+ metadata.Datashare = databaseMetadata.Datashare
if _, err := s.store.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{
InstanceID: database.InstanceID,
DatabaseName: database.DatabaseName,
Deleted: &d,
- SyncAt: &ts,
- MetadataUpsert: &storepb.DatabaseMetadata{
- LastSyncTime: timestamppb.New(ts),
- BackupAvailable: s.hasBackupSchema(ctx, instance, databaseMetadata),
- },
+ Metadata: metadata,
}); err != nil {
return 0, errors.Wrapf(err, "failed to update database %q for instance %q", database.DatabaseName, database.InstanceID)
}
@@ -517,16 +518,18 @@ func (s *Syncer) SyncDatabaseSchema(ctx context.Context, database *store.Databas
}
d := false
- ts := time.Now()
+ metadata, ok := proto.Clone(database.Metadata).(*storepb.DatabaseMetadata)
+ if !ok {
+ return errors.Errorf("failed to convert database metadata type")
+ }
+ metadata.LastSyncTime = timestamppb.New(time.Now())
+ metadata.BackupAvailable = s.hasBackupSchema(ctx, instance, databaseMetadata)
+ metadata.Datashare = databaseMetadata.Datashare
if _, err := s.store.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{
InstanceID: database.InstanceID,
DatabaseName: database.DatabaseName,
Deleted: &d,
- SyncAt: &ts,
- MetadataUpsert: &storepb.DatabaseMetadata{
- LastSyncTime: timestamppb.New(ts),
- BackupAvailable: s.hasBackupSchema(ctx, instance, databaseMetadata),
- },
+ Metadata: metadata,
}); err != nil {
return errors.Wrapf(err, "failed to update database %q for instance %q", database.DatabaseName, database.InstanceID)
}
diff --git a/backend/runner/taskrun/database_create_executor.go b/backend/runner/taskrun/database_create_executor.go
index b1a09087e6..30d352946c 100644
--- a/backend/runner/taskrun/database_create_executor.go
+++ b/backend/runner/taskrun/database_create_executor.go
@@ -7,7 +7,6 @@ import (
"fmt"
"log/slog"
"strings"
- "time"
"github.com/pkg/errors"
@@ -124,7 +123,6 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, driverCtx conte
DatabaseName: payload.DatabaseName,
EnvironmentID: payload.EnvironmentId,
Deleted: true,
- SyncAt: time.Now(),
Metadata: &storepb.DatabaseMetadata{
Labels: labels,
},
diff --git a/backend/store/database.go b/backend/store/database.go
index ad147684d3..40efb0871d 100644
--- a/backend/store/database.go
+++ b/backend/store/database.go
@@ -5,7 +5,6 @@ import (
"database/sql"
"fmt"
"strings"
- "time"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"
@@ -23,13 +22,8 @@ type DatabaseMessage struct {
EnvironmentID string
EffectiveEnvironmentID string
- Deleted bool
- SyncAt time.Time
- Secrets *storepb.Secrets
- DataShare bool
- // ServiceName is the Oracle specific field.
- ServiceName string
- Metadata *storepb.DatabaseMetadata
+ Deleted bool
+ Metadata *storepb.DatabaseMetadata
// Output only
SchemaVersion string
}
@@ -43,18 +37,11 @@ type UpdateDatabaseMessage struct {
InstanceID string
DatabaseName string
- ProjectID *string
- Deleted *bool
- SyncAt *time.Time
- SourceBackupID *int
- Secrets *storepb.Secrets
- DataShare *bool
- ServiceName *string
- UpdateEnvironmentID bool
- EnvironmentID string
-
- // MetadataUpsert upserts the top-level messages.
- MetadataUpsert *storepb.DatabaseMetadata
+ ProjectID *string
+ Deleted *bool
+ // Empty string will unset the environment.
+ EnvironmentID *string
+ Metadata *storepb.DatabaseMetadata
}
// FindDatabaseMessage is the message for finding databases.
@@ -155,28 +142,16 @@ func (s *Store) CreateDatabaseDefault(ctx context.Context, create *DatabaseMessa
// createDatabaseDefault only creates a default database with charset, collation only in the default project.
func (*Store) createDatabaseDefaultImpl(ctx context.Context, tx *Tx, projectID, instanceID string, create *DatabaseMessage) (int, error) {
- secretsString, err := protojson.Marshal(&storepb.Secrets{})
- if err != nil {
- return 0, err
- }
-
query := `
INSERT INTO db (
instance,
project,
name,
- deleted,
- schema_version,
- secrets,
- datashare,
- service_name
+ deleted
)
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
+ VALUES ($1, $2, $3, $4)
ON CONFLICT (instance, name) DO UPDATE SET
- project = EXCLUDED.project,
- deleted = EXCLUDED.deleted,
- datashare = EXCLUDED.datashare,
- service_name = EXCLUDED.service_name
+ deleted = EXCLUDED.deleted
RETURNING id`
var databaseUID int
if err := tx.QueryRowContext(ctx, query,
@@ -184,10 +159,6 @@ func (*Store) createDatabaseDefaultImpl(ctx context.Context, tx *Tx, projectID,
projectID,
create.DatabaseName,
false,
- "", /* schema_version */
- secretsString, /* secrets */
- create.DataShare,
- create.ServiceName,
).Scan(
&databaseUID,
); err != nil {
@@ -198,10 +169,6 @@ func (*Store) createDatabaseDefaultImpl(ctx context.Context, tx *Tx, projectID,
// UpsertDatabase upserts a database.
func (s *Store) UpsertDatabase(ctx context.Context, create *DatabaseMessage) (*DatabaseMessage, error) {
- secretsString, err := protojson.Marshal(create.Secrets)
- if err != nil {
- return nil, err
- }
metadataString, err := protojson.Marshal(create.Metadata)
if err != nil {
return nil, err
@@ -224,19 +191,13 @@ func (s *Store) UpsertDatabase(ctx context.Context, create *DatabaseMessage) (*D
environment,
name,
deleted,
- sync_at,
- schema_version,
- secrets,
- datashare,
- service_name,
metadata
)
- VALUES ($1, $2, $3, $4, $5, $6, '', $7, $8, $9, $10)
+ VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (instance, name) DO UPDATE SET
project = EXCLUDED.project,
environment = EXCLUDED.environment,
name = EXCLUDED.name,
- schema_version = EXCLUDED.schema_version,
metadata = EXCLUDED.metadata
RETURNING id`
var databaseUID int
@@ -246,10 +207,6 @@ func (s *Store) UpsertDatabase(ctx context.Context, create *DatabaseMessage) (*D
environment,
create.DatabaseName,
create.Deleted,
- create.SyncAt,
- secretsString,
- create.DataShare,
- create.ServiceName,
metadataString,
).Scan(
&databaseUID,
@@ -271,42 +228,22 @@ func (s *Store) UpdateDatabase(ctx context.Context, patch *UpdateDatabaseMessage
if v := patch.ProjectID; v != nil {
set, args = append(set, fmt.Sprintf("project = $%d", len(args)+1)), append(args, *v)
}
- if patch.UpdateEnvironmentID {
- var environment *string
- if patch.EnvironmentID != "" {
- environment = &patch.EnvironmentID
+ if v := patch.EnvironmentID; v != nil {
+ if *v == "" {
+ set = append(set, "environment = NULL")
+ } else {
+ set, args = append(set, fmt.Sprintf("environment = $%d", len(args)+1)), append(args, *v)
}
- set, args = append(set, fmt.Sprintf("environment = $%d", len(args)+1)), append(args, environment)
}
if v := patch.Deleted; v != nil {
set, args = append(set, fmt.Sprintf("deleted = $%d", len(args)+1)), append(args, *v)
}
- if v := patch.SyncAt; v != nil {
- set, args = append(set, fmt.Sprintf("sync_at = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.Secrets; v != nil {
- secretsString, err := protojson.Marshal(v)
- if err != nil {
- return nil, err
- }
- set, args = append(set, fmt.Sprintf("secrets = $%d", len(args)+1)), append(args, secretsString)
- }
- if v := patch.DataShare; v != nil {
- set, args = append(set, fmt.Sprintf("datashare = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.ServiceName; v != nil {
- set, args = append(set, fmt.Sprintf("service_name = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.MetadataUpsert; v != nil {
+ if v := patch.Metadata; v != nil {
metadataBytes, err := protojson.Marshal(v)
if err != nil {
return nil, err
}
- if v.Labels != nil && len(v.Labels) == 0 {
- set, args = append(set, fmt.Sprintf("metadata = metadata || $%d || $%d", len(args)+1, len(args)+2)), append(args, metadataBytes, `{"labels": {}}`)
- } else {
- set, args = append(set, fmt.Sprintf("metadata = metadata || $%d", len(args)+1)), append(args, metadataBytes)
- }
+ set, args = append(set, fmt.Sprintf("metadata = $%d", len(args)+1)), append(args, metadataBytes)
}
args = append(args, patch.InstanceID, patch.DatabaseName)
@@ -431,7 +368,6 @@ func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabase
db.instance,
db.name,
db.deleted,
- db.sync_at,
COALESCE(
(
SELECT revision.version
@@ -442,9 +378,6 @@ func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabase
),
''
),
- db.secrets,
- db.datashare,
- db.service_name,
db.metadata
FROM db
LEFT JOIN instance ON db.instance = instance.resource_id
@@ -467,7 +400,7 @@ func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabase
defer rows.Close()
for rows.Next() {
databaseMessage := &DatabaseMessage{}
- var secretsString, metadataString string
+ var metadataString string
var effectiveEnvironment, environment sql.NullString
if err := rows.Scan(
&databaseMessage.ProjectID,
@@ -476,11 +409,7 @@ func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabase
&databaseMessage.InstanceID,
&databaseMessage.DatabaseName,
&databaseMessage.Deleted,
- &databaseMessage.SyncAt,
&databaseMessage.SchemaVersion,
- &secretsString,
- &databaseMessage.DataShare,
- &databaseMessage.ServiceName,
&metadataString,
); err != nil {
return nil, err
@@ -492,11 +421,6 @@ func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabase
databaseMessage.EnvironmentID = environment.String
}
- var secret storepb.Secrets
- if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(secretsString), &secret); err != nil {
- return nil, err
- }
- databaseMessage.Secrets = &secret
var metadata storepb.DatabaseMetadata
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(metadataString), &metadata); err != nil {
return nil, err
diff --git a/backend/store/instance.go b/backend/store/instance.go
index 9a10f18f29..8db464f682 100644
--- a/backend/store/instance.go
+++ b/backend/store/instance.go
@@ -43,10 +43,9 @@ type UpdateInstanceMessage struct {
EngineVersion *string
Activation *bool
// OptionsUpsert upserts the top-level messages of the instance options.
- OptionsUpsert *storepb.InstanceOptions
- Metadata *storepb.InstanceMetadata
- UpdateEnvironmentID bool
- EnvironmentID string
+ OptionsUpsert *storepb.InstanceOptions
+ Metadata *storepb.InstanceMetadata
+ EnvironmentID *string
}
// FindInstanceMessage is the message for finding instances.
@@ -217,12 +216,8 @@ func (s *Store) UpdateInstanceV2(ctx context.Context, patch *UpdateInstanceMessa
if v := patch.Title; v != nil {
set, args = append(set, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *v)
}
- if patch.UpdateEnvironmentID {
- var environment *string
- if patch.EnvironmentID != "" {
- environment = &patch.EnvironmentID
- }
- set, args = append(set, fmt.Sprintf("environment = $%d", len(args)+1)), append(args, environment)
+ 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)
diff --git a/backend/utils/utils.go b/backend/utils/utils.go
index 99f038be91..e097bda857 100644
--- a/backend/utils/utils.go
+++ b/backend/utils/utils.go
@@ -375,15 +375,11 @@ func RenderStatement(templateStatement string, secrets map[string]string) string
// GetSecretMapFromDatabaseMessage extracts the secret map from the given database message.
func GetSecretMapFromDatabaseMessage(databaseMessage *store.DatabaseMessage) map[string]string {
- materials := make(map[string]string)
- if databaseMessage.Secrets == nil || len(databaseMessage.Secrets.Items) == 0 {
- return materials
+ secrets := make(map[string]string)
+ for _, v := range databaseMessage.Metadata.GetSecrets() {
+ secrets[v.Name] = v.Value
}
-
- for _, item := range databaseMessage.Secrets.Items {
- materials[item.Name] = item.Value
- }
- return materials
+ return secrets
}
// GetMatchedAndUnmatchedDatabasesInDatabaseGroup returns the matched and unmatched databases in the given database group.
diff --git a/frontend/src/types/proto/store/database.ts b/frontend/src/types/proto/store/database.ts
index 3f5e2eebfe..0f78b35847 100644
--- a/frontend/src/types/proto/store/database.ts
+++ b/frontend/src/types/proto/store/database.ts
@@ -18,6 +18,8 @@ export interface DatabaseMetadata {
labels: { [key: string]: string };
lastSyncTime: Timestamp | undefined;
backupAvailable: boolean;
+ datashare: boolean;
+ secrets: Secret[];
}
export interface DatabaseMetadata_LabelsEntry {
@@ -932,12 +934,7 @@ export interface InstanceRoleMetadata {
grant: string;
}
-export interface Secrets {
- /** The list of secrets. */
- items: SecretItem[];
-}
-
-export interface SecretItem {
+export interface Secret {
/** The name is the name of the secret. */
name: string;
/** The value is the value of the secret. */
@@ -1092,7 +1089,7 @@ export interface ObjectSchema_ArrayKind {
}
function createBaseDatabaseMetadata(): DatabaseMetadata {
- return { labels: {}, lastSyncTime: undefined, backupAvailable: false };
+ return { labels: {}, lastSyncTime: undefined, backupAvailable: false, datashare: false, secrets: [] };
}
export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
@@ -1106,6 +1103,12 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
if (message.backupAvailable !== false) {
writer.uint32(24).bool(message.backupAvailable);
}
+ if (message.datashare !== false) {
+ writer.uint32(32).bool(message.datashare);
+ }
+ for (const v of message.secrets) {
+ Secret.encode(v!, writer.uint32(42).fork()).join();
+ }
return writer;
},
@@ -1143,6 +1146,22 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
message.backupAvailable = reader.bool();
continue;
}
+ case 4: {
+ if (tag !== 32) {
+ break;
+ }
+
+ message.datashare = reader.bool();
+ continue;
+ }
+ case 5: {
+ if (tag !== 42) {
+ break;
+ }
+
+ message.secrets.push(Secret.decode(reader, reader.uint32()));
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1162,6 +1181,8 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
: {},
lastSyncTime: isSet(object.lastSyncTime) ? fromJsonTimestamp(object.lastSyncTime) : undefined,
backupAvailable: isSet(object.backupAvailable) ? globalThis.Boolean(object.backupAvailable) : false,
+ datashare: isSet(object.datashare) ? globalThis.Boolean(object.datashare) : false,
+ secrets: globalThis.Array.isArray(object?.secrets) ? object.secrets.map((e: any) => Secret.fromJSON(e)) : [],
};
},
@@ -1182,6 +1203,12 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
if (message.backupAvailable !== false) {
obj.backupAvailable = message.backupAvailable;
}
+ if (message.datashare !== false) {
+ obj.datashare = message.datashare;
+ }
+ if (message.secrets?.length) {
+ obj.secrets = message.secrets.map((e) => Secret.toJSON(e));
+ }
return obj;
},
@@ -1200,6 +1227,8 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
? Timestamp.fromPartial(object.lastSyncTime)
: undefined;
message.backupAvailable = object.backupAvailable ?? false;
+ message.datashare = object.datashare ?? false;
+ message.secrets = object.secrets?.map((e) => Secret.fromPartial(e)) || [];
return message;
},
};
@@ -5777,72 +5806,12 @@ export const InstanceRoleMetadata: MessageFns<InstanceRoleMetadata> = {
},
};
-function createBaseSecrets(): Secrets {
- return { items: [] };
-}
-
-export const Secrets: MessageFns<Secrets> = {
- encode(message: Secrets, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.items) {
- SecretItem.encode(v!, writer.uint32(10).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): Secrets {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSecrets();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.items.push(SecretItem.decode(reader, reader.uint32()));
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): Secrets {
- return {
- items: globalThis.Array.isArray(object?.items) ? object.items.map((e: any) => SecretItem.fromJSON(e)) : [],
- };
- },
-
- toJSON(message: Secrets): unknown {
- const obj: any = {};
- if (message.items?.length) {
- obj.items = message.items.map((e) => SecretItem.toJSON(e));
- }
- return obj;
- },
-
- create(base?: DeepPartial<Secrets>): Secrets {
- return Secrets.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<Secrets>): Secrets {
- const message = createBaseSecrets();
- message.items = object.items?.map((e) => SecretItem.fromPartial(e)) || [];
- return message;
- },
-};
-
-function createBaseSecretItem(): SecretItem {
+function createBaseSecret(): Secret {
return { name: "", value: "", description: "" };
}
-export const SecretItem: MessageFns<SecretItem> = {
- encode(message: SecretItem, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+export const Secret: MessageFns<Secret> = {
+ encode(message: Secret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
@@ -5855,10 +5824,10 @@ export const SecretItem: MessageFns<SecretItem> = {
return writer;
},
- decode(input: BinaryReader | Uint8Array, length?: number): SecretItem {
+ decode(input: BinaryReader | Uint8Array, length?: number): Secret {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSecretItem();
+ const message = createBaseSecret();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@@ -5895,7 +5864,7 @@ export const SecretItem: MessageFns<SecretItem> = {
return message;
},
- fromJSON(object: any): SecretItem {
+ fromJSON(object: any): Secret {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
value: isSet(object.value) ? globalThis.String(object.value) : "",
@@ -5903,7 +5872,7 @@ export const SecretItem: MessageFns<SecretItem> = {
};
},
- toJSON(message: SecretItem): unknown {
+ toJSON(message: Secret): unknown {
const obj: any = {};
if (message.name !== "") {
obj.name = message.name;
@@ -5917,11 +5886,11 @@ export const SecretItem: MessageFns<SecretItem> = {
return obj;
},
- create(base?: DeepPartial<SecretItem>): SecretItem {
- return SecretItem.fromPartial(base ?? {});
+ create(base?: DeepPartial<Secret>): Secret {
+ return Secret.fromPartial(base ?? {});
},
- fromPartial(object: DeepPartial<SecretItem>): SecretItem {
- const message = createBaseSecretItem();
+ fromPartial(object: DeepPartial<Secret>): Secret {
+ const message = createBaseSecret();
message.name = object.name ?? "";
message.value = object.value ?? "";
message.description = object.description ?? "";
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index ef9d9f9e17..2f76461019 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -9179,6 +9179,12 @@ components:
format: date-time
backupAvailable:
type: boolean
+ datashare:
+ type: boolean
+ secrets:
+ type: array
+ items:
+ $ref: '#/components/schemas/Secret'
description: DatabaseMetadata is the metadata for databases.
DatabaseSchema:
type: object
@@ -12746,34 +12752,17 @@ components:
Not used. A token, which can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
Secret:
- required:
- - name
type: object
properties:
name:
type: string
- description: |-
- name is the unique name of the secret, which is specified by the client.
- Format:
- instances/{instance}/databases/{database}/secrets/{secret}
- createdTime:
- readOnly: true
- type: string
- description: Not used. The timestamp when the secret resource was created initially.
- format: date-time
- updatedTime:
- readOnly: true
- type: string
- description: Not used. The timestamp when the secret resource was updated.
- format: date-time
+ description: The name is the name of the secret.
value:
- writeOnly: true
type: string
- description: The value of the secret.
+ description: The value is the value of the secret.
description:
type: string
- description: The description of the secret.
- description: Secret is the secret of the database now.
+ description: The description is the description of the secret.
SemanticTypeSetting:
type: object
properties:
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 64abd612f9..1fb88bfd9d 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -105,8 +105,7 @@
- [ProcedureMetadata](#bytebase-store-ProcedureMetadata)
- [SchemaCatalog](#bytebase-store-SchemaCatalog)
- [SchemaMetadata](#bytebase-store-SchemaMetadata)
- - [SecretItem](#bytebase-store-SecretItem)
- - [Secrets](#bytebase-store-Secrets)
+ - [Secret](#bytebase-store-Secret)
- [SequenceMetadata](#bytebase-store-SequenceMetadata)
- [StreamMetadata](#bytebase-store-StreamMetadata)
- [TableCatalog](#bytebase-store-TableCatalog)
@@ -1467,6 +1466,8 @@ DatabaseMetadata is the metadata for databases.
| labels | [DatabaseMetadata.LabelsEntry](#bytebase-store-DatabaseMetadata-LabelsEntry) | repeated | |
| last_sync_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| backup_available | [bool](#bool) | | |
+| datashare | [bool](#bool) | | |
+| secrets | [Secret](#bytebase-store-Secret) | repeated | |
@@ -1911,9 +1912,9 @@ This is the concept of schema in Postgres, but it&#39;s a no-op for MySQL.
-<a name="bytebase-store-SecretItem"></a>
+<a name="bytebase-store-Secret"></a>
-### SecretItem
+### Secret
@@ -1928,21 +1929,6 @@ This is the concept of schema in Postgres, but it&#39;s a no-op for MySQL.
-<a name="bytebase-store-Secrets"></a>
-
-### Secrets
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| items | [SecretItem](#bytebase-store-SecretItem) | repeated | The list of secrets. |
-
-
-
-
-
-
<a name="bytebase-store-SequenceMetadata"></a>
### SequenceMetadata
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 2b0d30055a..8de0788e3d 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -583,11 +583,7 @@
</li>
<li>
- <a href="#bytebase.store.SecretItem"><span class="badge">M</span>SecretItem</a>
- </li>
-
- <li>
- <a href="#bytebase.store.Secrets"><span class="badge">M</span>Secrets</a>
+ <a href="#bytebase.store.Secret"><span class="badge">M</span>Secret</a>
</li>
<li>
@@ -4292,6 +4288,20 @@ classification and user_comment is parsed from the comment. </p></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>datashare</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>secrets</td>
+ <td><a href="#bytebase.store.Secret">Secret</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
+ </tr>
+
</tbody>
</table>
@@ -5510,7 +5520,7 @@ Snowflake. </p></td>
- <h3 id="bytebase.store.SecretItem">SecretItem</h3>
+ <h3 id="bytebase.store.Secret">Secret</h3>
<p></p>
@@ -5548,30 +5558,6 @@ Snowflake. </p></td>
- <h3 id="bytebase.store.Secrets">Secrets</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>items</td>
- <td><a href="#bytebase.store.SecretItem">SecretItem</a></td>
- <td>repeated</td>
- <td><p>The list of secrets. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
<h3 id="bytebase.store.SequenceMetadata">SequenceMetadata</h3>
<p></p>
diff --git a/proto/generated-go/store/database.pb.go b/proto/generated-go/store/database.pb.go
index 80853022f2..bb995c6f28 100644
--- a/proto/generated-go/store/database.pb.go
+++ b/proto/generated-go/store/database.pb.go
@@ -397,7 +397,7 @@ func (x ObjectSchema_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use ObjectSchema_Type.Descriptor instead.
func (ObjectSchema_Type) EnumDescriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{33, 0}
+ return file_store_database_proto_rawDescGZIP(), []int{32, 0}
}
// DatabaseMetadata is the metadata for databases.
@@ -406,6 +406,8 @@ type DatabaseMetadata struct {
Labels map[string]string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"`
BackupAvailable bool `protobuf:"varint,3,opt,name=backup_available,json=backupAvailable,proto3" json:"backup_available,omitempty"`
+ Datashare bool `protobuf:"varint,4,opt,name=datashare,proto3" json:"datashare,omitempty"`
+ Secrets []*Secret `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -461,6 +463,20 @@ func (x *DatabaseMetadata) GetBackupAvailable() bool {
return false
}
+func (x *DatabaseMetadata) GetDatashare() bool {
+ if x != nil {
+ return x.Datashare
+ }
+ return false
+}
+
+func (x *DatabaseMetadata) GetSecrets() []*Secret {
+ if x != nil {
+ return x.Secrets
+ }
+ return nil
+}
+
// DatabaseSchemaMetadata is the schema metadata for databases.
type DatabaseSchemaMetadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -3191,52 +3207,7 @@ func (x *InstanceRoleMetadata) GetGrant() string {
return ""
}
-type Secrets struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The list of secrets.
- Items []*SecretItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *Secrets) Reset() {
- *x = Secrets{}
- mi := &file_store_database_proto_msgTypes[27]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *Secrets) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Secrets) ProtoMessage() {}
-
-func (x *Secrets) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[27]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use Secrets.ProtoReflect.Descriptor instead.
-func (*Secrets) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{27}
-}
-
-func (x *Secrets) GetItems() []*SecretItem {
- if x != nil {
- return x.Items
- }
- return nil
-}
-
-type SecretItem struct {
+type Secret struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The name is the name of the secret.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
@@ -3248,21 +3219,21 @@ type SecretItem struct {
sizeCache protoimpl.SizeCache
}
-func (x *SecretItem) Reset() {
- *x = SecretItem{}
- mi := &file_store_database_proto_msgTypes[28]
+func (x *Secret) Reset() {
+ *x = Secret{}
+ mi := &file_store_database_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *SecretItem) String() string {
+func (x *Secret) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*SecretItem) ProtoMessage() {}
+func (*Secret) ProtoMessage() {}
-func (x *SecretItem) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[28]
+func (x *Secret) ProtoReflect() protoreflect.Message {
+ mi := &file_store_database_proto_msgTypes[27]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3273,26 +3244,26 @@ func (x *SecretItem) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use SecretItem.ProtoReflect.Descriptor instead.
-func (*SecretItem) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{28}
+// Deprecated: Use Secret.ProtoReflect.Descriptor instead.
+func (*Secret) Descriptor() ([]byte, []int) {
+ return file_store_database_proto_rawDescGZIP(), []int{27}
}
-func (x *SecretItem) GetName() string {
+func (x *Secret) GetName() string {
if x != nil {
return x.Name
}
return ""
}
-func (x *SecretItem) GetValue() string {
+func (x *Secret) GetValue() string {
if x != nil {
return x.Value
}
return ""
}
-func (x *SecretItem) GetDescription() string {
+func (x *Secret) GetDescription() string {
if x != nil {
return x.Description
}
@@ -3310,7 +3281,7 @@ type DatabaseConfig struct {
func (x *DatabaseConfig) Reset() {
*x = DatabaseConfig{}
- mi := &file_store_database_proto_msgTypes[29]
+ mi := &file_store_database_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3322,7 +3293,7 @@ func (x *DatabaseConfig) String() string {
func (*DatabaseConfig) ProtoMessage() {}
func (x *DatabaseConfig) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[29]
+ mi := &file_store_database_proto_msgTypes[28]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3335,7 +3306,7 @@ func (x *DatabaseConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use DatabaseConfig.ProtoReflect.Descriptor instead.
func (*DatabaseConfig) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{29}
+ return file_store_database_proto_rawDescGZIP(), []int{28}
}
func (x *DatabaseConfig) GetName() string {
@@ -3365,7 +3336,7 @@ type SchemaCatalog struct {
func (x *SchemaCatalog) Reset() {
*x = SchemaCatalog{}
- mi := &file_store_database_proto_msgTypes[30]
+ mi := &file_store_database_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3377,7 +3348,7 @@ func (x *SchemaCatalog) String() string {
func (*SchemaCatalog) ProtoMessage() {}
func (x *SchemaCatalog) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[30]
+ mi := &file_store_database_proto_msgTypes[29]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3390,7 +3361,7 @@ func (x *SchemaCatalog) ProtoReflect() protoreflect.Message {
// Deprecated: Use SchemaCatalog.ProtoReflect.Descriptor instead.
func (*SchemaCatalog) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{30}
+ return file_store_database_proto_rawDescGZIP(), []int{29}
}
func (x *SchemaCatalog) GetName() string {
@@ -3421,7 +3392,7 @@ type TableCatalog struct {
func (x *TableCatalog) Reset() {
*x = TableCatalog{}
- mi := &file_store_database_proto_msgTypes[31]
+ mi := &file_store_database_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3433,7 +3404,7 @@ func (x *TableCatalog) String() string {
func (*TableCatalog) ProtoMessage() {}
func (x *TableCatalog) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[31]
+ mi := &file_store_database_proto_msgTypes[30]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3446,7 +3417,7 @@ func (x *TableCatalog) ProtoReflect() protoreflect.Message {
// Deprecated: Use TableCatalog.ProtoReflect.Descriptor instead.
func (*TableCatalog) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{31}
+ return file_store_database_proto_rawDescGZIP(), []int{30}
}
func (x *TableCatalog) GetName() string {
@@ -3498,7 +3469,7 @@ type ColumnCatalog struct {
func (x *ColumnCatalog) Reset() {
*x = ColumnCatalog{}
- mi := &file_store_database_proto_msgTypes[32]
+ mi := &file_store_database_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3510,7 +3481,7 @@ func (x *ColumnCatalog) String() string {
func (*ColumnCatalog) ProtoMessage() {}
func (x *ColumnCatalog) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[32]
+ mi := &file_store_database_proto_msgTypes[31]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3523,7 +3494,7 @@ func (x *ColumnCatalog) ProtoReflect() protoreflect.Message {
// Deprecated: Use ColumnCatalog.ProtoReflect.Descriptor instead.
func (*ColumnCatalog) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{32}
+ return file_store_database_proto_rawDescGZIP(), []int{31}
}
func (x *ColumnCatalog) GetName() string {
@@ -3597,7 +3568,7 @@ type ObjectSchema struct {
func (x *ObjectSchema) Reset() {
*x = ObjectSchema{}
- mi := &file_store_database_proto_msgTypes[33]
+ mi := &file_store_database_proto_msgTypes[32]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3609,7 +3580,7 @@ func (x *ObjectSchema) String() string {
func (*ObjectSchema) ProtoMessage() {}
func (x *ObjectSchema) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[33]
+ mi := &file_store_database_proto_msgTypes[32]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3622,7 +3593,7 @@ func (x *ObjectSchema) ProtoReflect() protoreflect.Message {
// Deprecated: Use ObjectSchema.ProtoReflect.Descriptor instead.
func (*ObjectSchema) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{33}
+ return file_store_database_proto_rawDescGZIP(), []int{32}
}
func (x *ObjectSchema) GetType() ObjectSchema_Type {
@@ -3689,7 +3660,7 @@ type ObjectSchema_StructKind struct {
func (x *ObjectSchema_StructKind) Reset() {
*x = ObjectSchema_StructKind{}
- mi := &file_store_database_proto_msgTypes[36]
+ mi := &file_store_database_proto_msgTypes[35]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3701,7 +3672,7 @@ func (x *ObjectSchema_StructKind) String() string {
func (*ObjectSchema_StructKind) ProtoMessage() {}
func (x *ObjectSchema_StructKind) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[36]
+ mi := &file_store_database_proto_msgTypes[35]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3714,7 +3685,7 @@ func (x *ObjectSchema_StructKind) ProtoReflect() protoreflect.Message {
// Deprecated: Use ObjectSchema_StructKind.ProtoReflect.Descriptor instead.
func (*ObjectSchema_StructKind) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{33, 0}
+ return file_store_database_proto_rawDescGZIP(), []int{32, 0}
}
func (x *ObjectSchema_StructKind) GetProperties() map[string]*ObjectSchema {
@@ -3733,7 +3704,7 @@ type ObjectSchema_ArrayKind struct {
func (x *ObjectSchema_ArrayKind) Reset() {
*x = ObjectSchema_ArrayKind{}
- mi := &file_store_database_proto_msgTypes[37]
+ mi := &file_store_database_proto_msgTypes[36]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3745,7 +3716,7 @@ func (x *ObjectSchema_ArrayKind) String() string {
func (*ObjectSchema_ArrayKind) ProtoMessage() {}
func (x *ObjectSchema_ArrayKind) ProtoReflect() protoreflect.Message {
- mi := &file_store_database_proto_msgTypes[37]
+ mi := &file_store_database_proto_msgTypes[36]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3758,7 +3729,7 @@ func (x *ObjectSchema_ArrayKind) ProtoReflect() protoreflect.Message {
// Deprecated: Use ObjectSchema_ArrayKind.ProtoReflect.Descriptor instead.
func (*ObjectSchema_ArrayKind) Descriptor() ([]byte, []int) {
- return file_store_database_proto_rawDescGZIP(), []int{33, 1}
+ return file_store_database_proto_rawDescGZIP(), []int{32, 1}
}
func (x *ObjectSchema_ArrayKind) GetKind() *ObjectSchema {
@@ -3778,7 +3749,7 @@ var file_store_database_proto_rawDesc = string([]byte{
0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72,
0x73, 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, 0x80, 0x02, 0x0a, 0x10,
+ 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x02, 0x0a, 0x10,
0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x12, 0x44, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x2c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
@@ -3791,7 +3762,12 @@ var file_store_database_proto_rawDesc = string([]byte{
0x53, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x62, 0x61, 0x63, 0x6b,
0x75, 0x70, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x08, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61,
- 0x62, 0x6c, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74,
+ 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x73, 0x68, 0x61, 0x72, 0x65,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x64, 0x61, 0x74, 0x61, 0x73, 0x68, 0x61, 0x72,
+ 0x65, 0x12, 0x30, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
+ 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x96,
@@ -4306,115 +4282,111 @@ var file_store_database_proto_rawDesc = string([]byte{
0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x22, 0x3b, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x72,
- 0x65, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05,
- 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x58, 0x0a, 0x0a, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x49,
- 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20, 0x0a,
- 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22,
- 0x63, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73,
- 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43, 0x61,
- 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x4a, 0x04,
- 0x08, 0x03, 0x10, 0x04, 0x22, 0x59, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43, 0x61,
- 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x74, 0x61, 0x62,
- 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65,
- 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22,
- 0xdd, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67,
+ 0x09, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x22, 0x54, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20, 0x0a, 0x0b,
+ 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x63,
+ 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18,
+ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x43, 0x61, 0x74,
- 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x46, 0x0a,
- 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x07,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65,
- 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65,
- 0x6d, 0x61, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63,
- 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0x0a,
- 0x0e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22,
- 0x87, 0x04, 0x0a, 0x0d, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f,
- 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69,
- 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65,
- 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x6c, 0x61,
- 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x75,
- 0x6d, 0x6e, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73,
- 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x26, 0x0a,
- 0x0e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
- 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f,
- 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62,
- 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x62,
- 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a,
- 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76,
- 0x65, 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c,
- 0x12, 0x39, 0x0a, 0x19, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67,
- 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x16, 0x66, 0x75, 0x6c, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67,
- 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x1c, 0x70,
- 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x61,
- 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,
- 0x67, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x1a, 0x39, 0x0a, 0x0b,
- 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6f, 0x62, 0x6a, 0x65,
- 0x63, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0xe5, 0x04, 0x0a, 0x0c, 0x4f, 0x62,
- 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79,
- 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74,
- 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70,
- 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63,
- 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x48,
- 0x00, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x47, 0x0a,
- 0x0a, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e,
- 0x41, 0x72, 0x72, 0x61, 0x79, 0x4b, 0x69, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x09, 0x61, 0x72, 0x72,
- 0x61, 0x79, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74,
- 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73,
- 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x1a, 0xc2, 0x01, 0x0a, 0x0a,
- 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x57, 0x0a, 0x0a, 0x70, 0x72,
- 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
- 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x74, 0x72,
- 0x75, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69,
- 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
- 0x69, 0x65, 0x73, 0x1a, 0x5b, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65,
- 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, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
- 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53,
- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
- 0x1a, 0x3d, 0x0a, 0x09, 0x41, 0x72, 0x72, 0x61, 0x79, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x30, 0x0a,
- 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79,
+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43, 0x61, 0x74,
+ 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x4a, 0x04, 0x08,
+ 0x03, 0x10, 0x04, 0x22, 0x59, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43, 0x61, 0x74,
+ 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c,
+ 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43,
+ 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0xdd,
+ 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12,
+ 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x02,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x43, 0x61, 0x74, 0x61,
+ 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x0d,
+ 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x07, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d,
+ 0x61, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d,
+ 0x61, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0x0a, 0x0e,
+ 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x87,
+ 0x04, 0x0a, 0x0d, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67,
+ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63,
+ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x6d,
+ 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x6c, 0x61, 0x62,
+ 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d,
+ 0x6e, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45,
+ 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x26, 0x0a, 0x0e,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79,
0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a,
- 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22,
- 0x58, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f,
- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a,
- 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d,
- 0x42, 0x45, 0x52, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e,
- 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x04, 0x12, 0x09,
- 0x0a, 0x05, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x05, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e,
- 0x64, 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,
+ 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x12, 0x41, 0x0a, 0x0d,
+ 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20,
+ 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65,
+ 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12,
+ 0x39, 0x0a, 0x19, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f,
+ 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x16, 0x66, 0x75, 0x6c, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x41,
+ 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x1c, 0x70, 0x61,
+ 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6c,
+ 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67,
+ 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x4c,
+ 0x61, 0x62, 0x65, 0x6c, 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, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0xe5, 0x04, 0x0a, 0x0c, 0x4f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70,
+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
+ 0x12, 0x4a, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68,
+ 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x48, 0x00,
+ 0x52, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x47, 0x0a, 0x0a,
+ 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
+ 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x41,
+ 0x72, 0x72, 0x61, 0x79, 0x4b, 0x69, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x09, 0x61, 0x72, 0x72, 0x61,
+ 0x79, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69,
+ 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65,
+ 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x1a, 0xc2, 0x01, 0x0a, 0x0a, 0x53,
+ 0x74, 0x72, 0x75, 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x57, 0x0a, 0x0a, 0x70, 0x72, 0x6f,
+ 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x75,
+ 0x63, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65,
+ 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69,
+ 0x65, 0x73, 0x1a, 0x5b, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 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, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x63,
+ 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
+ 0x3d, 0x0a, 0x09, 0x41, 0x72, 0x72, 0x61, 0x79, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x30, 0x0a, 0x04,
+ 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x58,
+ 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06,
+ 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x42,
+ 0x45, 0x52, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10,
+ 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x04, 0x12, 0x09, 0x0a,
+ 0x05, 0x41, 0x52, 0x52, 0x41, 0x59, 0x10, 0x05, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64,
+ 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 (
@@ -4430,7 +4402,7 @@ func file_store_database_proto_rawDescGZIP() []byte {
}
var file_store_database_proto_enumTypes = make([]protoimpl.EnumInfo, 7)
-var file_store_database_proto_msgTypes = make([]protoimpl.MessageInfo, 39)
+var file_store_database_proto_msgTypes = make([]protoimpl.MessageInfo, 38)
var file_store_database_proto_goTypes = []any{
(TaskMetadata_State)(0), // 0: bytebase.store.TaskMetadata.State
(StreamMetadata_Type)(0), // 1: bytebase.store.StreamMetadata.Type
@@ -4466,78 +4438,77 @@ var file_store_database_proto_goTypes = []any{
(*ExtensionMetadata)(nil), // 31: bytebase.store.ExtensionMetadata
(*ForeignKeyMetadata)(nil), // 32: bytebase.store.ForeignKeyMetadata
(*InstanceRoleMetadata)(nil), // 33: bytebase.store.InstanceRoleMetadata
- (*Secrets)(nil), // 34: bytebase.store.Secrets
- (*SecretItem)(nil), // 35: bytebase.store.SecretItem
- (*DatabaseConfig)(nil), // 36: bytebase.store.DatabaseConfig
- (*SchemaCatalog)(nil), // 37: bytebase.store.SchemaCatalog
- (*TableCatalog)(nil), // 38: bytebase.store.TableCatalog
- (*ColumnCatalog)(nil), // 39: bytebase.store.ColumnCatalog
- (*ObjectSchema)(nil), // 40: bytebase.store.ObjectSchema
- nil, // 41: bytebase.store.DatabaseMetadata.LabelsEntry
- nil, // 42: bytebase.store.ColumnCatalog.LabelsEntry
- (*ObjectSchema_StructKind)(nil), // 43: bytebase.store.ObjectSchema.StructKind
- (*ObjectSchema_ArrayKind)(nil), // 44: bytebase.store.ObjectSchema.ArrayKind
- nil, // 45: bytebase.store.ObjectSchema.StructKind.PropertiesEntry
- (*timestamppb.Timestamp)(nil), // 46: google.protobuf.Timestamp
- (*wrapperspb.StringValue)(nil), // 47: google.protobuf.StringValue
- (MaskingLevel)(0), // 48: bytebase.store.MaskingLevel
+ (*Secret)(nil), // 34: bytebase.store.Secret
+ (*DatabaseConfig)(nil), // 35: bytebase.store.DatabaseConfig
+ (*SchemaCatalog)(nil), // 36: bytebase.store.SchemaCatalog
+ (*TableCatalog)(nil), // 37: bytebase.store.TableCatalog
+ (*ColumnCatalog)(nil), // 38: bytebase.store.ColumnCatalog
+ (*ObjectSchema)(nil), // 39: bytebase.store.ObjectSchema
+ nil, // 40: bytebase.store.DatabaseMetadata.LabelsEntry
+ nil, // 41: bytebase.store.ColumnCatalog.LabelsEntry
+ (*ObjectSchema_StructKind)(nil), // 42: bytebase.store.ObjectSchema.StructKind
+ (*ObjectSchema_ArrayKind)(nil), // 43: bytebase.store.ObjectSchema.ArrayKind
+ nil, // 44: bytebase.store.ObjectSchema.StructKind.PropertiesEntry
+ (*timestamppb.Timestamp)(nil), // 45: google.protobuf.Timestamp
+ (*wrapperspb.StringValue)(nil), // 46: google.protobuf.StringValue
+ (MaskingLevel)(0), // 47: bytebase.store.MaskingLevel
}
var file_store_database_proto_depIdxs = []int32{
- 41, // 0: bytebase.store.DatabaseMetadata.labels:type_name -> bytebase.store.DatabaseMetadata.LabelsEntry
- 46, // 1: bytebase.store.DatabaseMetadata.last_sync_time:type_name -> google.protobuf.Timestamp
- 10, // 2: bytebase.store.DatabaseSchemaMetadata.schemas:type_name -> bytebase.store.SchemaMetadata
- 31, // 3: bytebase.store.DatabaseSchemaMetadata.extensions:type_name -> bytebase.store.ExtensionMetadata
- 9, // 4: bytebase.store.DatabaseSchemaMetadata.linked_databases:type_name -> bytebase.store.LinkedDatabaseMetadata
- 17, // 5: bytebase.store.SchemaMetadata.tables:type_name -> bytebase.store.TableMetadata
- 19, // 6: bytebase.store.SchemaMetadata.external_tables:type_name -> bytebase.store.ExternalTableMetadata
- 23, // 7: bytebase.store.SchemaMetadata.views:type_name -> bytebase.store.ViewMetadata
- 27, // 8: bytebase.store.SchemaMetadata.functions:type_name -> bytebase.store.FunctionMetadata
- 28, // 9: bytebase.store.SchemaMetadata.procedures:type_name -> bytebase.store.ProcedureMetadata
- 16, // 10: bytebase.store.SchemaMetadata.streams:type_name -> bytebase.store.StreamMetadata
- 15, // 11: bytebase.store.SchemaMetadata.tasks:type_name -> bytebase.store.TaskMetadata
- 25, // 12: bytebase.store.SchemaMetadata.materialized_views:type_name -> bytebase.store.MaterializedViewMetadata
- 13, // 13: bytebase.store.SchemaMetadata.sequences:type_name -> bytebase.store.SequenceMetadata
- 29, // 14: bytebase.store.SchemaMetadata.packages:type_name -> bytebase.store.PackageMetadata
- 12, // 15: bytebase.store.SchemaMetadata.events:type_name -> bytebase.store.EventMetadata
- 11, // 16: bytebase.store.SchemaMetadata.enum_types:type_name -> bytebase.store.EnumTypeMetadata
- 0, // 17: bytebase.store.TaskMetadata.state:type_name -> bytebase.store.TaskMetadata.State
- 1, // 18: bytebase.store.StreamMetadata.type:type_name -> bytebase.store.StreamMetadata.Type
- 2, // 19: bytebase.store.StreamMetadata.mode:type_name -> bytebase.store.StreamMetadata.Mode
- 21, // 20: bytebase.store.TableMetadata.columns:type_name -> bytebase.store.ColumnMetadata
- 30, // 21: bytebase.store.TableMetadata.indexes:type_name -> bytebase.store.IndexMetadata
- 32, // 22: bytebase.store.TableMetadata.foreign_keys:type_name -> bytebase.store.ForeignKeyMetadata
- 20, // 23: bytebase.store.TableMetadata.partitions:type_name -> bytebase.store.TablePartitionMetadata
- 18, // 24: bytebase.store.TableMetadata.check_constraints:type_name -> bytebase.store.CheckConstraintMetadata
- 14, // 25: bytebase.store.TableMetadata.triggers:type_name -> bytebase.store.TriggerMetadata
- 21, // 26: bytebase.store.ExternalTableMetadata.columns:type_name -> bytebase.store.ColumnMetadata
- 3, // 27: bytebase.store.TablePartitionMetadata.type:type_name -> bytebase.store.TablePartitionMetadata.Type
- 20, // 28: bytebase.store.TablePartitionMetadata.subpartitions:type_name -> bytebase.store.TablePartitionMetadata
- 30, // 29: bytebase.store.TablePartitionMetadata.indexes:type_name -> bytebase.store.IndexMetadata
- 47, // 30: bytebase.store.ColumnMetadata.default:type_name -> google.protobuf.StringValue
- 22, // 31: bytebase.store.ColumnMetadata.generation:type_name -> bytebase.store.GenerationMetadata
- 4, // 32: bytebase.store.ColumnMetadata.identity_generation:type_name -> bytebase.store.ColumnMetadata.IdentityGeneration
- 5, // 33: bytebase.store.GenerationMetadata.type:type_name -> bytebase.store.GenerationMetadata.Type
- 24, // 34: bytebase.store.ViewMetadata.dependency_columns:type_name -> bytebase.store.DependencyColumn
- 21, // 35: bytebase.store.ViewMetadata.columns:type_name -> bytebase.store.ColumnMetadata
- 14, // 36: bytebase.store.ViewMetadata.triggers:type_name -> bytebase.store.TriggerMetadata
- 24, // 37: bytebase.store.MaterializedViewMetadata.dependency_columns:type_name -> bytebase.store.DependencyColumn
- 14, // 38: bytebase.store.MaterializedViewMetadata.triggers:type_name -> bytebase.store.TriggerMetadata
- 30, // 39: bytebase.store.MaterializedViewMetadata.indexes:type_name -> bytebase.store.IndexMetadata
- 26, // 40: bytebase.store.FunctionMetadata.dependency_tables:type_name -> bytebase.store.DependencyTable
- 35, // 41: bytebase.store.Secrets.items:type_name -> bytebase.store.SecretItem
- 37, // 42: bytebase.store.DatabaseConfig.schemas:type_name -> bytebase.store.SchemaCatalog
- 38, // 43: bytebase.store.SchemaCatalog.tables:type_name -> bytebase.store.TableCatalog
- 39, // 44: bytebase.store.TableCatalog.columns:type_name -> bytebase.store.ColumnCatalog
- 40, // 45: bytebase.store.TableCatalog.object_schema:type_name -> bytebase.store.ObjectSchema
- 42, // 46: bytebase.store.ColumnCatalog.labels:type_name -> bytebase.store.ColumnCatalog.LabelsEntry
- 40, // 47: bytebase.store.ColumnCatalog.object_schema:type_name -> bytebase.store.ObjectSchema
- 48, // 48: bytebase.store.ColumnCatalog.masking_level:type_name -> bytebase.store.MaskingLevel
+ 40, // 0: bytebase.store.DatabaseMetadata.labels:type_name -> bytebase.store.DatabaseMetadata.LabelsEntry
+ 45, // 1: bytebase.store.DatabaseMetadata.last_sync_time:type_name -> google.protobuf.Timestamp
+ 34, // 2: bytebase.store.DatabaseMetadata.secrets:type_name -> bytebase.store.Secret
+ 10, // 3: bytebase.store.DatabaseSchemaMetadata.schemas:type_name -> bytebase.store.SchemaMetadata
+ 31, // 4: bytebase.store.DatabaseSchemaMetadata.extensions:type_name -> bytebase.store.ExtensionMetadata
+ 9, // 5: bytebase.store.DatabaseSchemaMetadata.linked_databases:type_name -> bytebase.store.LinkedDatabaseMetadata
+ 17, // 6: bytebase.store.SchemaMetadata.tables:type_name -> bytebase.store.TableMetadata
+ 19, // 7: bytebase.store.SchemaMetadata.external_tables:type_name -> bytebase.store.ExternalTableMetadata
+ 23, // 8: bytebase.store.SchemaMetadata.views:type_name -> bytebase.store.ViewMetadata
+ 27, // 9: bytebase.store.SchemaMetadata.functions:type_name -> bytebase.store.FunctionMetadata
+ 28, // 10: bytebase.store.SchemaMetadata.procedures:type_name -> bytebase.store.ProcedureMetadata
+ 16, // 11: bytebase.store.SchemaMetadata.streams:type_name -> bytebase.store.StreamMetadata
+ 15, // 12: bytebase.store.SchemaMetadata.tasks:type_name -> bytebase.store.TaskMetadata
+ 25, // 13: bytebase.store.SchemaMetadata.materialized_views:type_name -> bytebase.store.MaterializedViewMetadata
+ 13, // 14: bytebase.store.SchemaMetadata.sequences:type_name -> bytebase.store.SequenceMetadata
+ 29, // 15: bytebase.store.SchemaMetadata.packages:type_name -> bytebase.store.PackageMetadata
+ 12, // 16: bytebase.store.SchemaMetadata.events:type_name -> bytebase.store.EventMetadata
+ 11, // 17: bytebase.store.SchemaMetadata.enum_types:type_name -> bytebase.store.EnumTypeMetadata
+ 0, // 18: bytebase.store.TaskMetadata.state:type_name -> bytebase.store.TaskMetadata.State
+ 1, // 19: bytebase.store.StreamMetadata.type:type_name -> bytebase.store.StreamMetadata.Type
+ 2, // 20: bytebase.store.StreamMetadata.mode:type_name -> bytebase.store.StreamMetadata.Mode
+ 21, // 21: bytebase.store.TableMetadata.columns:type_name -> bytebase.store.ColumnMetadata
+ 30, // 22: bytebase.store.TableMetadata.indexes:type_name -> bytebase.store.IndexMetadata
+ 32, // 23: bytebase.store.TableMetadata.foreign_keys:type_name -> bytebase.store.ForeignKeyMetadata
+ 20, // 24: bytebase.store.TableMetadata.partitions:type_name -> bytebase.store.TablePartitionMetadata
+ 18, // 25: bytebase.store.TableMetadata.check_constraints:type_name -> bytebase.store.CheckConstraintMetadata
+ 14, // 26: bytebase.store.TableMetadata.triggers:type_name -> bytebase.store.TriggerMetadata
+ 21, // 27: bytebase.store.ExternalTableMetadata.columns:type_name -> bytebase.store.ColumnMetadata
+ 3, // 28: bytebase.store.TablePartitionMetadata.type:type_name -> bytebase.store.TablePartitionMetadata.Type
+ 20, // 29: bytebase.store.TablePartitionMetadata.subpartitions:type_name -> bytebase.store.TablePartitionMetadata
+ 30, // 30: bytebase.store.TablePartitionMetadata.indexes:type_name -> bytebase.store.IndexMetadata
+ 46, // 31: bytebase.store.ColumnMetadata.default:type_name -> google.protobuf.StringValue
+ 22, // 32: bytebase.store.ColumnMetadata.generation:type_name -> bytebase.store.GenerationMetadata
+ 4, // 33: bytebase.store.ColumnMetadata.identity_generation:type_name -> bytebase.store.ColumnMetadata.IdentityGeneration
+ 5, // 34: bytebase.store.GenerationMetadata.type:type_name -> bytebase.store.GenerationMetadata.Type
+ 24, // 35: bytebase.store.ViewMetadata.dependency_columns:type_name -> bytebase.store.DependencyColumn
+ 21, // 36: bytebase.store.ViewMetadata.columns:type_name -> bytebase.store.ColumnMetadata
+ 14, // 37: bytebase.store.ViewMetadata.triggers:type_name -> bytebase.store.TriggerMetadata
+ 24, // 38: bytebase.store.MaterializedViewMetadata.dependency_columns:type_name -> bytebase.store.DependencyColumn
+ 14, // 39: bytebase.store.MaterializedViewMetadata.triggers:type_name -> bytebase.store.TriggerMetadata
+ 30, // 40: bytebase.store.MaterializedViewMetadata.indexes:type_name -> bytebase.store.IndexMetadata
+ 26, // 41: bytebase.store.FunctionMetadata.dependency_tables:type_name -> bytebase.store.DependencyTable
+ 36, // 42: bytebase.store.DatabaseConfig.schemas:type_name -> bytebase.store.SchemaCatalog
+ 37, // 43: bytebase.store.SchemaCatalog.tables:type_name -> bytebase.store.TableCatalog
+ 38, // 44: bytebase.store.TableCatalog.columns:type_name -> bytebase.store.ColumnCatalog
+ 39, // 45: bytebase.store.TableCatalog.object_schema:type_name -> bytebase.store.ObjectSchema
+ 41, // 46: bytebase.store.ColumnCatalog.labels:type_name -> bytebase.store.ColumnCatalog.LabelsEntry
+ 39, // 47: bytebase.store.ColumnCatalog.object_schema:type_name -> bytebase.store.ObjectSchema
+ 47, // 48: bytebase.store.ColumnCatalog.masking_level:type_name -> bytebase.store.MaskingLevel
6, // 49: bytebase.store.ObjectSchema.type:type_name -> bytebase.store.ObjectSchema.Type
- 43, // 50: bytebase.store.ObjectSchema.struct_kind:type_name -> bytebase.store.ObjectSchema.StructKind
- 44, // 51: bytebase.store.ObjectSchema.array_kind:type_name -> bytebase.store.ObjectSchema.ArrayKind
- 45, // 52: bytebase.store.ObjectSchema.StructKind.properties:type_name -> bytebase.store.ObjectSchema.StructKind.PropertiesEntry
- 40, // 53: bytebase.store.ObjectSchema.ArrayKind.kind:type_name -> bytebase.store.ObjectSchema
- 40, // 54: bytebase.store.ObjectSchema.StructKind.PropertiesEntry.value:type_name -> bytebase.store.ObjectSchema
+ 42, // 50: bytebase.store.ObjectSchema.struct_kind:type_name -> bytebase.store.ObjectSchema.StructKind
+ 43, // 51: bytebase.store.ObjectSchema.array_kind:type_name -> bytebase.store.ObjectSchema.ArrayKind
+ 44, // 52: bytebase.store.ObjectSchema.StructKind.properties:type_name -> bytebase.store.ObjectSchema.StructKind.PropertiesEntry
+ 39, // 53: bytebase.store.ObjectSchema.ArrayKind.kind:type_name -> bytebase.store.ObjectSchema
+ 39, // 54: bytebase.store.ObjectSchema.StructKind.PropertiesEntry.value:type_name -> bytebase.store.ObjectSchema
55, // [55:55] is the sub-list for method output_type
55, // [55:55] is the sub-list for method input_type
55, // [55:55] is the sub-list for extension type_name
@@ -4556,9 +4527,9 @@ func file_store_database_proto_init() {
(*ColumnMetadata_DefaultNull)(nil),
(*ColumnMetadata_DefaultExpression)(nil),
}
+ file_store_database_proto_msgTypes[30].OneofWrappers = []any{}
file_store_database_proto_msgTypes[31].OneofWrappers = []any{}
- file_store_database_proto_msgTypes[32].OneofWrappers = []any{}
- file_store_database_proto_msgTypes[33].OneofWrappers = []any{
+ file_store_database_proto_msgTypes[32].OneofWrappers = []any{
(*ObjectSchema_StructKind_)(nil),
(*ObjectSchema_ArrayKind_)(nil),
}
@@ -4568,7 +4539,7 @@ func file_store_database_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_database_proto_rawDesc), len(file_store_database_proto_rawDesc)),
NumEnums: 7,
- NumMessages: 39,
+ NumMessages: 38,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/store/database.proto b/proto/store/database.proto
index fba9b0f605..b0b2a6d56a 100644
--- a/proto/store/database.proto
+++ b/proto/store/database.proto
@@ -13,6 +13,8 @@ message DatabaseMetadata {
map<string, string> labels = 1;
google.protobuf.Timestamp last_sync_time = 2;
bool backup_available = 3;
+ bool datashare = 4;
+ repeated Secret secrets = 5;
}
// DatabaseSchemaMetadata is the schema metadata for databases.
@@ -711,12 +713,7 @@ message InstanceRoleMetadata {
string grant = 7;
}
-message Secrets {
- // The list of secrets.
- repeated SecretItem items = 1;
-}
-
-message SecretItem {
+message Secret {
// The name is the name of the secret.
string name = 1;