Skip to content

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

feat: implement merge schema design api (#7645)

boojackb06da9fd49ae
diff --git a/backend/api/v1/schema_design_service.go b/backend/api/v1/schema_design_service.go
index 3cb46dcb38..b5571fb8b0 100644
--- a/backend/api/v1/schema_design_service.go
+++ b/backend/api/v1/schema_design_service.go
@@ -2,6 +2,7 @@ package v1
import (
"context"
+ "crypto/sha1"
"fmt"
"sort"
"strconv"
@@ -156,47 +157,57 @@ func (s *SchemaDesignService) CreateSchemaDesign(ctx context.Context, request *v
return nil, status.Errorf(codes.NotFound, "database %q not found", databaseName)
}
+ schema, err := getDesignSchema(schemaDesign.Engine, schemaDesign.BaselineSchema, schemaDesign.SchemaMetadata)
+ if err != nil {
+ return nil, err
+ }
+ // Try to transform the schema string to database metadata to make sure it's valid.
+ if _, err := transformSchemaStringToDatabaseMetadata(schemaDesign.Engine, schema); err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to transform schema string to database metadata: %v", err))
+ }
+
schemaDesignSheetPayload := &storepb.SheetPayload{
Type: storepb.SheetPayload_SCHEMA_DESIGN,
SchemaDesign: &storepb.SheetPayload_SchemaDesign{
+ Type: storepb.SheetPayload_SchemaDesign_Type(schemaDesign.Type),
Engine: storepb.Engine(schemaDesign.Engine),
},
}
if schemaDesign.SchemaVersion != "" {
- instanceID, _, changeHistoryIDStr, err := common.GetInstanceDatabaseIDChangeHistory(schemaDesign.SchemaVersion)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, err.Error())
- }
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &instanceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, err.Error())
- }
- changeHistory, err := s.store.GetInstanceChangeHistory(ctx, &store.FindInstanceChangeHistoryMessage{
- ID: &changeHistoryIDStr,
- InstanceID: &instance.UID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, err.Error())
- }
- if changeHistory == nil {
- return nil, status.Errorf(codes.NotFound, "schema version %s not found", changeHistoryIDStr)
+ if schemaDesign.Type == v1pb.SchemaDesign_MAIN_BRANCH {
+ instanceID, _, changeHistoryIDStr, err := common.GetInstanceDatabaseIDChangeHistory(schemaDesign.SchemaVersion)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, err.Error())
+ }
+ instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
+ ResourceID: &instanceID,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, err.Error())
+ }
+ changeHistory, err := s.store.GetInstanceChangeHistory(ctx, &store.FindInstanceChangeHistoryMessage{
+ ID: &changeHistoryIDStr,
+ InstanceID: &instance.UID,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, err.Error())
+ }
+ if changeHistory == nil {
+ return nil, status.Errorf(codes.NotFound, "schema version %s not found", changeHistoryIDStr)
+ }
+ schemaDesignSheetPayload.SchemaDesign.BaselineChangeHistoryId = changeHistory.UID
+ } else if schemaDesign.Type == v1pb.SchemaDesign_PERSONAL_DRAFT {
+ _, sheetID, err := common.GetProjectResourceIDAndSchemaDesignSheetID(schemaDesign.SchemaVersion)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, err.Error())
+ }
+ schemaDesignSheetPayload.SchemaDesign.BaselineSchemaDesignId = sheetID
}
- schemaDesignSheetPayload.SchemaDesign.BaselineChangeHistoryId = changeHistory.UID
}
payloadBytes, err := protojson.Marshal(schemaDesignSheetPayload)
if err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to marshal schema design sheet payload: %v", err))
}
- schema, err := getDesignSchema(schemaDesign.Engine, schemaDesign.BaselineSchema, schemaDesign.SchemaMetadata)
- if err != nil {
- return nil, err
- }
- // Try to transform the schema string to database metadata to make sure it's valid.
- if _, err := transformSchemaStringToDatabaseMetadata(schemaDesign.Engine, schema); err != nil {
- return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to transform schema string to database metadata: %v", err))
- }
sheetCreate := &store.SheetMessage{
Name: schemaDesign.Title,
@@ -223,6 +234,7 @@ func (s *SchemaDesignService) CreateSchemaDesign(ctx context.Context, request *v
// UpdateSchemaDesign updates an existing schema design.
func (s *SchemaDesignService) UpdateSchemaDesign(ctx context.Context, request *v1pb.UpdateSchemaDesignRequest) (*v1pb.SchemaDesign, error) {
+ // TODO(steven): Only allow personal draft schema design to be updated.
currentPrincipalID := ctx.Value(common.PrincipalIDContextKey).(int)
_, sheetID, err := common.GetProjectResourceIDAndSchemaDesignSheetID(request.SchemaDesign.Name)
if err != nil {
@@ -232,11 +244,15 @@ func (s *SchemaDesignService) UpdateSchemaDesign(ctx context.Context, request *v
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("invalid sheet id %s, must be positive integer", sheetID))
}
- if request.UpdateMask == nil {
+ if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 {
return nil, status.Errorf(codes.InvalidArgument, "update_mask is required")
}
- if len(request.UpdateMask.Paths) == 0 {
- return nil, status.Errorf(codes.InvalidArgument, "update_mask is required")
+
+ sheet, err := s.getSheet(ctx, &store.FindSheetMessage{
+ UID: &sheetUID,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get sheet: %v", err))
}
sheetUpdate := &store.PatchSheetMessage{
@@ -248,18 +264,44 @@ func (s *SchemaDesignService) UpdateSchemaDesign(ctx context.Context, request *v
sheetUpdate.Name = &schemaDesign.Title
}
if slices.Contains(request.UpdateMask.Paths, "schema") {
+ sheetUpdate.Statement = &schemaDesign.Schema
+ }
+ if slices.Contains(request.UpdateMask.Paths, "metadata") {
sanitizeSchemaDesignSchemaMetadata(schemaDesign)
schema, err := getDesignSchema(schemaDesign.Engine, schemaDesign.BaselineSchema, schemaDesign.SchemaMetadata)
if err != nil {
return nil, err
}
+ sheetUpdate.Statement = &schema
+ }
+ // Update baseline schema design id for personal draft schema design.
+ if slices.Contains(request.UpdateMask.Paths, "schema_version") {
+ _, sheetID, err := common.GetProjectResourceIDAndSchemaDesignSheetID(schemaDesign.SchemaVersion)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, err.Error())
+ }
+ sheetPayload := &storepb.SheetPayload{}
+ if err := protojson.Unmarshal([]byte(sheet.Payload), sheetPayload); err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to unmarshal sheet payload: %v", err))
+ }
+ sheetPayload.SchemaDesign.BaselineSchemaDesignId = sheetID
+ payloadBytes, err := protojson.Marshal(sheetPayload)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to marshal schema design sheet payload: %v", err))
+ }
+ payload := string(payloadBytes)
+ sheetUpdate.Payload = &payload
+ }
+
+ // If the schema is updated, we need to make sure the schema string is valid.
+ if sheetUpdate.Statement != nil {
// Try to transform the schema string to database metadata to make sure it's valid.
- if _, err := transformSchemaStringToDatabaseMetadata(schemaDesign.Engine, schema); err != nil {
+ if _, err := transformSchemaStringToDatabaseMetadata(schemaDesign.Engine, *sheetUpdate.Statement); err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to transform schema string to database metadata: %v", err))
}
- sheetUpdate.Statement = &schema
}
- sheet, err := s.store.PatchSheet(ctx, sheetUpdate)
+
+ sheet, err = s.store.PatchSheet(ctx, sheetUpdate)
if err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to update sheet: %v", err))
}
@@ -270,6 +312,80 @@ func (s *SchemaDesignService) UpdateSchemaDesign(ctx context.Context, request *v
return schemaDesign, nil
}
+// MergeSchemaDesign merges a personal draft schema design to the target schema design.
+func (s *SchemaDesignService) MergeSchemaDesign(ctx context.Context, request *v1pb.MergeSchemaDesignRequest) (*v1pb.SchemaDesign, error) {
+ _, sheetID, err := common.GetProjectResourceIDAndSchemaDesignSheetID(request.Name)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, err.Error())
+ }
+ sheetUID, err := strconv.Atoi(sheetID)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, err.Error())
+ }
+ schemaDesignSheetType := storepb.SheetPayload_SCHEMA_DESIGN.String()
+ sheet, err := s.getSheet(ctx, &store.FindSheetMessage{
+ UID: &sheetUID,
+ PayloadType: &schemaDesignSheetType,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get sheet: %v", err))
+ }
+ schemaDesign, err := s.convertSheetToSchemaDesign(ctx, sheet)
+ if err != nil {
+ return nil, err
+ }
+ if schemaDesign.Type != v1pb.SchemaDesign_PERSONAL_DRAFT {
+ return nil, status.Errorf(codes.InvalidArgument, "only personal draft schema design can be merged")
+ }
+
+ _, targetSheetID, err := common.GetProjectResourceIDAndSchemaDesignSheetID(request.TargetName)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, err.Error())
+ }
+ targetSheetUID, err := strconv.Atoi(targetSheetID)
+ if err != nil || targetSheetUID <= 0 {
+ return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("invalid sheet id %s, must be positive integer", targetSheetID))
+ }
+ targetSheet, err := s.getSheet(ctx, &store.FindSheetMessage{
+ UID: &targetSheetUID,
+ PayloadType: &schemaDesignSheetType,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get target sheet: %v", err))
+ }
+ targetSchemaDesign, err := s.convertSheetToSchemaDesign(ctx, targetSheet)
+ if err != nil {
+ return nil, err
+ }
+
+ if schemaDesign.Etag != targetSchemaDesign.Etag {
+ return nil, status.Errorf(codes.FailedPrecondition, "schema design has been updated")
+ }
+
+ currentPrincipalID := ctx.Value(common.PrincipalIDContextKey).(int)
+ sheetUpdate := &store.PatchSheetMessage{
+ UID: targetSheetUID,
+ UpdaterID: currentPrincipalID,
+ Statement: &schemaDesign.Schema,
+ }
+ // Update main branch schema design.
+ targetSheet, err = s.store.PatchSheet(ctx, sheetUpdate)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to update main branch schema design: %v", err))
+ }
+ targetSchemaDesign, err = s.convertSheetToSchemaDesign(ctx, targetSheet)
+ if err != nil {
+ return nil, err
+ }
+
+ // Delete personal draft schema design.
+ err = s.store.DeleteSheet(ctx, sheetUID)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to delete personal draft schema design: %v", err))
+ }
+ return targetSchemaDesign, nil
+}
+
// ParseSchemaString parses a schema string to database metadata.
func (*SchemaDesignService) ParseSchemaString(_ context.Context, request *v1pb.ParseSchemaStringRequest) (*v1pb.ParseSchemaStringResponse, error) {
if request.SchemaString == "" {
@@ -341,7 +457,6 @@ func (s *SchemaDesignService) convertSheetToSchemaDesign(ctx context.Context, sh
if project == nil {
return nil, status.Errorf(codes.NotFound, fmt.Sprintf("cannot find the project: %d", sheet.ProjectUID))
}
- name := fmt.Sprintf("%s%s/%s%v", common.ProjectNamePrefix, project.ResourceID, common.SchemaDesignPrefix, sheet.UID)
database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
UID: sheet.DatabaseUID,
@@ -388,12 +503,39 @@ func (s *SchemaDesignService) convertSheetToSchemaDesign(ctx context.Context, sh
baselineSchema = changeHistory.Schema
schemaVersion = changeHistory.UID
}
+ } else if sheetPayload.SchemaDesign.Type == storepb.SheetPayload_SchemaDesign_PERSONAL_DRAFT && sheetPayload.SchemaDesign.BaselineSchemaDesignId != "" {
+ sheetUID, err := strconv.Atoi(sheetPayload.SchemaDesign.BaselineSchemaDesignId)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, fmt.Sprintf("invalid sheet id %s, must be positive integer", sheetPayload.SchemaDesign.BaselineSchemaDesignId))
+ }
+ sheet, err := s.getSheet(ctx, &store.FindSheetMessage{
+ UID: &sheetUID,
+ })
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get sheet: %v", err))
+ }
+ baselineSchema = sheet.Statement
+ schemaVersion = fmt.Sprintf("%s%s/%s%s", common.ProjectNamePrefix, project.ResourceID, common.SchemaDesignPrefix, sheetPayload.SchemaDesign.BaselineSchemaDesignId)
}
+
baselineSchemaMetadata, err := transformSchemaStringToDatabaseMetadata(engine, baselineSchema)
if err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to transform schema string to database metadata: %v", err))
}
+ schemaDesignType := v1pb.SchemaDesign_Type(sheetPayload.Type)
+ etag := ""
+ if schemaDesignType == v1pb.SchemaDesign_TYPE_UNSPECIFIED {
+ schemaDesignType = v1pb.SchemaDesign_MAIN_BRANCH
+ }
+ if schemaDesignType == v1pb.SchemaDesign_MAIN_BRANCH {
+ etag = GenerateEtag([]byte(schema))
+ } else {
+ // For personal branch, we use the baseline schema as the etag.
+ etag = GenerateEtag([]byte(baselineSchema))
+ }
+
+ name := fmt.Sprintf("%s%s/%s%v", common.ProjectNamePrefix, project.ResourceID, common.SchemaDesignPrefix, sheet.UID)
return &v1pb.SchemaDesign{
Name: name,
Title: sheet.Name,
@@ -404,6 +546,8 @@ func (s *SchemaDesignService) convertSheetToSchemaDesign(ctx context.Context, sh
Engine: engine,
BaselineDatabase: fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, database.InstanceID, common.DatabaseIDPrefix, database.DatabaseName),
SchemaVersion: schemaVersion,
+ Type: v1pb.SchemaDesign_Type(sheetPayload.Type),
+ Etag: etag,
Creator: fmt.Sprintf("users/%s", creator.Email),
Updater: fmt.Sprintf("users/%s", updater.Email),
CreateTime: timestamppb.New(sheet.CreatedTime),
@@ -411,6 +555,13 @@ func (s *SchemaDesignService) convertSheetToSchemaDesign(ctx context.Context, sh
}, nil
}
+// GenerateEtag generates etag for the given body.
+func GenerateEtag(body []byte) string {
+ hash := sha1.Sum(body)
+ etag := fmt.Sprintf("%x", hash)
+ return etag
+}
+
func transformSchemaStringToDatabaseMetadata(engine v1pb.Engine, schema string) (*v1pb.DatabaseMetadata, error) {
dbSchema, err := func() (*v1pb.DatabaseMetadata, error) {
switch engine {
diff --git a/backend/api/v1/schema_design_service_test.go b/backend/api/v1/schema_design_service_test.go
index e97ec1efb4..0442d64932 100644
--- a/backend/api/v1/schema_design_service_test.go
+++ b/backend/api/v1/schema_design_service_test.go
@@ -11,6 +11,31 @@ import (
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
+func TestGenerateEtag(t *testing.T) {
+ tests := []struct {
+ statement string
+ want string
+ }{
+ {
+ statement: "",
+ want: "da39a3ee5e6b4b0d3255bfef95601890afd80709",
+ },
+ {
+ statement: "test",
+ want: "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
+ },
+ {
+ statement: "CREATE TABLE test;",
+ want: "ecbe3800ad8d24592e2dc963ae63f96c608723db",
+ },
+ }
+
+ for _, test := range tests {
+ got := GenerateEtag([]byte(test.statement))
+ require.Equal(t, test.want, got)
+ }
+}
+
type transformTest struct {
Engine v1pb.Engine
Schema string
diff --git a/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue b/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue
index c0a7e98943..c5cd2c3a7b 100644
--- a/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue
+++ b/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue
@@ -80,7 +80,10 @@ import {
ChangeHistory,
DatabaseMetadata,
} from "@/types/proto/v1/database_service";
-import { SchemaDesign } from "@/types/proto/v1/schema_design_service";
+import {
+ SchemaDesign,
+ SchemaDesign_Type,
+} from "@/types/proto/v1/schema_design_service";
import BaselineSchemaSelector from "./BaselineSchemaSelector.vue";
import { mergeSchemaEditToMetadata } from "./common/util";
import SchemaDesigner from "./index.vue";
@@ -119,7 +122,9 @@ const state = reactive<LocalState>({
baselineSchema: {
projectId: props.projectId,
},
- schemaDesign: SchemaDesign.fromPartial({}),
+ schemaDesign: SchemaDesign.fromPartial({
+ type: SchemaDesign_Type.MAIN_BRANCH,
+ }),
});
const refreshId = ref<string>("");
const readonly = computed(() => {
@@ -229,6 +234,7 @@ const handleConfirm = async () => {
baselineSchema: state.schemaDesign.baselineSchema,
baselineSchemaMetadata: state.schemaDesign.baselineSchemaMetadata,
engine: state.schemaDesign.engine,
+ type: state.schemaDesign.type,
baselineDatabase: baselineDatabase,
schemaVersion: schemaVersion,
})
diff --git a/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue b/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue
index 7b4730abf9..8407a081b1 100644
--- a/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue
+++ b/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue
@@ -206,7 +206,7 @@ const handleUpdateSchemaDesign = async () => {
)
);
if (!isEqual(mergedMetadata, schemaDesign.value.schemaMetadata)) {
- updateMask.push("schema");
+ updateMask.push("metadata");
}
await schemaDesignStore.updateSchemaDesign(
SchemaDesign.fromPartial({
diff --git a/frontend/src/types/proto/v1/schema_design_service.ts b/frontend/src/types/proto/v1/schema_design_service.ts
index 7a67192516..af9e4178f8 100644
--- a/frontend/src/types/proto/v1/schema_design_service.ts
+++ b/frontend/src/types/proto/v1/schema_design_service.ts
@@ -172,8 +172,16 @@ export interface UpdateSchemaDesignRequest {
}
export interface MergeSchemaDesignRequest {
- /** The personal draft schema design to merge. */
- schemaDesign?: SchemaDesign | undefined;
+ /**
+ * The name of the schema design to merge.
+ * Format: projects/{project}/schemaDesigns/{schemaDesign}
+ */
+ name: string;
+ /**
+ * The target schema design to merge into.
+ * Format: projects/{project}/schemaDesigns/{schemaDesign}
+ */
+ targetName: string;
}
export interface ParseSchemaStringRequest {
@@ -841,13 +849,16 @@ export const UpdateSchemaDesignRequest = {
};
function createBaseMergeSchemaDesignRequest(): MergeSchemaDesignRequest {
- return { schemaDesign: undefined };
+ return { name: "", targetName: "" };
}
export const MergeSchemaDesignRequest = {
encode(message: MergeSchemaDesignRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.schemaDesign !== undefined) {
- SchemaDesign.encode(message.schemaDesign, writer.uint32(10).fork()).ldelim();
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ if (message.targetName !== "") {
+ writer.uint32(18).string(message.targetName);
}
return writer;
},
@@ -864,7 +875,14 @@ export const MergeSchemaDesignRequest = {
break;
}
- message.schemaDesign = SchemaDesign.decode(reader, reader.uint32());
+ message.name = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.targetName = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -876,13 +894,16 @@ export const MergeSchemaDesignRequest = {
},
fromJSON(object: any): MergeSchemaDesignRequest {
- return { schemaDesign: isSet(object.schemaDesign) ? SchemaDesign.fromJSON(object.schemaDesign) : undefined };
+ return {
+ name: isSet(object.name) ? String(object.name) : "",
+ targetName: isSet(object.targetName) ? String(object.targetName) : "",
+ };
},
toJSON(message: MergeSchemaDesignRequest): unknown {
const obj: any = {};
- message.schemaDesign !== undefined &&
- (obj.schemaDesign = message.schemaDesign ? SchemaDesign.toJSON(message.schemaDesign) : undefined);
+ message.name !== undefined && (obj.name = message.name);
+ message.targetName !== undefined && (obj.targetName = message.targetName);
return obj;
},
@@ -892,9 +913,8 @@ export const MergeSchemaDesignRequest = {
fromPartial(object: DeepPartial<MergeSchemaDesignRequest>): MergeSchemaDesignRequest {
const message = createBaseMergeSchemaDesignRequest();
- message.schemaDesign = (object.schemaDesign !== undefined && object.schemaDesign !== null)
- ? SchemaDesign.fromPartial(object.schemaDesign)
- : undefined;
+ message.name = object.name ?? "";
+ message.targetName = object.targetName ?? "";
return message;
},
};
@@ -1214,7 +1234,7 @@ export const SchemaDesignServiceDefinition = {
_unknownFields: {
8410: [
new Uint8Array([
- 19,
+ 20,
112,
97,
114,
@@ -1228,7 +1248,8 @@ export const SchemaDesignServiceDefinition = {
101,
109,
97,
- 68,
+ 95,
+ 100,
101,
115,
105,
@@ -1307,14 +1328,15 @@ export const SchemaDesignServiceDefinition = {
_unknownFields: {
8410: [
new Uint8Array([
- 24,
+ 25,
115,
99,
104,
101,
109,
97,
- 68,
+ 95,
+ 100,
101,
115,
105,
@@ -1418,46 +1440,17 @@ export const SchemaDesignServiceDefinition = {
responseStream: false,
options: {
_unknownFields: {
- 8410: [new Uint8Array([12, 115, 99, 104, 101, 109, 97, 68, 101, 115, 105, 103, 110])],
+ 8410: [new Uint8Array([16, 110, 97, 109, 101, 44, 116, 97, 114, 103, 101, 116, 95, 110, 97, 109, 101])],
578365826: [
new Uint8Array([
- 74,
- 58,
- 13,
- 115,
- 99,
- 104,
- 101,
- 109,
- 97,
- 95,
- 100,
- 101,
- 115,
- 105,
- 103,
- 110,
+ 45,
34,
- 57,
+ 43,
47,
118,
49,
47,
123,
- 115,
- 99,
- 104,
- 101,
- 109,
- 97,
- 95,
- 100,
- 101,
- 115,
- 105,
- 103,
- 110,
- 46,
110,
97,
109,
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 05da4698ff..696278a4b5 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -7989,7 +7989,8 @@ When paginating, all other parameters provided to `ListSchemaDesigns` must match
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| schema_design | [SchemaDesign](#bytebase-v1-SchemaDesign) | | The personal draft schema design to merge. |
+| name | [string](#string) | | The name of the schema design to merge. Format: projects/{project}/schemaDesigns/{schemaDesign} |
+| target_name | [string](#string) | | The target schema design to merge into. Format: projects/{project}/schemaDesigns/{schemaDesign} |
diff --git a/proto/generated-go/v1/schema_design_service.pb.go b/proto/generated-go/v1/schema_design_service.pb.go
index af310f2371..7e1ddd2222 100644
--- a/proto/generated-go/v1/schema_design_service.pb.go
+++ b/proto/generated-go/v1/schema_design_service.pb.go
@@ -567,8 +567,12 @@ type MergeSchemaDesignRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- // The personal draft schema design to merge.
- SchemaDesign *SchemaDesign `protobuf:"bytes,1,opt,name=schema_design,json=schemaDesign,proto3" json:"schema_design,omitempty"`
+ // The name of the schema design to merge.
+ // Format: projects/{project}/schemaDesigns/{schemaDesign}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // The target schema design to merge into.
+ // Format: projects/{project}/schemaDesigns/{schemaDesign}
+ TargetName string `protobuf:"bytes,2,opt,name=target_name,json=targetName,proto3" json:"target_name,omitempty"`
}
func (x *MergeSchemaDesignRequest) Reset() {
@@ -603,11 +607,18 @@ func (*MergeSchemaDesignRequest) Descriptor() ([]byte, []int) {
return file_v1_schema_design_service_proto_rawDescGZIP(), []int{6}
}
-func (x *MergeSchemaDesignRequest) GetSchemaDesign() *SchemaDesign {
+func (x *MergeSchemaDesignRequest) GetName() string {
if x != nil {
- return x.SchemaDesign
+ return x.Name
}
- return nil
+ return ""
+}
+
+func (x *MergeSchemaDesignRequest) GetTargetName() string {
+ if x != nil {
+ return x.TargetName
+ }
+ return ""
}
type ParseSchemaStringRequest struct {
@@ -870,104 +881,102 @@ var file_v1_schema_design_service_proto_rawDesc = []byte{
0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69,
0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d,
- 0x61, 0x73, 0x6b, 0x22, 0x5f, 0x0a, 0x18, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65,
+ 0x61, 0x73, 0x6b, 0x22, 0x59, 0x0a, 0x18, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65,
0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
- 0x43, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67,
- 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
- 0x73, 0x69, 0x67, 0x6e, 0x22, 0x71, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x63, 0x68,
- 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e,
- 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x73, 0x63,
- 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x0a, 0x06, 0x65, 0x6e,
- 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x52,
- 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x22, 0x68, 0x0a, 0x19, 0x50, 0x61, 0x72, 0x73, 0x65,
- 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6d,
- 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0, 0x41,
- 0x03, 0x52, 0x0e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
- 0x61, 0x22, 0x34, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17,
- 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
- 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xfe, 0x08, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65,
- 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
- 0x87, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73,
- 0x69, 0x67, 0x6e, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67,
- 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73,
- 0x69, 0x67, 0x6e, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44,
- 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x4c, 0x69,
- 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x12,
- 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,
- 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44,
- 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30,
- 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
- 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
- 0x2a, 0x7d, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73,
- 0x12, 0xaa, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65,
- 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63,
- 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x51, 0xda, 0x41, 0x13, 0x70,
- 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
- 0x67, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61,
- 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d,
- 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0xbe, 0x01,
- 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
- 0x73, 0x69, 0x67, 0x6e, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44,
- 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x65, 0xda, 0x41, 0x18, 0x73, 0x63, 0x68, 0x65,
- 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
- 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x3a, 0x0d, 0x73, 0x63, 0x68, 0x65,
- 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x32, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
- 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x6e, 0x61,
- 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63,
- 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb6,
- 0x01, 0x0a, 0x11, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
- 0x73, 0x69, 0x67, 0x6e, 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
- 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
- 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x5f, 0xda, 0x41, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x3a, 0x0d, 0x73,
- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x39, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e,
- 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x2f, 0x2a,
- 0x7d, 0x3a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x73,
- 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73,
- 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74,
- 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68,
- 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x3a, 0x70, 0x61, 0x72, 0x73, 0x65, 0x53,
- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x8a, 0x01, 0x0a, 0x12,
- 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
- 0x67, 0x6e, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73,
- 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
- 0x74, 0x79, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x27, 0x2a, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
- 0x73, 0x69, 0x67, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65,
- 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
+ 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67,
+ 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x71,
+ 0x0a, 0x18, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72,
+ 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x63,
+ 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x12, 0x2b, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e,
+ 0x65, 0x22, 0x68, 0x0a, 0x19, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
+ 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b,
+ 0x0a, 0x0f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+ 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65,
+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x73, 0x63, 0x68,
+ 0x65, 0x6d, 0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x34, 0x0a, 0x19, 0x44,
+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67,
+ 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d,
+ 0x65, 0x32, 0xe7, 0x08, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
+ 0x67, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x0f, 0x47, 0x65,
+ 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x23, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x34, 0xda,
+ 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
+ 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65,
+ 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65,
+ 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
+ 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x63, 0x68,
+ 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x12, 0xab, 0x01, 0x0a, 0x12, 0x43,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67,
+ 0x6e, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
+ 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
+ 0x73, 0x69, 0x67, 0x6e, 0x22, 0x52, 0xda, 0x41, 0x14, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c,
+ 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x35, 0x3a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69,
+ 0x67, 0x6e, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x63, 0x68, 0x65,
+ 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0xbf, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12,
+ 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
+ 0x67, 0x6e, 0x22, 0x66, 0xda, 0x41, 0x19, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65,
+ 0x73, 0x69, 0x67, 0x6e, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x3a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64,
+ 0x65, 0x73, 0x69, 0x67, 0x6e, 0x32, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x63, 0x68, 0x65,
+ 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61,
+ 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x9d, 0x01, 0x0a, 0x11, 0x4d,
+ 0x65, 0x72, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e,
+ 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
+ 0x65, 0x72, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
+ 0x67, 0x6e, 0x22, 0x46, 0xda, 0x41, 0x10, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x74, 0x61, 0x72, 0x67,
+ 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x22, 0x2b, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e,
+ 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x50,
+ 0x61, 0x72, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50,
+ 0x61, 0x72, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d,
+ 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f,
+ 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x3a, 0x70, 0x61, 0x72,
+ 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x8a,
+ 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44,
+ 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
+ 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+ 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d,
+ 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -1013,28 +1022,27 @@ var file_v1_schema_design_service_proto_depIdxs = []int32{
1, // 7: bytebase.v1.CreateSchemaDesignRequest.schema_design:type_name -> bytebase.v1.SchemaDesign
1, // 8: bytebase.v1.UpdateSchemaDesignRequest.schema_design:type_name -> bytebase.v1.SchemaDesign
14, // 9: bytebase.v1.UpdateSchemaDesignRequest.update_mask:type_name -> google.protobuf.FieldMask
- 1, // 10: bytebase.v1.MergeSchemaDesignRequest.schema_design:type_name -> bytebase.v1.SchemaDesign
- 12, // 11: bytebase.v1.ParseSchemaStringRequest.engine:type_name -> bytebase.v1.Engine
- 11, // 12: bytebase.v1.ParseSchemaStringResponse.schema_metadata:type_name -> bytebase.v1.DatabaseMetadata
- 2, // 13: bytebase.v1.SchemaDesignService.GetSchemaDesign:input_type -> bytebase.v1.GetSchemaDesignRequest
- 3, // 14: bytebase.v1.SchemaDesignService.ListSchemaDesigns:input_type -> bytebase.v1.ListSchemaDesignsRequest
- 5, // 15: bytebase.v1.SchemaDesignService.CreateSchemaDesign:input_type -> bytebase.v1.CreateSchemaDesignRequest
- 6, // 16: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:input_type -> bytebase.v1.UpdateSchemaDesignRequest
- 7, // 17: bytebase.v1.SchemaDesignService.MergeSchemaDesign:input_type -> bytebase.v1.MergeSchemaDesignRequest
- 8, // 18: bytebase.v1.SchemaDesignService.ParseSchemaString:input_type -> bytebase.v1.ParseSchemaStringRequest
- 10, // 19: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:input_type -> bytebase.v1.DeleteSchemaDesignRequest
- 1, // 20: bytebase.v1.SchemaDesignService.GetSchemaDesign:output_type -> bytebase.v1.SchemaDesign
- 4, // 21: bytebase.v1.SchemaDesignService.ListSchemaDesigns:output_type -> bytebase.v1.ListSchemaDesignsResponse
- 1, // 22: bytebase.v1.SchemaDesignService.CreateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
- 1, // 23: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
- 1, // 24: bytebase.v1.SchemaDesignService.MergeSchemaDesign:output_type -> bytebase.v1.SchemaDesign
- 9, // 25: bytebase.v1.SchemaDesignService.ParseSchemaString:output_type -> bytebase.v1.ParseSchemaStringResponse
- 15, // 26: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:output_type -> google.protobuf.Empty
- 20, // [20:27] is the sub-list for method output_type
- 13, // [13:20] is the sub-list for method input_type
- 13, // [13:13] is the sub-list for extension type_name
- 13, // [13:13] is the sub-list for extension extendee
- 0, // [0:13] is the sub-list for field type_name
+ 12, // 10: bytebase.v1.ParseSchemaStringRequest.engine:type_name -> bytebase.v1.Engine
+ 11, // 11: bytebase.v1.ParseSchemaStringResponse.schema_metadata:type_name -> bytebase.v1.DatabaseMetadata
+ 2, // 12: bytebase.v1.SchemaDesignService.GetSchemaDesign:input_type -> bytebase.v1.GetSchemaDesignRequest
+ 3, // 13: bytebase.v1.SchemaDesignService.ListSchemaDesigns:input_type -> bytebase.v1.ListSchemaDesignsRequest
+ 5, // 14: bytebase.v1.SchemaDesignService.CreateSchemaDesign:input_type -> bytebase.v1.CreateSchemaDesignRequest
+ 6, // 15: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:input_type -> bytebase.v1.UpdateSchemaDesignRequest
+ 7, // 16: bytebase.v1.SchemaDesignService.MergeSchemaDesign:input_type -> bytebase.v1.MergeSchemaDesignRequest
+ 8, // 17: bytebase.v1.SchemaDesignService.ParseSchemaString:input_type -> bytebase.v1.ParseSchemaStringRequest
+ 10, // 18: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:input_type -> bytebase.v1.DeleteSchemaDesignRequest
+ 1, // 19: bytebase.v1.SchemaDesignService.GetSchemaDesign:output_type -> bytebase.v1.SchemaDesign
+ 4, // 20: bytebase.v1.SchemaDesignService.ListSchemaDesigns:output_type -> bytebase.v1.ListSchemaDesignsResponse
+ 1, // 21: bytebase.v1.SchemaDesignService.CreateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
+ 1, // 22: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
+ 1, // 23: bytebase.v1.SchemaDesignService.MergeSchemaDesign:output_type -> bytebase.v1.SchemaDesign
+ 9, // 24: bytebase.v1.SchemaDesignService.ParseSchemaString:output_type -> bytebase.v1.ParseSchemaStringResponse
+ 15, // 25: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:output_type -> google.protobuf.Empty
+ 19, // [19:26] is the sub-list for method output_type
+ 12, // [12:19] is the sub-list for method input_type
+ 12, // [12:12] is the sub-list for extension type_name
+ 12, // [12:12] is the sub-list for extension extendee
+ 0, // [0:12] is the sub-list for field type_name
}
func init() { file_v1_schema_design_service_proto_init() }
diff --git a/proto/generated-go/v1/schema_design_service.pb.gw.go b/proto/generated-go/v1/schema_design_service.pb.gw.go
index 6ed2af3e55..32fff7befc 100644
--- a/proto/generated-go/v1/schema_design_service.pb.gw.go
+++ b/proto/generated-go/v1/schema_design_service.pb.gw.go
@@ -321,18 +321,14 @@ func local_request_SchemaDesignService_UpdateSchemaDesign_0(ctx context.Context,
}
+var (
+ filter_SchemaDesignService_MergeSchemaDesign_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}}
+)
+
func request_SchemaDesignService_MergeSchemaDesign_0(ctx context.Context, marshaler runtime.Marshaler, client SchemaDesignServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq MergeSchemaDesignRequest
var metadata runtime.ServerMetadata
- newReader, berr := utilities.IOReaderFactory(req.Body)
- if berr != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
- }
- if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.SchemaDesign); err != nil && err != io.EOF {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
-
var (
val string
ok bool
@@ -340,14 +336,21 @@ func request_SchemaDesignService_MergeSchemaDesign_0(ctx context.Context, marsha
_ = err
)
- val, ok = pathParams["schema_design.name"]
+ val, ok = pathParams["name"]
if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "schema_design.name")
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
- err = runtime.PopulateFieldFromPath(&protoReq, "schema_design.name", val)
+ protoReq.Name, err = runtime.String(val)
if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "schema_design.name", err)
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SchemaDesignService_MergeSchemaDesign_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.MergeSchemaDesign(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
@@ -359,14 +362,6 @@ func local_request_SchemaDesignService_MergeSchemaDesign_0(ctx context.Context,
var protoReq MergeSchemaDesignRequest
var metadata runtime.ServerMetadata
- newReader, berr := utilities.IOReaderFactory(req.Body)
- if berr != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
- }
- if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.SchemaDesign); err != nil && err != io.EOF {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
- }
-
var (
val string
ok bool
@@ -374,14 +369,21 @@ func local_request_SchemaDesignService_MergeSchemaDesign_0(ctx context.Context,
_ = err
)
- val, ok = pathParams["schema_design.name"]
+ val, ok = pathParams["name"]
if !ok {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "schema_design.name")
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
- err = runtime.PopulateFieldFromPath(&protoReq, "schema_design.name", val)
+ protoReq.Name, err = runtime.String(val)
if err != nil {
- return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "schema_design.name", err)
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SchemaDesignService_MergeSchemaDesign_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.MergeSchemaDesign(ctx, &protoReq)
@@ -589,7 +591,7 @@ func RegisterSchemaDesignServiceHandlerServer(ctx context.Context, mux *runtime.
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SchemaDesignService/MergeSchemaDesign", runtime.WithHTTPPathPattern("/v1/{schema_design.name=projects/*/schemaDesigns/*}:merge"))
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SchemaDesignService/MergeSchemaDesign", runtime.WithHTTPPathPattern("/v1/{name=projects/*/schemaDesigns/*}:merge"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@@ -791,7 +793,7 @@ func RegisterSchemaDesignServiceHandlerClient(ctx context.Context, mux *runtime.
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
- annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SchemaDesignService/MergeSchemaDesign", runtime.WithHTTPPathPattern("/v1/{schema_design.name=projects/*/schemaDesigns/*}:merge"))
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SchemaDesignService/MergeSchemaDesign", runtime.WithHTTPPathPattern("/v1/{name=projects/*/schemaDesigns/*}:merge"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@@ -863,7 +865,7 @@ var (
pattern_SchemaDesignService_UpdateSchemaDesign_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "schemaDesigns", "schema_design.name"}, ""))
- pattern_SchemaDesignService_MergeSchemaDesign_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "schemaDesigns", "schema_design.name"}, "merge"))
+ pattern_SchemaDesignService_MergeSchemaDesign_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "schemaDesigns", "name"}, "merge"))
pattern_SchemaDesignService_ParseSchemaString_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "schemaDesign"}, "parseSchemaString"))
diff --git a/proto/v1/schema_design_service.proto b/proto/v1/schema_design_service.proto
index 980381f473..1957b6cd1a 100644
--- a/proto/v1/schema_design_service.proto
+++ b/proto/v1/schema_design_service.proto
@@ -29,7 +29,7 @@ service SchemaDesignService {
post: "/v1/{parent=projects/*}/schemaDesign"
body: "schema_design"
};
- option (google.api.method_signature) = "parent,schemaDesign";
+ option (google.api.method_signature) = "parent,schema_design";
}
rpc UpdateSchemaDesign(UpdateSchemaDesignRequest) returns (SchemaDesign) {
@@ -37,15 +37,12 @@ service SchemaDesignService {
patch: "/v1/{schema_design.name=projects/*/schemaDesigns/*}"
body: "schema_design"
};
- option (google.api.method_signature) = "schemaDesign,update_mask";
+ option (google.api.method_signature) = "schema_design,update_mask";
}
rpc MergeSchemaDesign(MergeSchemaDesignRequest) returns (SchemaDesign) {
- option (google.api.http) = {
- post: "/v1/{schema_design.name=projects/*/schemaDesigns/*}:merge"
- body: "schema_design"
- };
- option (google.api.method_signature) = "schemaDesign";
+ option (google.api.http) = {post: "/v1/{name=projects/*/schemaDesigns/*}:merge"};
+ option (google.api.method_signature) = "name,target_name";
}
rpc ParseSchemaString(ParseSchemaStringRequest) returns (ParseSchemaStringResponse) {
@@ -178,8 +175,13 @@ message UpdateSchemaDesignRequest {
}
message MergeSchemaDesignRequest {
- // The personal draft schema design to merge.
- SchemaDesign schema_design = 1 [(google.api.field_behavior) = REQUIRED];
+ // The name of the schema design to merge.
+ // Format: projects/{project}/schemaDesigns/{schemaDesign}
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The target schema design to merge into.
+ // Format: projects/{project}/schemaDesigns/{schemaDesign}
+ string target_name = 2 [(google.api.field_behavior) = REQUIRED];
}
message ParseSchemaStringRequest {