Skip to content

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

chore: move engine to schema design sheet payload (#7030)

boojack660e4efb516c
diff --git a/backend/api/v1/schema_design_service.go b/backend/api/v1/schema_design_service.go
index 129565225a..07336fa783 100644
--- a/backend/api/v1/schema_design_service.go
+++ b/backend/api/v1/schema_design_service.go
@@ -150,6 +150,7 @@ func (s *SchemaDesignService) CreateSchemaDesign(ctx context.Context, request *v
Type: storepb.SheetPayload_SCHEMA_DESIGN,
SchemaDesign: &storepb.SheetPayload_SchemaDesign{
BaselineSheetId: int64(*changeHistory.SheetID),
+ Engine: storepb.Engine(schemaDesign.Engine),
},
}
payloadBytes, err := protojson.Marshal(schemaDesignSheetPayload)
@@ -297,15 +298,6 @@ func (s *SchemaDesignService) convertSheetToSchemaDesign(ctx context.Context, sh
if database == nil {
return nil, status.Errorf(codes.NotFound, fmt.Sprintf("cannot find the database: %d", sheet.DatabaseUID))
}
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &database.InstanceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get instance: %v", err))
- }
- if instance == nil {
- return nil, status.Errorf(codes.NotFound, fmt.Sprintf("cannot find the instance: %s", database.InstanceID))
- }
creator, err := s.store.GetUserByID(ctx, sheet.CreatorID)
if err != nil {
@@ -361,7 +353,7 @@ func (s *SchemaDesignService) convertSheetToSchemaDesign(ctx context.Context, sh
SchemaMetadata: schemaMetadata,
BaselineSchema: baselineSchema,
BaselineSchemaMetadata: baselineSchemaMetadata,
- Engine: convertToEngine(instance.Engine),
+ Engine: v1pb.Engine(sheetPayload.SchemaDesign.Engine),
BaselineDatabase: fmt.Sprintf("%s%s/%s%s", instanceNamePrefix, database.InstanceID, databaseIDPrefix, database.DatabaseName),
SchemaVersion: schemaVersion,
Creator: fmt.Sprintf("users/%s", creator.Email),
diff --git a/frontend/src/types/proto/store/common.ts b/frontend/src/types/proto/store/common.ts
index 54e4371d9c..598dac47bc 100644
--- a/frontend/src/types/proto/store/common.ts
+++ b/frontend/src/types/proto/store/common.ts
@@ -3,6 +3,117 @@ import * as _m0 from "protobufjs/minimal";
export const protobufPackage = "bytebase.store";
+export enum Engine {
+ ENGINE_UNSPECIFIED = 0,
+ CLICKHOUSE = 1,
+ MYSQL = 2,
+ POSTGRES = 3,
+ SNOWFLAKE = 4,
+ SQLITE = 5,
+ TIDB = 6,
+ MONGODB = 7,
+ REDIS = 8,
+ ORACLE = 9,
+ SPANNER = 10,
+ MSSQL = 11,
+ REDSHIFT = 12,
+ MARIADB = 13,
+ OCEANBASE = 14,
+ UNRECOGNIZED = -1,
+}
+
+export function engineFromJSON(object: any): Engine {
+ switch (object) {
+ case 0:
+ case "ENGINE_UNSPECIFIED":
+ return Engine.ENGINE_UNSPECIFIED;
+ case 1:
+ case "CLICKHOUSE":
+ return Engine.CLICKHOUSE;
+ case 2:
+ case "MYSQL":
+ return Engine.MYSQL;
+ case 3:
+ case "POSTGRES":
+ return Engine.POSTGRES;
+ case 4:
+ case "SNOWFLAKE":
+ return Engine.SNOWFLAKE;
+ case 5:
+ case "SQLITE":
+ return Engine.SQLITE;
+ case 6:
+ case "TIDB":
+ return Engine.TIDB;
+ case 7:
+ case "MONGODB":
+ return Engine.MONGODB;
+ case 8:
+ case "REDIS":
+ return Engine.REDIS;
+ case 9:
+ case "ORACLE":
+ return Engine.ORACLE;
+ case 10:
+ case "SPANNER":
+ return Engine.SPANNER;
+ case 11:
+ case "MSSQL":
+ return Engine.MSSQL;
+ case 12:
+ case "REDSHIFT":
+ return Engine.REDSHIFT;
+ case 13:
+ case "MARIADB":
+ return Engine.MARIADB;
+ case 14:
+ case "OCEANBASE":
+ return Engine.OCEANBASE;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return Engine.UNRECOGNIZED;
+ }
+}
+
+export function engineToJSON(object: Engine): string {
+ switch (object) {
+ case Engine.ENGINE_UNSPECIFIED:
+ return "ENGINE_UNSPECIFIED";
+ case Engine.CLICKHOUSE:
+ return "CLICKHOUSE";
+ case Engine.MYSQL:
+ return "MYSQL";
+ case Engine.POSTGRES:
+ return "POSTGRES";
+ case Engine.SNOWFLAKE:
+ return "SNOWFLAKE";
+ case Engine.SQLITE:
+ return "SQLITE";
+ case Engine.TIDB:
+ return "TIDB";
+ case Engine.MONGODB:
+ return "MONGODB";
+ case Engine.REDIS:
+ return "REDIS";
+ case Engine.ORACLE:
+ return "ORACLE";
+ case Engine.SPANNER:
+ return "SPANNER";
+ case Engine.MSSQL:
+ return "MSSQL";
+ case Engine.REDSHIFT:
+ return "REDSHIFT";
+ case Engine.MARIADB:
+ return "MARIADB";
+ case Engine.OCEANBASE:
+ return "OCEANBASE";
+ case Engine.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
/** Used internally for obfuscating the page token. */
export interface PageToken {
limit: number;
diff --git a/frontend/src/types/proto/store/sheet.ts b/frontend/src/types/proto/store/sheet.ts
index 5e97aaa0d1..bdd19563b9 100644
--- a/frontend/src/types/proto/store/sheet.ts
+++ b/frontend/src/types/proto/store/sheet.ts
@@ -1,6 +1,7 @@
/* eslint-disable */
import * as Long from "long";
import * as _m0 from "protobufjs/minimal";
+import { Engine, engineFromJSON, engineToJSON } from "./common";
export const protobufPackage = "bytebase.store";
@@ -62,6 +63,7 @@ export interface SheetPayload_UsedByIssue {
export interface SheetPayload_SchemaDesign {
baselineSheetId: number;
+ engine: Engine;
}
function createBaseSheetPayload(): SheetPayload {
@@ -368,7 +370,7 @@ export const SheetPayload_UsedByIssue = {
};
function createBaseSheetPayload_SchemaDesign(): SheetPayload_SchemaDesign {
- return { baselineSheetId: 0 };
+ return { baselineSheetId: 0, engine: 0 };
}
export const SheetPayload_SchemaDesign = {
@@ -376,6 +378,9 @@ export const SheetPayload_SchemaDesign = {
if (message.baselineSheetId !== 0) {
writer.uint32(8).int64(message.baselineSheetId);
}
+ if (message.engine !== 0) {
+ writer.uint32(16).int32(message.engine);
+ }
return writer;
},
@@ -393,6 +398,13 @@ export const SheetPayload_SchemaDesign = {
message.baselineSheetId = longToNumber(reader.int64() as Long);
continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.engine = reader.int32() as any;
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -403,12 +415,16 @@ export const SheetPayload_SchemaDesign = {
},
fromJSON(object: any): SheetPayload_SchemaDesign {
- return { baselineSheetId: isSet(object.baselineSheetId) ? Number(object.baselineSheetId) : 0 };
+ return {
+ baselineSheetId: isSet(object.baselineSheetId) ? Number(object.baselineSheetId) : 0,
+ engine: isSet(object.engine) ? engineFromJSON(object.engine) : 0,
+ };
},
toJSON(message: SheetPayload_SchemaDesign): unknown {
const obj: any = {};
message.baselineSheetId !== undefined && (obj.baselineSheetId = Math.round(message.baselineSheetId));
+ message.engine !== undefined && (obj.engine = engineToJSON(message.engine));
return obj;
},
@@ -419,6 +435,7 @@ export const SheetPayload_SchemaDesign = {
fromPartial(object: DeepPartial<SheetPayload_SchemaDesign>): SheetPayload_SchemaDesign {
const message = createBaseSheetPayload_SchemaDesign();
message.baselineSheetId = object.baselineSheetId ?? 0;
+ message.engine = object.engine ?? 0;
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 594e762ac2..2ce9d53418 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -31,6 +31,8 @@
- [store/common.proto](#store_common-proto)
- [PageToken](#bytebase-store-PageToken)
+ - [Engine](#bytebase-store-Engine)
+
- [store/data_source.proto](#store_data_source-proto)
- [DataSourceOptions](#bytebase-store-DataSourceOptions)
@@ -493,6 +495,31 @@ Used internally for obfuscating the page token.
+
+<a name="bytebase-store-Engine"></a>
+
+### Engine
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| ENGINE_UNSPECIFIED | 0 | |
+| CLICKHOUSE | 1 | |
+| MYSQL | 2 | |
+| POSTGRES | 3 | |
+| SNOWFLAKE | 4 | |
+| SQLITE | 5 | |
+| TIDB | 6 | |
+| MONGODB | 7 | |
+| REDIS | 8 | |
+| ORACLE | 9 | |
+| SPANNER | 10 | |
+| MSSQL | 11 | |
+| REDSHIFT | 12 | |
+| MARIADB | 13 | |
+| OCEANBASE | 14 | |
+
+
@@ -1677,6 +1704,7 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| baseline_sheet_id | [int64](#int64) | | |
+| engine | [Engine](#bytebase-store-Engine) | | |
diff --git a/proto/generated-go/store/common.pb.go b/proto/generated-go/store/common.pb.go
index 636d0798f2..020775d46c 100644
--- a/proto/generated-go/store/common.pb.go
+++ b/proto/generated-go/store/common.pb.go
@@ -20,6 +20,91 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
+type Engine int32
+
+const (
+ Engine_ENGINE_UNSPECIFIED Engine = 0
+ Engine_CLICKHOUSE Engine = 1
+ Engine_MYSQL Engine = 2
+ Engine_POSTGRES Engine = 3
+ Engine_SNOWFLAKE Engine = 4
+ Engine_SQLITE Engine = 5
+ Engine_TIDB Engine = 6
+ Engine_MONGODB Engine = 7
+ Engine_REDIS Engine = 8
+ Engine_ORACLE Engine = 9
+ Engine_SPANNER Engine = 10
+ Engine_MSSQL Engine = 11
+ Engine_REDSHIFT Engine = 12
+ Engine_MARIADB Engine = 13
+ Engine_OCEANBASE Engine = 14
+)
+
+// Enum value maps for Engine.
+var (
+ Engine_name = map[int32]string{
+ 0: "ENGINE_UNSPECIFIED",
+ 1: "CLICKHOUSE",
+ 2: "MYSQL",
+ 3: "POSTGRES",
+ 4: "SNOWFLAKE",
+ 5: "SQLITE",
+ 6: "TIDB",
+ 7: "MONGODB",
+ 8: "REDIS",
+ 9: "ORACLE",
+ 10: "SPANNER",
+ 11: "MSSQL",
+ 12: "REDSHIFT",
+ 13: "MARIADB",
+ 14: "OCEANBASE",
+ }
+ Engine_value = map[string]int32{
+ "ENGINE_UNSPECIFIED": 0,
+ "CLICKHOUSE": 1,
+ "MYSQL": 2,
+ "POSTGRES": 3,
+ "SNOWFLAKE": 4,
+ "SQLITE": 5,
+ "TIDB": 6,
+ "MONGODB": 7,
+ "REDIS": 8,
+ "ORACLE": 9,
+ "SPANNER": 10,
+ "MSSQL": 11,
+ "REDSHIFT": 12,
+ "MARIADB": 13,
+ "OCEANBASE": 14,
+ }
+)
+
+func (x Engine) Enum() *Engine {
+ p := new(Engine)
+ *p = x
+ return p
+}
+
+func (x Engine) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Engine) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_common_proto_enumTypes[0].Descriptor()
+}
+
+func (Engine) Type() protoreflect.EnumType {
+ return &file_store_common_proto_enumTypes[0]
+}
+
+func (x Engine) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Engine.Descriptor instead.
+func (Engine) EnumDescriptor() ([]byte, []int) {
+ return file_store_common_proto_rawDescGZIP(), []int{0}
+}
+
// Used internally for obfuscating the page token.
type PageToken struct {
state protoimpl.MessageState
@@ -84,9 +169,23 @@ var file_store_common_proto_rawDesc = []byte{
0x74, 0x6f, 0x72, 0x65, 0x22, 0x39, 0x0a, 0x09, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65,
- 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x42,
- 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2a,
+ 0xd4, 0x01, 0x0a, 0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x4e,
+ 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
+ 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4c, 0x49, 0x43, 0x4b, 0x48, 0x4f, 0x55, 0x53, 0x45,
+ 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x10, 0x02, 0x12, 0x0c, 0x0a,
+ 0x08, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x53,
+ 0x4e, 0x4f, 0x57, 0x46, 0x4c, 0x41, 0x4b, 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x51,
+ 0x4c, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x44, 0x42, 0x10, 0x06,
+ 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x4f, 0x4e, 0x47, 0x4f, 0x44, 0x42, 0x10, 0x07, 0x12, 0x09, 0x0a,
+ 0x05, 0x52, 0x45, 0x44, 0x49, 0x53, 0x10, 0x08, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x52, 0x41, 0x43,
+ 0x4c, 0x45, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x50, 0x41, 0x4e, 0x4e, 0x45, 0x52, 0x10,
+ 0x0a, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x53, 0x53, 0x51, 0x4c, 0x10, 0x0b, 0x12, 0x0c, 0x0a, 0x08,
+ 0x52, 0x45, 0x44, 0x53, 0x48, 0x49, 0x46, 0x54, 0x10, 0x0c, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41,
+ 0x52, 0x49, 0x41, 0x44, 0x42, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x43, 0x45, 0x41, 0x4e,
+ 0x42, 0x41, 0x53, 0x45, 0x10, 0x0e, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -101,9 +200,11 @@ func file_store_common_proto_rawDescGZIP() []byte {
return file_store_common_proto_rawDescData
}
+var file_store_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_store_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_store_common_proto_goTypes = []interface{}{
- (*PageToken)(nil), // 0: bytebase.store.PageToken
+ (Engine)(0), // 0: bytebase.store.Engine
+ (*PageToken)(nil), // 1: bytebase.store.PageToken
}
var file_store_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
@@ -137,13 +238,14 @@ func file_store_common_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_common_proto_rawDesc,
- NumEnums: 0,
+ NumEnums: 1,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_store_common_proto_goTypes,
DependencyIndexes: file_store_common_proto_depIdxs,
+ EnumInfos: file_store_common_proto_enumTypes,
MessageInfos: file_store_common_proto_msgTypes,
}.Build()
File_store_common_proto = out.File
diff --git a/proto/generated-go/store/sheet.pb.go b/proto/generated-go/store/sheet.pb.go
index f573f1b41f..c1febaf3a1 100644
--- a/proto/generated-go/store/sheet.pb.go
+++ b/proto/generated-go/store/sheet.pb.go
@@ -286,7 +286,8 @@ type SheetPayload_SchemaDesign struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- BaselineSheetId int64 `protobuf:"varint,1,opt,name=baseline_sheet_id,json=baselineSheetId,proto3" json:"baseline_sheet_id,omitempty"`
+ BaselineSheetId int64 `protobuf:"varint,1,opt,name=baseline_sheet_id,json=baselineSheetId,proto3" json:"baseline_sheet_id,omitempty"`
+ Engine Engine `protobuf:"varint,2,opt,name=engine,proto3,enum=bytebase.store.Engine" json:"engine,omitempty"`
}
func (x *SheetPayload_SchemaDesign) Reset() {
@@ -328,56 +329,67 @@ func (x *SheetPayload_SchemaDesign) GetBaselineSheetId() int64 {
return 0
}
+func (x *SheetPayload_SchemaDesign) GetEngine() Engine {
+ if x != nil {
+ return x.Engine
+ }
+ return Engine_ENGINE_UNSPECIFIED
+}
+
var File_store_sheet_proto protoreflect.FileDescriptor
var file_store_sheet_proto_rawDesc = []byte{
0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x22, 0xa4, 0x05, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79,
- 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
- 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x76,
- 0x63, 0x73, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x56,
- 0x43, 0x53, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0a, 0x76, 0x63, 0x73, 0x50, 0x61,
- 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x4e, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x79,
- 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53,
- 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x55, 0x73, 0x65, 0x64,
- 0x42, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x64, 0x42, 0x79, 0x49,
- 0x73, 0x73, 0x75, 0x65, 0x73, 0x12, 0x4e, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f,
- 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68,
- 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44,
- 0x65, 0x73, 0x69, 0x67, 0x6e, 0x1a, 0xba, 0x01, 0x0a, 0x0a, 0x56, 0x43, 0x53, 0x50, 0x61, 0x79,
- 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d,
- 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x12,
- 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69,
- 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61,
- 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64,
- 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x73,
- 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63,
- 0x54, 0x73, 0x1a, 0x49, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x64, 0x42, 0x79, 0x49, 0x73, 0x73, 0x75,
- 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x03, 0x52, 0x07, 0x69, 0x73, 0x73, 0x75, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b,
- 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0x3a, 0x0a,
- 0x0c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x2a, 0x0a,
- 0x11, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f,
- 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69,
- 0x6e, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x49, 0x64, 0x22, 0x2f, 0x0a, 0x04, 0x54, 0x79, 0x70,
- 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
- 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45, 0x4d,
- 0x41, 0x5f, 0x44, 0x45, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65,
- 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x6f, 0x72, 0x65, 0x1a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+ 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x05, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65,
+ 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79,
+ 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
+ 0x48, 0x0a, 0x0b, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f,
+ 0x61, 0x64, 0x2e, 0x56, 0x43, 0x53, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0a, 0x76,
+ 0x63, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x4e, 0x0a, 0x0e, 0x75, 0x73, 0x65,
+ 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
+ 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e,
+ 0x55, 0x73, 0x65, 0x64, 0x42, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x73, 0x65,
+ 0x64, 0x42, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x73, 0x12, 0x4e, 0x0a, 0x0d, 0x73, 0x63, 0x68,
+ 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
+ 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x53,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x0c, 0x73, 0x63, 0x68,
+ 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x1a, 0xba, 0x01, 0x0a, 0x0a, 0x56, 0x43,
+ 0x53, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65,
+ 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c,
+ 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61,
+ 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61,
+ 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
+ 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x24,
+ 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64,
+ 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d,
+ 0x69, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x6e,
+ 0x63, 0x5f, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74,
+ 0x53, 0x79, 0x6e, 0x63, 0x54, 0x73, 0x1a, 0x49, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x64, 0x42, 0x79,
+ 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x69,
+ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x69, 0x73, 0x73, 0x75, 0x65, 0x49, 0x64,
+ 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x54, 0x69, 0x74, 0x6c,
+ 0x65, 0x1a, 0x6a, 0x0a, 0x0c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67,
+ 0x6e, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x62, 0x61,
+ 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x49, 0x64, 0x12, 0x2e, 0x0a,
+ 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x45,
+ 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x22, 0x2f, 0x0a,
+ 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e,
+ 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53,
+ 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x44, 0x45, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x42, 0x14,
+ 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -400,17 +412,19 @@ var file_store_sheet_proto_goTypes = []interface{}{
(*SheetPayload_VCSPayload)(nil), // 2: bytebase.store.SheetPayload.VCSPayload
(*SheetPayload_UsedByIssue)(nil), // 3: bytebase.store.SheetPayload.UsedByIssue
(*SheetPayload_SchemaDesign)(nil), // 4: bytebase.store.SheetPayload.SchemaDesign
+ (Engine)(0), // 5: bytebase.store.Engine
}
var file_store_sheet_proto_depIdxs = []int32{
0, // 0: bytebase.store.SheetPayload.type:type_name -> bytebase.store.SheetPayload.Type
2, // 1: bytebase.store.SheetPayload.vcs_payload:type_name -> bytebase.store.SheetPayload.VCSPayload
3, // 2: bytebase.store.SheetPayload.used_by_issues:type_name -> bytebase.store.SheetPayload.UsedByIssue
4, // 3: bytebase.store.SheetPayload.schema_design:type_name -> bytebase.store.SheetPayload.SchemaDesign
- 4, // [4:4] is the sub-list for method output_type
- 4, // [4:4] is the sub-list for method input_type
- 4, // [4:4] is the sub-list for extension type_name
- 4, // [4:4] is the sub-list for extension extendee
- 0, // [0:4] is the sub-list for field type_name
+ 5, // 4: bytebase.store.SheetPayload.SchemaDesign.engine:type_name -> bytebase.store.Engine
+ 5, // [5:5] is the sub-list for method output_type
+ 5, // [5:5] is the sub-list for method input_type
+ 5, // [5:5] is the sub-list for extension type_name
+ 5, // [5:5] is the sub-list for extension extendee
+ 0, // [0:5] is the sub-list for field type_name
}
func init() { file_store_sheet_proto_init() }
@@ -418,6 +432,7 @@ func file_store_sheet_proto_init() {
if File_store_sheet_proto != nil {
return
}
+ file_store_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_store_sheet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SheetPayload); i {
diff --git a/proto/store/common.proto b/proto/store/common.proto
index 90fc24256e..59455f1983 100644
--- a/proto/store/common.proto
+++ b/proto/store/common.proto
@@ -9,3 +9,21 @@ message PageToken {
int32 limit = 1;
int32 offset = 2;
}
+
+enum Engine {
+ ENGINE_UNSPECIFIED = 0;
+ CLICKHOUSE = 1;
+ MYSQL = 2;
+ POSTGRES = 3;
+ SNOWFLAKE = 4;
+ SQLITE = 5;
+ TIDB = 6;
+ MONGODB = 7;
+ REDIS = 8;
+ ORACLE = 9;
+ SPANNER = 10;
+ MSSQL = 11;
+ REDSHIFT = 12;
+ MARIADB = 13;
+ OCEANBASE = 14;
+}
diff --git a/proto/store/sheet.proto b/proto/store/sheet.proto
index f09f5a12bf..89241465be 100644
--- a/proto/store/sheet.proto
+++ b/proto/store/sheet.proto
@@ -2,6 +2,8 @@ syntax = "proto3";
package bytebase.store;
+import "store/common.proto";
+
option go_package = "generated-go/store";
message SheetPayload {
@@ -31,6 +33,7 @@ message SheetPayload {
message SchemaDesign {
int64 baseline_sheet_id = 1;
+ Engine engine = 2;
}
SchemaDesign schema_design = 4;
}