Skip to content

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

15.0 KB
Raw Blame
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.12
// 	protoc        (unknown)
// source: store/plan.proto

package store

import (
	_ "google.golang.org/genproto/googleapis/api/annotations"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

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)
)

type PlanConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	Specs []*PlanConfig_Spec     `protobuf:"bytes,1,rep,name=specs,proto3" json:"specs,omitempty"`
	// Whether the plan has started the rollout.
	HasRollout bool `protobuf:"varint,2,opt,name=has_rollout,json=hasRollout,proto3" json:"has_rollout,omitempty"`
	// Internal monotonic version for plan inputs that affect approval generation.
	// Starts at the proto default 0 for compatibility with existing plans.
	ApprovalInputVersion int64 `protobuf:"varint,3,opt,name=approval_input_version,json=approvalInputVersion,proto3" json:"approval_input_version,omitempty"`
	unknownFields        protoimpl.UnknownFields
	sizeCache            protoimpl.SizeCache
}

func (x *PlanConfig) Reset() {
	*x = PlanConfig{}
	mi := &file_store_plan_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *PlanConfig) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PlanConfig) ProtoMessage() {}

func (x *PlanConfig) ProtoReflect() protoreflect.Message {
	mi := &file_store_plan_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PlanConfig.ProtoReflect.Descriptor instead.
func (*PlanConfig) Descriptor() ([]byte, []int) {
	return file_store_plan_proto_rawDescGZIP(), []int{0}
}

func (x *PlanConfig) GetSpecs() []*PlanConfig_Spec {
	if x != nil {
		return x.Specs
	}
	return nil
}

func (x *PlanConfig) GetHasRollout() bool {
	if x != nil {
		return x.HasRollout
	}
	return false
}

func (x *PlanConfig) GetApprovalInputVersion() int64 {
	if x != nil {
		return x.ApprovalInputVersion
	}
	return 0
}

type PlanConfig_Spec struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// A UUID4 string that uniquely identifies the Spec.
	Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are valid to be assigned to Config:
	//
	//	*PlanConfig_Spec_CreateDatabaseConfig
	//	*PlanConfig_Spec_ChangeDatabaseConfig
	Config        isPlanConfig_Spec_Config `protobuf_oneof:"config"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *PlanConfig_Spec) Reset() {
	*x = PlanConfig_Spec{}
	mi := &file_store_plan_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *PlanConfig_Spec) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PlanConfig_Spec) ProtoMessage() {}

func (x *PlanConfig_Spec) ProtoReflect() protoreflect.Message {
	mi := &file_store_plan_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PlanConfig_Spec.ProtoReflect.Descriptor instead.
func (*PlanConfig_Spec) Descriptor() ([]byte, []int) {
	return file_store_plan_proto_rawDescGZIP(), []int{0, 0}
}

func (x *PlanConfig_Spec) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *PlanConfig_Spec) GetConfig() isPlanConfig_Spec_Config {
	if x != nil {
		return x.Config
	}
	return nil
}

func (x *PlanConfig_Spec) GetCreateDatabaseConfig() *PlanConfig_CreateDatabaseConfig {
	if x != nil {
		if x, ok := x.Config.(*PlanConfig_Spec_CreateDatabaseConfig); ok {
			return x.CreateDatabaseConfig
		}
	}
	return nil
}

func (x *PlanConfig_Spec) GetChangeDatabaseConfig() *PlanConfig_ChangeDatabaseConfig {
	if x != nil {
		if x, ok := x.Config.(*PlanConfig_Spec_ChangeDatabaseConfig); ok {
			return x.ChangeDatabaseConfig
		}
	}
	return nil
}

type isPlanConfig_Spec_Config interface {
	isPlanConfig_Spec_Config()
}

type PlanConfig_Spec_CreateDatabaseConfig struct {
	CreateDatabaseConfig *PlanConfig_CreateDatabaseConfig `protobuf:"bytes,1,opt,name=create_database_config,json=createDatabaseConfig,proto3,oneof"`
}

type PlanConfig_Spec_ChangeDatabaseConfig struct {
	ChangeDatabaseConfig *PlanConfig_ChangeDatabaseConfig `protobuf:"bytes,2,opt,name=change_database_config,json=changeDatabaseConfig,proto3,oneof"`
}

func (*PlanConfig_Spec_CreateDatabaseConfig) isPlanConfig_Spec_Config() {}

func (*PlanConfig_Spec_ChangeDatabaseConfig) isPlanConfig_Spec_Config() {}

type PlanConfig_CreateDatabaseConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The resource name of the instance on which the database is created.
	// Format: instances/{instance}
	Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
	// The name of the database to create.
	Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"`
	// table is the name of the table, if it is not empty, Bytebase should create a table after creating the database.
	// For example, in MongoDB, it only creates the database when we first store data in that database.
	Table string `protobuf:"bytes,3,opt,name=table,proto3" json:"table,omitempty"`
	// character_set is the character set of the database.
	CharacterSet string `protobuf:"bytes,4,opt,name=character_set,json=characterSet,proto3" json:"character_set,omitempty"`
	// collation is the collation of the database.
	Collation string `protobuf:"bytes,5,opt,name=collation,proto3" json:"collation,omitempty"`
	// cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>".
	Cluster string `protobuf:"bytes,6,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>".
	Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"`
	// The environment resource.
	// Format: environments/prod where prod is the environment resource ID.
	Environment   string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *PlanConfig_CreateDatabaseConfig) Reset() {
	*x = PlanConfig_CreateDatabaseConfig{}
	mi := &file_store_plan_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *PlanConfig_CreateDatabaseConfig) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PlanConfig_CreateDatabaseConfig) ProtoMessage() {}

func (x *PlanConfig_CreateDatabaseConfig) ProtoReflect() protoreflect.Message {
	mi := &file_store_plan_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PlanConfig_CreateDatabaseConfig.ProtoReflect.Descriptor instead.
func (*PlanConfig_CreateDatabaseConfig) Descriptor() ([]byte, []int) {
	return file_store_plan_proto_rawDescGZIP(), []int{0, 1}
}

func (x *PlanConfig_CreateDatabaseConfig) GetTarget() string {
	if x != nil {
		return x.Target
	}
	return ""
}

func (x *PlanConfig_CreateDatabaseConfig) GetDatabase() string {
	if x != nil {
		return x.Database
	}
	return ""
}

func (x *PlanConfig_CreateDatabaseConfig) GetTable() string {
	if x != nil {
		return x.Table
	}
	return ""
}

func (x *PlanConfig_CreateDatabaseConfig) GetCharacterSet() string {
	if x != nil {
		return x.CharacterSet
	}
	return ""
}

func (x *PlanConfig_CreateDatabaseConfig) GetCollation() string {
	if x != nil {
		return x.Collation
	}
	return ""
}

func (x *PlanConfig_CreateDatabaseConfig) GetCluster() string {
	if x != nil {
		return x.Cluster
	}
	return ""
}

func (x *PlanConfig_CreateDatabaseConfig) GetOwner() string {
	if x != nil {
		return x.Owner
	}
	return ""
}

func (x *PlanConfig_CreateDatabaseConfig) GetEnvironment() string {
	if x != nil {
		return x.Environment
	}
	return ""
}

type PlanConfig_ChangeDatabaseConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The list of targets.
	// Multi-database format: [instances/{instance-id}/databases/{database-name}].
	// Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
	Targets []string `protobuf:"bytes,10,rep,name=targets,proto3" json:"targets,omitempty"`
	// The SHA256 hash of the sheet content (hex-encoded).
	SheetSha256 string `protobuf:"bytes,2,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`
	// The resource name of the release.
	// Format: projects/{project}/releases/{release}
	Release string `protobuf:"bytes,9,opt,name=release,proto3" json:"release,omitempty"`
	// If set, a backup of the modified data will be created automatically before any changes are applied.
	EnablePriorBackup bool `protobuf:"varint,8,opt,name=enable_prior_backup,json=enablePriorBackup,proto3" json:"enable_prior_backup,omitempty"`
	unknownFields     protoimpl.UnknownFields
	sizeCache         protoimpl.SizeCache
}

func (x *PlanConfig_ChangeDatabaseConfig) Reset() {
	*x = PlanConfig_ChangeDatabaseConfig{}
	mi := &file_store_plan_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *PlanConfig_ChangeDatabaseConfig) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PlanConfig_ChangeDatabaseConfig) ProtoMessage() {}

func (x *PlanConfig_ChangeDatabaseConfig) ProtoReflect() protoreflect.Message {
	mi := &file_store_plan_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PlanConfig_ChangeDatabaseConfig.ProtoReflect.Descriptor instead.
func (*PlanConfig_ChangeDatabaseConfig) Descriptor() ([]byte, []int) {
	return file_store_plan_proto_rawDescGZIP(), []int{0, 2}
}

func (x *PlanConfig_ChangeDatabaseConfig) GetTargets() []string {
	if x != nil {
		return x.Targets
	}
	return nil
}

func (x *PlanConfig_ChangeDatabaseConfig) GetSheetSha256() string {
	if x != nil {
		return x.SheetSha256
	}
	return ""
}

func (x *PlanConfig_ChangeDatabaseConfig) GetRelease() string {
	if x != nil {
		return x.Release
	}
	return ""
}

func (x *PlanConfig_ChangeDatabaseConfig) GetEnablePriorBackup() bool {
	if x != nil {
		return x.EnablePriorBackup
	}
	return false
}

var File_store_plan_proto protoreflect.FileDescriptor

const file_store_plan_proto_rawDesc = "" +
	"\n" +
	"\x10store/plan.proto\x12\x0ebytebase.store\x1a\x1fgoogle/api/field_behavior.proto\"\xe7\x06\n" +
	"\n" +
	"PlanConfig\x125\n" +
	"\x05specs\x18\x01 \x03(\v2\x1f.bytebase.store.PlanConfig.SpecR\x05specs\x12\x1f\n" +
	"\vhas_rollout\x18\x02 \x01(\bR\n" +
	"hasRollout\x124\n" +
	"\x16approval_input_version\x18\x03 \x01(\x03R\x14approvalInputVersion\x1a\xf8\x01\n" +
	"\x04Spec\x12\x0e\n" +
	"\x02id\x18\x05 \x01(\tR\x02id\x12g\n" +
	"\x16create_database_config\x18\x01 \x01(\v2/.bytebase.store.PlanConfig.CreateDatabaseConfigH\x00R\x14createDatabaseConfig\x12g\n" +
	"\x16change_database_config\x18\x02 \x01(\v2/.bytebase.store.PlanConfig.ChangeDatabaseConfigH\x00R\x14changeDatabaseConfigB\b\n" +
	"\x06configJ\x04\b\x03\x10\x05\x1a\xa3\x02\n" +
	"\x14CreateDatabaseConfig\x12\x1b\n" +
	"\x06target\x18\x01 \x01(\tB\x03\xe0A\x02R\x06target\x12\x1f\n" +
	"\bdatabase\x18\x02 \x01(\tB\x03\xe0A\x02R\bdatabase\x12\x19\n" +
	"\x05table\x18\x03 \x01(\tB\x03\xe0A\x01R\x05table\x12(\n" +
	"\rcharacter_set\x18\x04 \x01(\tB\x03\xe0A\x01R\fcharacterSet\x12!\n" +
	"\tcollation\x18\x05 \x01(\tB\x03\xe0A\x01R\tcollation\x12\x1d\n" +
	"\acluster\x18\x06 \x01(\tB\x03\xe0A\x01R\acluster\x12\x19\n" +
	"\x05owner\x18\a \x01(\tB\x03\xe0A\x01R\x05owner\x12%\n" +
	"\venvironment\x18\t \x01(\tB\x03\xe0A\x01R\venvironmentJ\x04\b\b\x10\t\x1a\xa9\x01\n" +
	"\x14ChangeDatabaseConfig\x12\x18\n" +
	"\atargets\x18\n" +
	" \x03(\tR\atargets\x12!\n" +
	"\fsheet_sha256\x18\x02 \x01(\tR\vsheetSha256\x12\x18\n" +
	"\arelease\x18\t \x01(\tR\arelease\x12.\n" +
	"\x13enable_prior_backup\x18\b \x01(\bR\x11enablePriorBackupJ\x04\b\x01\x10\x02J\x04\b\x03\x10\bB\x8c\x01\n" +
	"\x12com.bytebase.storeB\tPlanProtoP\x01Z\x12generated-go/store\xa2\x02\x03BSX\xaa\x02\x0eBytebase.Store\xca\x02\x0eBytebase\\Store\xe2\x02\x1aBytebase\\Store\\GPBMetadata\xea\x02\x0fBytebase::Storeb\x06proto3"

var (
	file_store_plan_proto_rawDescOnce sync.Once
	file_store_plan_proto_rawDescData []byte
)

func file_store_plan_proto_rawDescGZIP() []byte {
	file_store_plan_proto_rawDescOnce.Do(func() {
		file_store_plan_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_store_plan_proto_rawDesc), len(file_store_plan_proto_rawDesc)))
	})
	return file_store_plan_proto_rawDescData
}

var file_store_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_store_plan_proto_goTypes = []any{
	(*PlanConfig)(nil),                      // 0: bytebase.store.PlanConfig
	(*PlanConfig_Spec)(nil),                 // 1: bytebase.store.PlanConfig.Spec
	(*PlanConfig_CreateDatabaseConfig)(nil), // 2: bytebase.store.PlanConfig.CreateDatabaseConfig
	(*PlanConfig_ChangeDatabaseConfig)(nil), // 3: bytebase.store.PlanConfig.ChangeDatabaseConfig
}
var file_store_plan_proto_depIdxs = []int32{
	1, // 0: bytebase.store.PlanConfig.specs:type_name -> bytebase.store.PlanConfig.Spec
	2, // 1: bytebase.store.PlanConfig.Spec.create_database_config:type_name -> bytebase.store.PlanConfig.CreateDatabaseConfig
	3, // 2: bytebase.store.PlanConfig.Spec.change_database_config:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig
	3, // [3:3] is the sub-list for method output_type
	3, // [3:3] is the sub-list for method input_type
	3, // [3:3] is the sub-list for extension type_name
	3, // [3:3] is the sub-list for extension extendee
	0, // [0:3] is the sub-list for field type_name
}

func init() { file_store_plan_proto_init() }
func file_store_plan_proto_init() {
	if File_store_plan_proto != nil {
		return
	}
	file_store_plan_proto_msgTypes[1].OneofWrappers = []any{
		(*PlanConfig_Spec_CreateDatabaseConfig)(nil),
		(*PlanConfig_Spec_ChangeDatabaseConfig)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_plan_proto_rawDesc), len(file_store_plan_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_store_plan_proto_goTypes,
		DependencyIndexes: file_store_plan_proto_depIdxs,
		MessageInfos:      file_store_plan_proto_msgTypes,
	}.Build()
	File_store_plan_proto = out.File
	file_store_plan_proto_goTypes = nil
	file_store_plan_proto_depIdxs = nil
}