Skip to content

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

chore: add pageToken message for internal pagination use (#6272)

p0ny0ada46941151
diff --git a/frontend/src/types/proto/store/common.ts b/frontend/src/types/proto/store/common.ts
new file mode 100644
index 0000000000..54e4371d9c
--- /dev/null
+++ b/frontend/src/types/proto/store/common.ts
@@ -0,0 +1,92 @@
+/* eslint-disable */
+import * as _m0 from "protobufjs/minimal";
+
+export const protobufPackage = "bytebase.store";
+
+/** Used internally for obfuscating the page token. */
+export interface PageToken {
+ limit: number;
+ offset: number;
+}
+
+function createBasePageToken(): PageToken {
+ return { limit: 0, offset: 0 };
+}
+
+export const PageToken = {
+ encode(message: PageToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.limit !== 0) {
+ writer.uint32(8).int32(message.limit);
+ }
+ if (message.offset !== 0) {
+ writer.uint32(16).int32(message.offset);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): PageToken {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBasePageToken();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.limit = reader.int32();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.offset = reader.int32();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): PageToken {
+ return {
+ limit: isSet(object.limit) ? Number(object.limit) : 0,
+ offset: isSet(object.offset) ? Number(object.offset) : 0,
+ };
+ },
+
+ toJSON(message: PageToken): unknown {
+ const obj: any = {};
+ message.limit !== undefined && (obj.limit = Math.round(message.limit));
+ message.offset !== undefined && (obj.offset = Math.round(message.offset));
+ return obj;
+ },
+
+ create(base?: DeepPartial<PageToken>): PageToken {
+ return PageToken.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<PageToken>): PageToken {
+ const message = createBasePageToken();
+ message.limit = object.limit ?? 0;
+ message.offset = object.offset ?? 0;
+ return message;
+ },
+};
+
+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 isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index aa382071a1..cce8860849 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -27,6 +27,9 @@
- [ApprovalStep.Type](#bytebase-store-ApprovalStep-Type)
- [IssuePayloadApproval.Approver.Status](#bytebase-store-IssuePayloadApproval-Approver-Status)
+- [store/common.proto](#store_common-proto)
+ - [PageToken](#bytebase-store-PageToken)
+
- [store/data_source.proto](#store_data_source-proto)
- [DataSourceOptions](#bytebase-store-DataSourceOptions)
@@ -418,6 +421,38 @@ ANY means approving any node will proceed.
+<a name="store_common-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/common.proto
+
+
+
+<a name="bytebase-store-PageToken"></a>
+
+### PageToken
+Used internally for obfuscating the page token.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| limit | [int32](#int32) | | |
+| offset | [int32](#int32) | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<a name="store_data_source-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/generated-go/store/common.pb.go b/proto/generated-go/store/common.pb.go
new file mode 100644
index 0000000000..2a59166f4b
--- /dev/null
+++ b/proto/generated-go/store/common.pb.go
@@ -0,0 +1,153 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.30.0
+// protoc (unknown)
+// source: store/common.proto
+
+package store
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Used internally for obfuscating the page token.
+type PageToken struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
+ Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
+}
+
+func (x *PageToken) Reset() {
+ *x = PageToken{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_common_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *PageToken) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PageToken) ProtoMessage() {}
+
+func (x *PageToken) ProtoReflect() protoreflect.Message {
+ mi := &file_store_common_proto_msgTypes[0]
+ 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 PageToken.ProtoReflect.Descriptor instead.
+func (*PageToken) Descriptor() ([]byte, []int) {
+ return file_store_common_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *PageToken) GetLimit() int32 {
+ if x != nil {
+ return x.Limit
+ }
+ return 0
+}
+
+func (x *PageToken) GetOffset() int32 {
+ if x != nil {
+ return x.Offset
+ }
+ return 0
+}
+
+var File_store_common_proto protoreflect.FileDescriptor
+
+var file_store_common_proto_rawDesc = []byte{
+ 0x0a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 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,
+}
+
+var (
+ file_store_common_proto_rawDescOnce sync.Once
+ file_store_common_proto_rawDescData = file_store_common_proto_rawDesc
+)
+
+func file_store_common_proto_rawDescGZIP() []byte {
+ file_store_common_proto_rawDescOnce.Do(func() {
+ file_store_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_common_proto_rawDescData)
+ })
+ return file_store_common_proto_rawDescData
+}
+
+var file_store_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_store_common_proto_goTypes = []interface{}{
+ (*PageToken)(nil), // 0: bytebase.store.PageToken
+}
+var file_store_common_proto_depIdxs = []int32{
+ 0, // [0:0] is the sub-list for method output_type
+ 0, // [0:0] is the sub-list for method input_type
+ 0, // [0:0] is the sub-list for extension type_name
+ 0, // [0:0] is the sub-list for extension extendee
+ 0, // [0:0] is the sub-list for field type_name
+}
+
+func init() { file_store_common_proto_init() }
+func file_store_common_proto_init() {
+ if File_store_common_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_store_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*PageToken); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_store_common_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 1,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_store_common_proto_goTypes,
+ DependencyIndexes: file_store_common_proto_depIdxs,
+ MessageInfos: file_store_common_proto_msgTypes,
+ }.Build()
+ File_store_common_proto = out.File
+ file_store_common_proto_rawDesc = nil
+ file_store_common_proto_goTypes = nil
+ file_store_common_proto_depIdxs = nil
+}
diff --git a/proto/store/common.proto b/proto/store/common.proto
new file mode 100644
index 0000000000..90fc24256e
--- /dev/null
+++ b/proto/store/common.proto
@@ -0,0 +1,11 @@
+syntax = "proto3";
+
+package bytebase.store;
+
+option go_package = "generated-go/store";
+
+// Used internally for obfuscating the page token.
+message PageToken {
+ int32 limit = 1;
+ int32 offset = 2;
+}