Skip to content

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

chore: add parse schema string to metadata api (#7101)

boojack241caa5bb239
diff --git a/backend/api/v1/schema_design_service.go b/backend/api/v1/schema_design_service.go
index 979284394b..47a45a706c 100644
--- a/backend/api/v1/schema_design_service.go
+++ b/backend/api/v1/schema_design_service.go
@@ -235,6 +235,20 @@ func (s *SchemaDesignService) UpdateSchemaDesign(ctx context.Context, request *v
return schemaDesign, nil
}
+// ParseSchemaString parses a schema string to database metadata.
+func (*SchemaDesignService) ParseSchemaString(_ context.Context, request *v1pb.ParseSchemaStringRequest) (*v1pb.ParseSchemaStringResponse, error) {
+ if request.SchemaString == "" {
+ return nil, status.Errorf(codes.InvalidArgument, "schema_string is required")
+ }
+ metadata, err := transformSchemaStringToDatabaseMetadata(request.Engine, request.SchemaString)
+ if err != nil {
+ return nil, err
+ }
+ return &v1pb.ParseSchemaStringResponse{
+ SchemaMetadata: metadata,
+ }, nil
+}
+
// DeleteSchemaDesign deletes an existing schema design.
func (s *SchemaDesignService) DeleteSchemaDesign(ctx context.Context, request *v1pb.DeleteSchemaDesignRequest) (*emptypb.Empty, error) {
_, sheetID, err := getProjectResourceIDAndSchemaDesignSheetID(request.Name)
diff --git a/frontend/src/types/proto/google/protobuf/struct.ts b/frontend/src/types/proto/google/protobuf/struct.ts
index 2099d516f6..3425fd7e3f 100644
--- a/frontend/src/types/proto/google/protobuf/struct.ts
+++ b/frontend/src/types/proto/google/protobuf/struct.ts
@@ -67,15 +67,25 @@ export interface Struct_FieldsEntry {
*/
export interface Value {
/** Represents a null value. */
- nullValue?: NullValue | undefined;
+ nullValue?:
+ | NullValue
+ | undefined;
/** Represents a double value. */
- numberValue?: number | undefined;
+ numberValue?:
+ | number
+ | undefined;
/** Represents a string value. */
- stringValue?: string | undefined;
+ stringValue?:
+ | string
+ | undefined;
/** Represents a boolean value. */
- boolValue?: boolean | undefined;
+ boolValue?:
+ | boolean
+ | undefined;
/** Represents a structured value. */
- structValue?: { [key: string]: any } | undefined;
+ structValue?:
+ | { [key: string]: any }
+ | undefined;
/** Represents a repeated `Value`. */
listValue?: Array<any> | undefined;
}
@@ -95,24 +105,17 @@ function createBaseStruct(): Struct {
}
export const Struct = {
- encode(
- message: Struct,
- writer: _m0.Writer = _m0.Writer.create()
- ): _m0.Writer {
+ encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
Object.entries(message.fields).forEach(([key, value]) => {
if (value !== undefined) {
- Struct_FieldsEntry.encode(
- { key: key as any, value },
- writer.uint32(10).fork()
- ).ldelim();
+ Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim();
}
});
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Struct {
- const reader =
- input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseStruct();
while (reader.pos < end) {
@@ -140,12 +143,10 @@ export const Struct = {
fromJSON(object: any): Struct {
return {
fields: isObject(object.fields)
- ? Object.entries(object.fields).reduce<{
- [key: string]: any | undefined;
- }>((acc, [key, value]) => {
- acc[key] = value as any | undefined;
- return acc;
- }, {})
+ ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
+ acc[key] = value as any | undefined;
+ return acc;
+ }, {})
: {},
};
},
@@ -167,14 +168,15 @@ export const Struct = {
fromPartial(object: DeepPartial<Struct>): Struct {
const message = createBaseStruct();
- message.fields = Object.entries(object.fields ?? {}).reduce<{
- [key: string]: any | undefined;
- }>((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = value;
- }
- return acc;
- }, {});
+ message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>(
+ (acc, [key, value]) => {
+ if (value !== undefined) {
+ acc[key] = value;
+ }
+ return acc;
+ },
+ {},
+ );
return message;
},
@@ -204,25 +206,18 @@ function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
}
export const Struct_FieldsEntry = {
- encode(
- message: Struct_FieldsEntry,
- writer: _m0.Writer = _m0.Writer.create()
- ): _m0.Writer {
+ encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
- Value.encode(
- Value.wrap(message.value),
- writer.uint32(18).fork()
- ).ldelim();
+ Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry {
- const reader =
- input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseStruct_FieldsEntry();
while (reader.pos < end) {
@@ -252,10 +247,7 @@ export const Struct_FieldsEntry = {
},
fromJSON(object: any): Struct_FieldsEntry {
- return {
- key: isSet(object.key) ? String(object.key) : "",
- value: isSet(object?.value) ? object.value : undefined,
- };
+ return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object?.value) ? object.value : undefined };
},
toJSON(message: Struct_FieldsEntry): unknown {
@@ -303,23 +295,16 @@ export const Value = {
writer.uint32(32).bool(message.boolValue);
}
if (message.structValue !== undefined) {
- Struct.encode(
- Struct.wrap(message.structValue),
- writer.uint32(42).fork()
- ).ldelim();
+ Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim();
}
if (message.listValue !== undefined) {
- ListValue.encode(
- ListValue.wrap(message.listValue),
- writer.uint32(50).fork()
- ).ldelim();
+ ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Value {
- const reader =
- input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseValue();
while (reader.pos < end) {
@@ -358,18 +343,14 @@ export const Value = {
break;
}
- message.structValue = Struct.unwrap(
- Struct.decode(reader, reader.uint32())
- );
+ message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
continue;
case 6:
if (tag !== 50) {
break;
}
- message.listValue = ListValue.unwrap(
- ListValue.decode(reader, reader.uint32())
- );
+ message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -382,41 +363,23 @@ export const Value = {
fromJSON(object: any): Value {
return {
- nullValue: isSet(object.nullValue)
- ? nullValueFromJSON(object.nullValue)
- : undefined,
- numberValue: isSet(object.numberValue)
- ? Number(object.numberValue)
- : undefined,
- stringValue: isSet(object.stringValue)
- ? String(object.stringValue)
- : undefined,
- boolValue: isSet(object.boolValue)
- ? Boolean(object.boolValue)
- : undefined,
- structValue: isObject(object.structValue)
- ? object.structValue
- : undefined,
- listValue: Array.isArray(object.listValue)
- ? [...object.listValue]
- : undefined,
+ nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
+ numberValue: isSet(object.numberValue) ? Number(object.numberValue) : undefined,
+ stringValue: isSet(object.stringValue) ? String(object.stringValue) : undefined,
+ boolValue: isSet(object.boolValue) ? Boolean(object.boolValue) : undefined,
+ structValue: isObject(object.structValue) ? object.structValue : undefined,
+ listValue: Array.isArray(object.listValue) ? [...object.listValue] : undefined,
};
},
toJSON(message: Value): unknown {
const obj: any = {};
message.nullValue !== undefined &&
- (obj.nullValue =
- message.nullValue !== undefined
- ? nullValueToJSON(message.nullValue)
- : undefined);
- message.numberValue !== undefined &&
- (obj.numberValue = message.numberValue);
- message.stringValue !== undefined &&
- (obj.stringValue = message.stringValue);
+ (obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined);
+ message.numberValue !== undefined && (obj.numberValue = message.numberValue);
+ message.stringValue !== undefined && (obj.stringValue = message.stringValue);
message.boolValue !== undefined && (obj.boolValue = message.boolValue);
- message.structValue !== undefined &&
- (obj.structValue = message.structValue);
+ message.structValue !== undefined && (obj.structValue = message.structValue);
message.listValue !== undefined && (obj.listValue = message.listValue);
return obj;
},
@@ -456,9 +419,7 @@ export const Value = {
return result;
},
- unwrap(
- message: any
- ): string | number | boolean | Object | null | Array<any> | undefined {
+ unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
if (message.stringValue !== undefined) {
return message.stringValue;
} else if (message?.numberValue !== undefined) {
@@ -481,10 +442,7 @@ function createBaseListValue(): ListValue {
}
export const ListValue = {
- encode(
- message: ListValue,
- writer: _m0.Writer = _m0.Writer.create()
- ): _m0.Writer {
+ encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
for (const v of message.values) {
Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim();
}
@@ -492,8 +450,7 @@ export const ListValue = {
},
decode(input: _m0.Reader | Uint8Array, length?: number): ListValue {
- const reader =
- input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseListValue();
while (reader.pos < end) {
@@ -504,9 +461,7 @@ export const ListValue = {
break;
}
- message.values.push(
- Value.unwrap(Value.decode(reader, reader.uint32()))
- );
+ message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -556,23 +511,11 @@ export const ListValue = {
},
};
-type Builtin =
- | Date
- | Function
- | Uint8Array
- | string
- | number
- | boolean
- | undefined;
-
-export type DeepPartial<T> = T extends Builtin
- ? T
- : T extends Array<infer U>
- ? Array<DeepPartial<U>>
- : T extends ReadonlyArray<infer U>
- ? ReadonlyArray<DeepPartial<U>>
- : T extends {}
- ? { [K in keyof T]?: DeepPartial<T[K]> }
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function isObject(value: any): boolean {
diff --git a/frontend/src/types/proto/v1/schema_design_service.ts b/frontend/src/types/proto/v1/schema_design_service.ts
index 26217c275e..1babaf8b5a 100644
--- a/frontend/src/types/proto/v1/schema_design_service.ts
+++ b/frontend/src/types/proto/v1/schema_design_service.ts
@@ -132,6 +132,16 @@ export interface UpdateSchemaDesignRequest {
updateMask?: string[] | undefined;
}
+export interface ParseSchemaStringRequest {
+ schemaString: string;
+ engine: Engine;
+}
+
+export interface ParseSchemaStringResponse {
+ /** The metadata of the parsed schema. */
+ schemaMetadata?: DatabaseMetadata | undefined;
+}
+
export interface DeleteSchemaDesignRequest {
/**
* The name of the schema design to delete.
@@ -756,6 +766,138 @@ export const UpdateSchemaDesignRequest = {
},
};
+function createBaseParseSchemaStringRequest(): ParseSchemaStringRequest {
+ return { schemaString: "", engine: 0 };
+}
+
+export const ParseSchemaStringRequest = {
+ encode(message: ParseSchemaStringRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.schemaString !== "") {
+ writer.uint32(10).string(message.schemaString);
+ }
+ if (message.engine !== 0) {
+ writer.uint32(16).int32(message.engine);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ParseSchemaStringRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseParseSchemaStringRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.schemaString = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.engine = reader.int32() as any;
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ParseSchemaStringRequest {
+ return {
+ schemaString: isSet(object.schemaString) ? String(object.schemaString) : "",
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ };
+ },
+
+ toJSON(message: ParseSchemaStringRequest): unknown {
+ const obj: any = {};
+ message.schemaString !== undefined && (obj.schemaString = message.schemaString);
+ message.engine !== undefined && (obj.engine = engineToJSON(message.engine));
+ return obj;
+ },
+
+ create(base?: DeepPartial<ParseSchemaStringRequest>): ParseSchemaStringRequest {
+ return ParseSchemaStringRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<ParseSchemaStringRequest>): ParseSchemaStringRequest {
+ const message = createBaseParseSchemaStringRequest();
+ message.schemaString = object.schemaString ?? "";
+ message.engine = object.engine ?? 0;
+ return message;
+ },
+};
+
+function createBaseParseSchemaStringResponse(): ParseSchemaStringResponse {
+ return { schemaMetadata: undefined };
+}
+
+export const ParseSchemaStringResponse = {
+ encode(message: ParseSchemaStringResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.schemaMetadata !== undefined) {
+ DatabaseMetadata.encode(message.schemaMetadata, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ParseSchemaStringResponse {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseParseSchemaStringResponse();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.schemaMetadata = DatabaseMetadata.decode(reader, reader.uint32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ParseSchemaStringResponse {
+ return {
+ schemaMetadata: isSet(object.schemaMetadata) ? DatabaseMetadata.fromJSON(object.schemaMetadata) : undefined,
+ };
+ },
+
+ toJSON(message: ParseSchemaStringResponse): unknown {
+ const obj: any = {};
+ message.schemaMetadata !== undefined &&
+ (obj.schemaMetadata = message.schemaMetadata ? DatabaseMetadata.toJSON(message.schemaMetadata) : undefined);
+ return obj;
+ },
+
+ create(base?: DeepPartial<ParseSchemaStringResponse>): ParseSchemaStringResponse {
+ return ParseSchemaStringResponse.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<ParseSchemaStringResponse>): ParseSchemaStringResponse {
+ const message = createBaseParseSchemaStringResponse();
+ message.schemaMetadata = (object.schemaMetadata !== undefined && object.schemaMetadata !== null)
+ ? DatabaseMetadata.fromPartial(object.schemaMetadata)
+ : undefined;
+ return message;
+ },
+};
+
function createBaseDeleteSchemaDesignRequest(): DeleteSchemaDesignRequest {
return { name: "" };
}
@@ -1135,6 +1277,61 @@ export const SchemaDesignServiceDefinition = {
},
},
},
+ parseSchemaString: {
+ name: "ParseSchemaString",
+ requestType: ParseSchemaStringRequest,
+ requestStream: false,
+ responseType: ParseSchemaStringResponse,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 578365826: [
+ new Uint8Array([
+ 39,
+ 58,
+ 1,
+ 42,
+ 34,
+ 34,
+ 47,
+ 118,
+ 49,
+ 47,
+ 115,
+ 99,
+ 104,
+ 101,
+ 109,
+ 97,
+ 68,
+ 101,
+ 115,
+ 105,
+ 103,
+ 110,
+ 58,
+ 112,
+ 97,
+ 114,
+ 115,
+ 101,
+ 83,
+ 99,
+ 104,
+ 101,
+ 109,
+ 97,
+ 83,
+ 116,
+ 114,
+ 105,
+ 110,
+ 103,
+ ]),
+ ],
+ },
+ },
+ },
deleteSchemaDesign: {
name: "DeleteSchemaDesign",
requestType: DeleteSchemaDesignRequest,
@@ -1211,6 +1408,10 @@ export interface SchemaDesignServiceImplementation<CallContextExt = {}> {
request: UpdateSchemaDesignRequest,
context: CallContext & CallContextExt,
): Promise<DeepPartial<SchemaDesign>>;
+ parseSchemaString(
+ request: ParseSchemaStringRequest,
+ context: CallContext & CallContextExt,
+ ): Promise<DeepPartial<ParseSchemaStringResponse>>;
deleteSchemaDesign(
request: DeleteSchemaDesignRequest,
context: CallContext & CallContextExt,
@@ -1234,6 +1435,10 @@ export interface SchemaDesignServiceClient<CallOptionsExt = {}> {
request: DeepPartial<UpdateSchemaDesignRequest>,
options?: CallOptions & CallOptionsExt,
): Promise<SchemaDesign>;
+ parseSchemaString(
+ request: DeepPartial<ParseSchemaStringRequest>,
+ options?: CallOptions & CallOptionsExt,
+ ): Promise<ParseSchemaStringResponse>;
deleteSchemaDesign(
request: DeepPartial<DeleteSchemaDesignRequest>,
options?: CallOptions & CallOptionsExt,
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 6ae4235b24..05578fd8b4 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -478,6 +478,8 @@
- [GetSchemaDesignRequest](#bytebase-v1-GetSchemaDesignRequest)
- [ListSchemaDesignsRequest](#bytebase-v1-ListSchemaDesignsRequest)
- [ListSchemaDesignsResponse](#bytebase-v1-ListSchemaDesignsResponse)
+ - [ParseSchemaStringRequest](#bytebase-v1-ParseSchemaStringRequest)
+ - [ParseSchemaStringResponse](#bytebase-v1-ParseSchemaStringResponse)
- [SchemaDesign](#bytebase-v1-SchemaDesign)
- [UpdateSchemaDesignRequest](#bytebase-v1-UpdateSchemaDesignRequest)
@@ -7666,6 +7668,37 @@ When paginating, all other parameters provided to `ListSchemaDesigns` must match
+<a name="bytebase-v1-ParseSchemaStringRequest"></a>
+
+### ParseSchemaStringRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| schema_string | [string](#string) | | |
+| engine | [Engine](#bytebase-v1-Engine) | | |
+
+
+
+
+
+
+<a name="bytebase-v1-ParseSchemaStringResponse"></a>
+
+### ParseSchemaStringResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| schema_metadata | [DatabaseMetadata](#bytebase-v1-DatabaseMetadata) | | The metadata of the parsed schema. |
+
+
+
+
+
+
<a name="bytebase-v1-SchemaDesign"></a>
### SchemaDesign
@@ -7728,6 +7761,7 @@ The schema design&#39;s `name` field is used to identify the schema design to up
| ListSchemaDesigns | [ListSchemaDesignsRequest](#bytebase-v1-ListSchemaDesignsRequest) | [ListSchemaDesignsResponse](#bytebase-v1-ListSchemaDesignsResponse) | |
| CreateSchemaDesign | [CreateSchemaDesignRequest](#bytebase-v1-CreateSchemaDesignRequest) | [SchemaDesign](#bytebase-v1-SchemaDesign) | |
| UpdateSchemaDesign | [UpdateSchemaDesignRequest](#bytebase-v1-UpdateSchemaDesignRequest) | [SchemaDesign](#bytebase-v1-SchemaDesign) | |
+| ParseSchemaString | [ParseSchemaStringRequest](#bytebase-v1-ParseSchemaStringRequest) | [ParseSchemaStringResponse](#bytebase-v1-ParseSchemaStringResponse) | |
| DeleteSchemaDesign | [DeleteSchemaDesignRequest](#bytebase-v1-DeleteSchemaDesignRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
diff --git a/proto/generated-go/v1/schema_design_service.pb.go b/proto/generated-go/v1/schema_design_service.pb.go
index e58d4da4cd..3a601d9efb 100644
--- a/proto/generated-go/v1/schema_design_service.pb.go
+++ b/proto/generated-go/v1/schema_design_service.pb.go
@@ -497,6 +497,109 @@ func (x *UpdateSchemaDesignRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
return nil
}
+type ParseSchemaStringRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ SchemaString string `protobuf:"bytes,1,opt,name=schema_string,json=schemaString,proto3" json:"schema_string,omitempty"`
+ Engine Engine `protobuf:"varint,2,opt,name=engine,proto3,enum=bytebase.v1.Engine" json:"engine,omitempty"`
+}
+
+func (x *ParseSchemaStringRequest) Reset() {
+ *x = ParseSchemaStringRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_schema_design_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ParseSchemaStringRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ParseSchemaStringRequest) ProtoMessage() {}
+
+func (x *ParseSchemaStringRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_schema_design_service_proto_msgTypes[6]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ParseSchemaStringRequest.ProtoReflect.Descriptor instead.
+func (*ParseSchemaStringRequest) Descriptor() ([]byte, []int) {
+ return file_v1_schema_design_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *ParseSchemaStringRequest) GetSchemaString() string {
+ if x != nil {
+ return x.SchemaString
+ }
+ return ""
+}
+
+func (x *ParseSchemaStringRequest) GetEngine() Engine {
+ if x != nil {
+ return x.Engine
+ }
+ return Engine_ENGINE_UNSPECIFIED
+}
+
+type ParseSchemaStringResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The metadata of the parsed schema.
+ SchemaMetadata *DatabaseMetadata `protobuf:"bytes,1,opt,name=schema_metadata,json=schemaMetadata,proto3" json:"schema_metadata,omitempty"`
+}
+
+func (x *ParseSchemaStringResponse) Reset() {
+ *x = ParseSchemaStringResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_schema_design_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ParseSchemaStringResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ParseSchemaStringResponse) ProtoMessage() {}
+
+func (x *ParseSchemaStringResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_schema_design_service_proto_msgTypes[7]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ParseSchemaStringResponse.ProtoReflect.Descriptor instead.
+func (*ParseSchemaStringResponse) Descriptor() ([]byte, []int) {
+ return file_v1_schema_design_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *ParseSchemaStringResponse) GetSchemaMetadata() *DatabaseMetadata {
+ if x != nil {
+ return x.SchemaMetadata
+ }
+ return nil
+}
+
type DeleteSchemaDesignRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -510,7 +613,7 @@ type DeleteSchemaDesignRequest struct {
func (x *DeleteSchemaDesignRequest) Reset() {
*x = DeleteSchemaDesignRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_schema_design_service_proto_msgTypes[6]
+ mi := &file_v1_schema_design_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -523,7 +626,7 @@ func (x *DeleteSchemaDesignRequest) String() string {
func (*DeleteSchemaDesignRequest) ProtoMessage() {}
func (x *DeleteSchemaDesignRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_schema_design_service_proto_msgTypes[6]
+ mi := &file_v1_schema_design_service_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -536,7 +639,7 @@ func (x *DeleteSchemaDesignRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteSchemaDesignRequest.ProtoReflect.Descriptor instead.
func (*DeleteSchemaDesignRequest) Descriptor() ([]byte, []int) {
- return file_v1_schema_design_service_proto_rawDescGZIP(), []int{6}
+ return file_v1_schema_design_service_proto_rawDescGZIP(), []int{8}
}
func (x *DeleteSchemaDesignRequest) GetName() string {
@@ -643,63 +746,86 @@ var file_v1_schema_design_service_proto_rawDesc = []byte{
0x70, 0x64, 0x61, 0x74, 0x65, 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, 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, 0xb1,
- 0x06, 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,
+ 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 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, 0xc5, 0x07, 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, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 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, 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, 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,
+ 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, 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,
+ 0x2a, 0x7d, 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 (
@@ -714,7 +840,7 @@ func file_v1_schema_design_service_proto_rawDescGZIP() []byte {
return file_v1_schema_design_service_proto_rawDescData
}
-var file_v1_schema_design_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
+var file_v1_schema_design_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_v1_schema_design_service_proto_goTypes = []interface{}{
(*SchemaDesign)(nil), // 0: bytebase.v1.SchemaDesign
(*GetSchemaDesignRequest)(nil), // 1: bytebase.v1.GetSchemaDesignRequest
@@ -722,38 +848,44 @@ var file_v1_schema_design_service_proto_goTypes = []interface{}{
(*ListSchemaDesignsResponse)(nil), // 3: bytebase.v1.ListSchemaDesignsResponse
(*CreateSchemaDesignRequest)(nil), // 4: bytebase.v1.CreateSchemaDesignRequest
(*UpdateSchemaDesignRequest)(nil), // 5: bytebase.v1.UpdateSchemaDesignRequest
- (*DeleteSchemaDesignRequest)(nil), // 6: bytebase.v1.DeleteSchemaDesignRequest
- (*DatabaseMetadata)(nil), // 7: bytebase.v1.DatabaseMetadata
- (Engine)(0), // 8: bytebase.v1.Engine
- (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
- (*fieldmaskpb.FieldMask)(nil), // 10: google.protobuf.FieldMask
- (*emptypb.Empty)(nil), // 11: google.protobuf.Empty
+ (*ParseSchemaStringRequest)(nil), // 6: bytebase.v1.ParseSchemaStringRequest
+ (*ParseSchemaStringResponse)(nil), // 7: bytebase.v1.ParseSchemaStringResponse
+ (*DeleteSchemaDesignRequest)(nil), // 8: bytebase.v1.DeleteSchemaDesignRequest
+ (*DatabaseMetadata)(nil), // 9: bytebase.v1.DatabaseMetadata
+ (Engine)(0), // 10: bytebase.v1.Engine
+ (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp
+ (*fieldmaskpb.FieldMask)(nil), // 12: google.protobuf.FieldMask
+ (*emptypb.Empty)(nil), // 13: google.protobuf.Empty
}
var file_v1_schema_design_service_proto_depIdxs = []int32{
- 7, // 0: bytebase.v1.SchemaDesign.schema_metadata:type_name -> bytebase.v1.DatabaseMetadata
- 7, // 1: bytebase.v1.SchemaDesign.baseline_schema_metadata:type_name -> bytebase.v1.DatabaseMetadata
- 8, // 2: bytebase.v1.SchemaDesign.engine:type_name -> bytebase.v1.Engine
- 9, // 3: bytebase.v1.SchemaDesign.create_time:type_name -> google.protobuf.Timestamp
- 9, // 4: bytebase.v1.SchemaDesign.update_time:type_name -> google.protobuf.Timestamp
+ 9, // 0: bytebase.v1.SchemaDesign.schema_metadata:type_name -> bytebase.v1.DatabaseMetadata
+ 9, // 1: bytebase.v1.SchemaDesign.baseline_schema_metadata:type_name -> bytebase.v1.DatabaseMetadata
+ 10, // 2: bytebase.v1.SchemaDesign.engine:type_name -> bytebase.v1.Engine
+ 11, // 3: bytebase.v1.SchemaDesign.create_time:type_name -> google.protobuf.Timestamp
+ 11, // 4: bytebase.v1.SchemaDesign.update_time:type_name -> google.protobuf.Timestamp
0, // 5: bytebase.v1.ListSchemaDesignsResponse.schema_designs:type_name -> bytebase.v1.SchemaDesign
0, // 6: bytebase.v1.CreateSchemaDesignRequest.schema_design:type_name -> bytebase.v1.SchemaDesign
0, // 7: bytebase.v1.UpdateSchemaDesignRequest.schema_design:type_name -> bytebase.v1.SchemaDesign
- 10, // 8: bytebase.v1.UpdateSchemaDesignRequest.update_mask:type_name -> google.protobuf.FieldMask
- 1, // 9: bytebase.v1.SchemaDesignService.GetSchemaDesign:input_type -> bytebase.v1.GetSchemaDesignRequest
- 2, // 10: bytebase.v1.SchemaDesignService.ListSchemaDesigns:input_type -> bytebase.v1.ListSchemaDesignsRequest
- 4, // 11: bytebase.v1.SchemaDesignService.CreateSchemaDesign:input_type -> bytebase.v1.CreateSchemaDesignRequest
- 5, // 12: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:input_type -> bytebase.v1.UpdateSchemaDesignRequest
- 6, // 13: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:input_type -> bytebase.v1.DeleteSchemaDesignRequest
- 0, // 14: bytebase.v1.SchemaDesignService.GetSchemaDesign:output_type -> bytebase.v1.SchemaDesign
- 3, // 15: bytebase.v1.SchemaDesignService.ListSchemaDesigns:output_type -> bytebase.v1.ListSchemaDesignsResponse
- 0, // 16: bytebase.v1.SchemaDesignService.CreateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
- 0, // 17: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
- 11, // 18: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:output_type -> google.protobuf.Empty
- 14, // [14:19] is the sub-list for method output_type
- 9, // [9:14] is the sub-list for method input_type
- 9, // [9:9] is the sub-list for extension type_name
- 9, // [9:9] is the sub-list for extension extendee
- 0, // [0:9] is the sub-list for field type_name
+ 12, // 8: bytebase.v1.UpdateSchemaDesignRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 10, // 9: bytebase.v1.ParseSchemaStringRequest.engine:type_name -> bytebase.v1.Engine
+ 9, // 10: bytebase.v1.ParseSchemaStringResponse.schema_metadata:type_name -> bytebase.v1.DatabaseMetadata
+ 1, // 11: bytebase.v1.SchemaDesignService.GetSchemaDesign:input_type -> bytebase.v1.GetSchemaDesignRequest
+ 2, // 12: bytebase.v1.SchemaDesignService.ListSchemaDesigns:input_type -> bytebase.v1.ListSchemaDesignsRequest
+ 4, // 13: bytebase.v1.SchemaDesignService.CreateSchemaDesign:input_type -> bytebase.v1.CreateSchemaDesignRequest
+ 5, // 14: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:input_type -> bytebase.v1.UpdateSchemaDesignRequest
+ 6, // 15: bytebase.v1.SchemaDesignService.ParseSchemaString:input_type -> bytebase.v1.ParseSchemaStringRequest
+ 8, // 16: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:input_type -> bytebase.v1.DeleteSchemaDesignRequest
+ 0, // 17: bytebase.v1.SchemaDesignService.GetSchemaDesign:output_type -> bytebase.v1.SchemaDesign
+ 3, // 18: bytebase.v1.SchemaDesignService.ListSchemaDesigns:output_type -> bytebase.v1.ListSchemaDesignsResponse
+ 0, // 19: bytebase.v1.SchemaDesignService.CreateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
+ 0, // 20: bytebase.v1.SchemaDesignService.UpdateSchemaDesign:output_type -> bytebase.v1.SchemaDesign
+ 7, // 21: bytebase.v1.SchemaDesignService.ParseSchemaString:output_type -> bytebase.v1.ParseSchemaStringResponse
+ 13, // 22: bytebase.v1.SchemaDesignService.DeleteSchemaDesign:output_type -> google.protobuf.Empty
+ 17, // [17:23] is the sub-list for method output_type
+ 11, // [11:17] is the sub-list for method input_type
+ 11, // [11:11] is the sub-list for extension type_name
+ 11, // [11:11] is the sub-list for extension extendee
+ 0, // [0:11] is the sub-list for field type_name
}
func init() { file_v1_schema_design_service_proto_init() }
@@ -837,6 +969,30 @@ func file_v1_schema_design_service_proto_init() {
}
}
file_v1_schema_design_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ParseSchemaStringRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_schema_design_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ParseSchemaStringResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_schema_design_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteSchemaDesignRequest); i {
case 0:
return &v.state
@@ -855,7 +1011,7 @@ func file_v1_schema_design_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_schema_design_service_proto_rawDesc,
NumEnums: 0,
- NumMessages: 7,
+ NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
},
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 e4b6cb6809..f90f54a131 100644
--- a/proto/generated-go/v1/schema_design_service.pb.gw.go
+++ b/proto/generated-go/v1/schema_design_service.pb.gw.go
@@ -321,6 +321,40 @@ func local_request_SchemaDesignService_UpdateSchemaDesign_0(ctx context.Context,
}
+func request_SchemaDesignService_ParseSchemaString_0(ctx context.Context, marshaler runtime.Marshaler, client SchemaDesignServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ParseSchemaStringRequest
+ 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); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.ParseSchemaString(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SchemaDesignService_ParseSchemaString_0(ctx context.Context, marshaler runtime.Marshaler, server SchemaDesignServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ParseSchemaStringRequest
+ 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); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ParseSchemaString(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_SchemaDesignService_DeleteSchemaDesign_0(ctx context.Context, marshaler runtime.Marshaler, client SchemaDesignServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteSchemaDesignRequest
var metadata runtime.ServerMetadata
@@ -479,6 +513,31 @@ func RegisterSchemaDesignServiceHandlerServer(ctx context.Context, mux *runtime.
})
+ mux.Handle("POST", pattern_SchemaDesignService_ParseSchemaString_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SchemaDesignService/ParseSchemaString", runtime.WithHTTPPathPattern("/v1/schemaDesign:parseSchemaString"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SchemaDesignService_ParseSchemaString_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SchemaDesignService_ParseSchemaString_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("DELETE", pattern_SchemaDesignService_DeleteSchemaDesign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -633,6 +692,28 @@ func RegisterSchemaDesignServiceHandlerClient(ctx context.Context, mux *runtime.
})
+ mux.Handle("POST", pattern_SchemaDesignService_ParseSchemaString_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SchemaDesignService/ParseSchemaString", runtime.WithHTTPPathPattern("/v1/schemaDesign:parseSchemaString"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SchemaDesignService_ParseSchemaString_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SchemaDesignService_ParseSchemaString_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("DELETE", pattern_SchemaDesignService_DeleteSchemaDesign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -667,6 +748,8 @@ 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_ParseSchemaString_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "schemaDesign"}, "parseSchemaString"))
+
pattern_SchemaDesignService_DeleteSchemaDesign_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"}, ""))
)
@@ -679,5 +762,7 @@ var (
forward_SchemaDesignService_UpdateSchemaDesign_0 = runtime.ForwardResponseMessage
+ forward_SchemaDesignService_ParseSchemaString_0 = runtime.ForwardResponseMessage
+
forward_SchemaDesignService_DeleteSchemaDesign_0 = runtime.ForwardResponseMessage
)
diff --git a/proto/generated-go/v1/schema_design_service_grpc.pb.go b/proto/generated-go/v1/schema_design_service_grpc.pb.go
index 38f190faf3..94469e16d1 100644
--- a/proto/generated-go/v1/schema_design_service_grpc.pb.go
+++ b/proto/generated-go/v1/schema_design_service_grpc.pb.go
@@ -24,6 +24,7 @@ const (
SchemaDesignService_ListSchemaDesigns_FullMethodName = "/bytebase.v1.SchemaDesignService/ListSchemaDesigns"
SchemaDesignService_CreateSchemaDesign_FullMethodName = "/bytebase.v1.SchemaDesignService/CreateSchemaDesign"
SchemaDesignService_UpdateSchemaDesign_FullMethodName = "/bytebase.v1.SchemaDesignService/UpdateSchemaDesign"
+ SchemaDesignService_ParseSchemaString_FullMethodName = "/bytebase.v1.SchemaDesignService/ParseSchemaString"
SchemaDesignService_DeleteSchemaDesign_FullMethodName = "/bytebase.v1.SchemaDesignService/DeleteSchemaDesign"
)
@@ -35,6 +36,7 @@ type SchemaDesignServiceClient interface {
ListSchemaDesigns(ctx context.Context, in *ListSchemaDesignsRequest, opts ...grpc.CallOption) (*ListSchemaDesignsResponse, error)
CreateSchemaDesign(ctx context.Context, in *CreateSchemaDesignRequest, opts ...grpc.CallOption) (*SchemaDesign, error)
UpdateSchemaDesign(ctx context.Context, in *UpdateSchemaDesignRequest, opts ...grpc.CallOption) (*SchemaDesign, error)
+ ParseSchemaString(ctx context.Context, in *ParseSchemaStringRequest, opts ...grpc.CallOption) (*ParseSchemaStringResponse, error)
DeleteSchemaDesign(ctx context.Context, in *DeleteSchemaDesignRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
@@ -82,6 +84,15 @@ func (c *schemaDesignServiceClient) UpdateSchemaDesign(ctx context.Context, in *
return out, nil
}
+func (c *schemaDesignServiceClient) ParseSchemaString(ctx context.Context, in *ParseSchemaStringRequest, opts ...grpc.CallOption) (*ParseSchemaStringResponse, error) {
+ out := new(ParseSchemaStringResponse)
+ err := c.cc.Invoke(ctx, SchemaDesignService_ParseSchemaString_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *schemaDesignServiceClient) DeleteSchemaDesign(ctx context.Context, in *DeleteSchemaDesignRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, SchemaDesignService_DeleteSchemaDesign_FullMethodName, in, out, opts...)
@@ -99,6 +110,7 @@ type SchemaDesignServiceServer interface {
ListSchemaDesigns(context.Context, *ListSchemaDesignsRequest) (*ListSchemaDesignsResponse, error)
CreateSchemaDesign(context.Context, *CreateSchemaDesignRequest) (*SchemaDesign, error)
UpdateSchemaDesign(context.Context, *UpdateSchemaDesignRequest) (*SchemaDesign, error)
+ ParseSchemaString(context.Context, *ParseSchemaStringRequest) (*ParseSchemaStringResponse, error)
DeleteSchemaDesign(context.Context, *DeleteSchemaDesignRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedSchemaDesignServiceServer()
}
@@ -119,6 +131,9 @@ func (UnimplementedSchemaDesignServiceServer) CreateSchemaDesign(context.Context
func (UnimplementedSchemaDesignServiceServer) UpdateSchemaDesign(context.Context, *UpdateSchemaDesignRequest) (*SchemaDesign, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateSchemaDesign not implemented")
}
+func (UnimplementedSchemaDesignServiceServer) ParseSchemaString(context.Context, *ParseSchemaStringRequest) (*ParseSchemaStringResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ParseSchemaString not implemented")
+}
func (UnimplementedSchemaDesignServiceServer) DeleteSchemaDesign(context.Context, *DeleteSchemaDesignRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteSchemaDesign not implemented")
}
@@ -207,6 +222,24 @@ func _SchemaDesignService_UpdateSchemaDesign_Handler(srv interface{}, ctx contex
return interceptor(ctx, in, info, handler)
}
+func _SchemaDesignService_ParseSchemaString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ParseSchemaStringRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SchemaDesignServiceServer).ParseSchemaString(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SchemaDesignService_ParseSchemaString_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SchemaDesignServiceServer).ParseSchemaString(ctx, req.(*ParseSchemaStringRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _SchemaDesignService_DeleteSchemaDesign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteSchemaDesignRequest)
if err := dec(in); err != nil {
@@ -248,6 +281,10 @@ var SchemaDesignService_ServiceDesc = grpc.ServiceDesc{
MethodName: "UpdateSchemaDesign",
Handler: _SchemaDesignService_UpdateSchemaDesign_Handler,
},
+ {
+ MethodName: "ParseSchemaString",
+ Handler: _SchemaDesignService_ParseSchemaString_Handler,
+ },
{
MethodName: "DeleteSchemaDesign",
Handler: _SchemaDesignService_DeleteSchemaDesign_Handler,
diff --git a/proto/v1/schema_design_service.proto b/proto/v1/schema_design_service.proto
index ad4325e563..14f314ef67 100644
--- a/proto/v1/schema_design_service.proto
+++ b/proto/v1/schema_design_service.proto
@@ -40,6 +40,13 @@ service SchemaDesignService {
option (google.api.method_signature) = "schemaDesign,update_mask";
}
+ rpc ParseSchemaString(ParseSchemaStringRequest) returns (ParseSchemaStringResponse) {
+ option (google.api.http) = {
+ post: "/v1/schemaDesign:parseSchemaString"
+ body: "*"
+ };
+ }
+
rpc DeleteSchemaDesign(DeleteSchemaDesignRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/v1/{name=projects/*/schemaDesigns/*}"};
option (google.api.method_signature) = "name";
@@ -153,6 +160,17 @@ message UpdateSchemaDesignRequest {
google.protobuf.FieldMask update_mask = 2;
}
+message ParseSchemaStringRequest {
+ string schema_string = 1 [(google.api.field_behavior) = REQUIRED];
+
+ Engine engine = 2;
+}
+
+message ParseSchemaStringResponse {
+ // The metadata of the parsed schema.
+ DatabaseMetadata schema_metadata = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
+}
+
message DeleteSchemaDesignRequest {
// The name of the schema design to delete.
// Format: projects/{project}/schemaDesigns/{schemaDesign}