Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: move triggers into the table metadata (#14757)
rebelice73ce8a198114
diff --git a/backend/api/v1/database_converter.go b/backend/api/v1/database_converter.goindex dfda1e8677..e06b2dc156 100644--- a/backend/api/v1/database_converter.go+++ b/backend/api/v1/database_converter.go@@ -153,23 +153,6 @@ func convertStoreDatabaseMetadata(metadata *storepb.DatabaseSchemaMetadata, filts.Streams = append(s.Streams, v1Stream)}- for _, trigger := range schema.Triggers {- if trigger == nil {- continue- }- v1Trigger := &v1pb.TriggerMetadata{- Name: trigger.Name,- TableName: trigger.TableName,- Event: trigger.Event,- Timing: trigger.Timing,- Body: trigger.Body,- SqlMode: trigger.SqlMode,- CharacterSetClient: trigger.CharacterSetClient,- CollationConnection: trigger.CollationConnection,- }- s.Triggers = append(s.Triggers, v1Trigger)- }-for _, sequence := range schema.Sequences {if sequence == nil {continue@@ -309,6 +292,22 @@ func convertStoreTableMetadata(table *storepb.TableMetadata) *v1pb.TableMetadataExpression: check.Expression,})}+ for _, trigger := range table.Triggers {+ if trigger == nil {+ continue+ }+ t.Triggers = append(t.Triggers, &v1pb.TriggerMetadata{+ Name: trigger.Name,+ Timing: trigger.Timing,+ Event: trigger.Event,+ Body: trigger.Body,+ SqlMode: trigger.SqlMode,+ CharacterSetClient: trigger.CharacterSetClient,+ CollationConnection: trigger.CollationConnection,+ ActionOrientation: trigger.ActionOrientation,+ Condition: trigger.Condition,+ })+ }return t}@@ -802,6 +801,22 @@ func convertV1TableMetadata(table *v1pb.TableMetadata) *storepb.TableMetadata {Expression: check.Expression,})}+ for _, trigger := range table.Triggers {+ if trigger == nil {+ continue+ }+ t.Triggers = append(t.Triggers, &storepb.TriggerMetadata{+ Name: trigger.Name,+ Timing: trigger.Timing,+ Event: trigger.Event,+ Body: trigger.Body,+ SqlMode: trigger.SqlMode,+ CharacterSetClient: trigger.CharacterSetClient,+ CollationConnection: trigger.CollationConnection,+ ActionOrientation: trigger.ActionOrientation,+ Condition: trigger.Condition,+ })+ }return t}diff --git a/backend/plugin/db/mysql/dump.go b/backend/plugin/db/mysql/dump.goindex e907c8126d..e4b9279072 100644--- a/backend/plugin/db/mysql/dump.go+++ b/backend/plugin/db/mysql/dump.go@@ -103,9 +103,11 @@ func (*Driver) Dump(_ context.Context, out io.Writer, dbSchema *storepb.Database}// Construct triggers.- for _, trigger := range schema.Triggers {- if err := writeTrigger(out, trigger); err != nil {- return err+ for _, table := range schema.Tables {+ for _, trigger := range table.Triggers {+ if err := writeTrigger(out, table.Name, trigger); err != nil {+ return err+ }}}@@ -204,7 +206,7 @@ func writeEvent(out io.Writer, event *storepb.EventMetadata) error {return err}-func writeTrigger(out io.Writer, trigger *storepb.TriggerMetadata) error {+func writeTrigger(out io.Writer, tableName string, trigger *storepb.TriggerMetadata) error {// Header.if _, err := io.WriteString(out, emptyCommentLine); err != nil {return err@@ -288,7 +290,7 @@ func writeTrigger(out io.Writer, trigger *storepb.TriggerMetadata) error {if _, err := io.WriteString(out, " ON `"); err != nil {return err}- if _, err := io.WriteString(out, trigger.TableName); err != nil {+ if _, err := io.WriteString(out, tableName); err != nil {return err}if _, err := io.WriteString(out, "` FOR EACH ROW\n"); err != nil {diff --git a/backend/plugin/db/mysql/sync.go b/backend/plugin/db/mysql/sync.goindex c28f76268d..385843e923 100644--- a/backend/plugin/db/mysql/sync.go+++ b/backend/plugin/db/mysql/sync.go@@ -470,11 +470,10 @@ func (driver *Driver) SyncDBSchema(ctx context.Context) (*storepb.DatabaseSchema}// Query triggers.- triggerList, err := driver.getTriggerList(ctx, driver.databaseName)+ triggerMap, err := driver.getTriggerList(ctx, driver.databaseName)if err != nil {return nil, err}- schemaMetadata.Triggers = triggerList// Query events.eventList, err := driver.getEventList(ctx, driver.databaseName)@@ -571,6 +570,7 @@ func (driver *Driver) SyncDBSchema(ctx context.Context) (*storepb.DatabaseSchemaPartitions: partitionTables[key],CheckConstraints: checkMap[key],Charset: charset,+ Triggers: triggerMap[key],}if tableCollation.Valid {tableMetadata.Collation = tableCollation.String@@ -721,7 +721,7 @@ func (driver *Driver) getCreateEventStmt(ctx context.Context, databaseName strinreturn "", nil}-func (driver *Driver) getTriggerList(ctx context.Context, databaseName string) ([]*storepb.TriggerMetadata, error) {+func (driver *Driver) getTriggerList(ctx context.Context, databaseName string) (map[db.TableKey][]*storepb.TriggerMetadata, error) {triggersQuery := `SELECTTRIGGER_NAME,@@ -741,7 +741,7 @@ func (driver *Driver) getTriggerList(ctx context.Context, databaseName string) (return nil, util.FormatErrorWithQuery(err, triggersQuery)}defer triggerRows.Close()- var triggers []*storepb.TriggerMetadata+ triggerMap := make(map[db.TableKey][]*storepb.TriggerMetadata)for triggerRows.Next() {var name, table, event, timing, statement, sqlMode, charsetClient, collationConnection stringif err := triggerRows.Scan(@@ -758,7 +758,6 @@ func (driver *Driver) getTriggerList(ctx context.Context, databaseName string) (}trigger := &storepb.TriggerMetadata{Name: name,- TableName: table,Event: event,Timing: timing,Body: statement,@@ -766,12 +765,13 @@ func (driver *Driver) getTriggerList(ctx context.Context, databaseName string) (CharacterSetClient: charsetClient,CollationConnection: collationConnection,}- triggers = append(triggers, trigger)+ tableKey := db.TableKey{Schema: "", Table: table}+ triggerMap[tableKey] = append(triggerMap[tableKey], trigger)}if err := triggerRows.Err(); err != nil {return nil, util.FormatErrorWithQuery(err, triggersQuery)}- return triggers, nil+ return triggerMap, nil}func (driver *Driver) syncRoutines(ctx context.Context, databaseName string) ([]*storepb.FunctionMetadata, []*storepb.ProcedureMetadata, error) {diff --git a/frontend/src/components/Database/DatabaseOverviewPanel.vue b/frontend/src/components/Database/DatabaseOverviewPanel.vueindex 8066818f09..9c5fe9ab36 100644--- a/frontend/src/components/Database/DatabaseOverviewPanel.vue+++ b/frontend/src/components/Database/DatabaseOverviewPanel.vue@@ -132,17 +132,6 @@/></template>- <template v-if="instanceV1SupportsTrigger(databaseEngine)">- <div class="mt-6 text-lg leading-6 font-medium text-main mb-4">- {{ $t("db.triggers") }}- </div>- <TriggerDataTable- :database="database"- :schema-name="state.selectedSchemaName"- :trigger-list="triggerList"- />- </template>-<template v-if="databaseEngine === Engine.SNOWFLAKE"><div class="mt-6 text-lg leading-6 font-medium text-main mb-4">{{ $t("db.streams") }}@@ -205,11 +194,9 @@ import {hasSchemaProperty,instanceV1SupportsPackage,instanceV1SupportsSequence,- instanceV1SupportsTrigger,} from "@/utils";import PackageDataTable from "../PackageDataTable.vue";import SequenceDataTable from "../SequenceDataTable.vue";-import TriggerDataTable from "../TriggerDataTable.vue";import { SearchBox } from "../v2";import DatabaseOverviewInfo from "./DatabaseOverviewInfo.vue";@@ -403,20 +390,6 @@ const sequenceList = computed(() => {.flat();});-const triggerList = computed(() => {- if (hasSchemaPropertyV1.value) {- return (- schemaList.value.find(- (schema) => schema.name === state.selectedSchemaName- )?.triggers || []- );- }- return dbSchemaStore- .getDatabaseMetadata(props.database.name)- .schemas.map((schema) => schema.triggers)- .flat();-});-watch([() => state.selectedSchemaName, route], ([schema, route]) => {if (route.name === SQL_EDITOR_SETTING_DATABASES_MODULE) {// Very weird, should not trigger thisdiff --git a/frontend/src/components/TableDetailDrawer.vue b/frontend/src/components/TableDetailDrawer.vueindex cb4053790c..fd763ef2ff 100644--- a/frontend/src/components/TableDetailDrawer.vue+++ b/frontend/src/components/TableDetailDrawer.vue@@ -229,6 +229,21 @@</div><IndexTable :database="database" :index-list="table.indexes" /></div>++ <div+ v-if="instanceV1SupportsTrigger(instanceEngine)"+ class="mt-6 px-6"+ >+ <div class="text-lg leading-6 font-medium text-main mb-4">+ {{ $t("db.triggers") }}+ </div>+ <TriggerDataTable+ :database="database"+ :schema-name="schemaName"+ :table-name="tableName"+ :trigger-list="table.triggers"+ />+ </div></main></div></DrawerContent>@@ -263,6 +278,7 @@ import {hasProjectPermissionV2,hasSchemaProperty,hasTableEngineProperty,+ instanceV1SupportsTrigger,isDatabaseV1Queryable,isGhostTable,} from "@/utils";@@ -270,6 +286,7 @@ import ColumnDataTable from "./ColumnDataTable/index.vue";import { SQLEditorButtonV1 } from "./DatabaseDetail";import IndexTable from "./IndexTable.vue";import PartitionTablesDataTable from "./PartitionTablesDataTable.vue";+import TriggerDataTable from "./TriggerDataTable.vue";import MaskSpinner from "./misc/MaskSpinner.vue";interface LocalState {diff --git a/frontend/src/components/TriggerDataTable.vue b/frontend/src/components/TriggerDataTable.vueindex ca6aaa51e7..ab0117d0fb 100644--- a/frontend/src/components/TriggerDataTable.vue+++ b/frontend/src/components/TriggerDataTable.vue@@ -28,6 +28,10 @@ defineProps({type: String,default: "",},+ tableName: {+ type: String,+ default: "",+ },triggerList: {required: true,type: Object as PropType<TriggerMetadata[]>,@@ -46,14 +50,6 @@ const columns = computed(() => {return trigger.name;},},- {- key: "table-name",- title: t("db.trigger.table-name"),- resizable: true,- render: (trigger) => {- return trigger.tableName;- },- },{key: "event",title: t("db.trigger.event"),diff --git a/frontend/src/types/proto/store/database.ts b/frontend/src/types/proto/store/database.tsindex 31ad6d334f..f2132a8c7f 100644--- a/frontend/src/types/proto/store/database.ts+++ b/frontend/src/types/proto/store/database.ts@@ -87,11 +87,6 @@ export interface SchemaMetadata {/** The packages is the list of packages in a schema. */packages: PackageMetadata[];owner: string;- /**- * The triggers is the list of triggers in a schema, triggers are sorted by- * table_name, event, timing, action_order.- */- triggers: TriggerMetadata[];events: EventMetadata[];enumTypes: EnumTypeMetadata[];}@@ -143,13 +138,6 @@ export interface SequenceMetadata {export interface TriggerMetadata {/** The name is the name of the trigger. */name: string;- /** The schema name of the table/view that the trigger is created. */- schemaName: string;- /**- * The table_name is the name of the table/view that the trigger is created- * on.- */- tableName: string;/*** The event is the event of the trigger, such as INSERT, UPDATE, DELETE,* TRUNCATE.@@ -415,6 +403,7 @@ export interface TableMetadata {* Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by*/sortingKeys: string[];+ triggers: TriggerMetadata[];}export interface CheckConstraintMetadata {@@ -1474,7 +1463,6 @@ function createBaseSchemaMetadata(): SchemaMetadata {sequences: [],packages: [],owner: "",- triggers: [],events: [],enumTypes: [],};@@ -1518,9 +1506,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {if (message.owner !== "") {writer.uint32(98).string(message.owner);}- for (const v of message.triggers) {- TriggerMetadata.encode(v!, writer.uint32(106).fork()).join();- }for (const v of message.events) {EventMetadata.encode(v!, writer.uint32(114).fork()).join();}@@ -1633,14 +1618,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {message.owner = reader.string();continue;}- case 13: {- if (tag !== 106) {- break;- }-- message.triggers.push(TriggerMetadata.decode(reader, reader.uint32()));- continue;- }case 14: {if (tag !== 114) {break;@@ -1694,12 +1671,7 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {? object.packages.map((e: any) => PackageMetadata.fromJSON(e)): [],owner: isSet(object.owner) ? globalThis.String(object.owner) : "",- triggers: globalThis.Array.isArray(object?.triggers)- ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))- : [],- events: globalThis.Array.isArray(object?.events)- ? object.events.map((e: any) => EventMetadata.fromJSON(e))- : [],+ events: globalThis.Array.isArray(object?.events) ? object.events.map((e: any) => EventMetadata.fromJSON(e)) : [],enumTypes: globalThis.Array.isArray(object?.enumTypes)? object.enumTypes.map((e: any) => EnumTypeMetadata.fromJSON(e)): [],@@ -1744,9 +1716,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {if (message.owner !== "") {obj.owner = message.owner;}- if (message.triggers?.length) {- obj.triggers = message.triggers.map((e) => TriggerMetadata.toJSON(e));- }if (message.events?.length) {obj.events = message.events.map((e) => EventMetadata.toJSON(e));}@@ -1773,7 +1742,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {message.sequences = object.sequences?.map((e) => SequenceMetadata.fromPartial(e)) || [];message.packages = object.packages?.map((e) => PackageMetadata.fromPartial(e)) || [];message.owner = object.owner ?? "";- message.triggers = object.triggers?.map((e) => TriggerMetadata.fromPartial(e)) || [];message.events = object.events?.map((e) => EventMetadata.fromPartial(e)) || [];message.enumTypes = object.enumTypes?.map((e) => EnumTypeMetadata.fromPartial(e)) || [];return message;@@ -2231,8 +2199,6 @@ export const SequenceMetadata: MessageFns<SequenceMetadata> = {function createBaseTriggerMetadata(): TriggerMetadata {return {name: "",- schemaName: "",- tableName: "",event: "",timing: "",body: "",@@ -2249,12 +2215,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {if (message.name !== "") {writer.uint32(10).string(message.name);}- if (message.schemaName !== "") {- writer.uint32(74).string(message.schemaName);- }- if (message.tableName !== "") {- writer.uint32(18).string(message.tableName);- }if (message.event !== "") {writer.uint32(26).string(message.event);}@@ -2297,22 +2257,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {message.name = reader.string();continue;}- case 9: {- if (tag !== 74) {- break;- }-- message.schemaName = reader.string();- continue;- }- case 2: {- if (tag !== 18) {- break;- }-- message.tableName = reader.string();- continue;- }case 3: {if (tag !== 26) {break;@@ -2389,8 +2333,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {fromJSON(object: any): TriggerMetadata {return {name: isSet(object.name) ? globalThis.String(object.name) : "",- schemaName: isSet(object.schemaName) ? globalThis.String(object.schemaName) : "",- tableName: isSet(object.tableName) ? globalThis.String(object.tableName) : "",event: isSet(object.event) ? globalThis.String(object.event) : "",timing: isSet(object.timing) ? globalThis.String(object.timing) : "",body: isSet(object.body) ? globalThis.String(object.body) : "",@@ -2407,12 +2349,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {if (message.name !== "") {obj.name = message.name;}- if (message.schemaName !== "") {- obj.schemaName = message.schemaName;- }- if (message.tableName !== "") {- obj.tableName = message.tableName;- }if (message.event !== "") {obj.event = message.event;}@@ -2446,8 +2382,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {fromPartial(object: DeepPartial<TriggerMetadata>): TriggerMetadata {const message = createBaseTriggerMetadata();message.name = object.name ?? "";- message.schemaName = object.schemaName ?? "";- message.tableName = object.tableName ?? "";message.event = object.event ?? "";message.timing = object.timing ?? "";message.body = object.body ?? "";@@ -2878,6 +2812,7 @@ function createBaseTableMetadata(): TableMetadata {checkConstraints: [],owner: "",sortingKeys: [],+ triggers: [],};}@@ -2937,6 +2872,9 @@ export const TableMetadata: MessageFns<TableMetadata> = {for (const v of message.sortingKeys) {writer.uint32(154).string(v!);}+ for (const v of message.triggers) {+ TriggerMetadata.encode(v!, writer.uint32(162).fork()).join();+ }return writer;},@@ -3091,6 +3029,14 @@ export const TableMetadata: MessageFns<TableMetadata> = {message.sortingKeys.push(reader.string());continue;}+ case 20: {+ if (tag !== 162) {+ break;+ }++ message.triggers.push(TriggerMetadata.decode(reader, reader.uint32()));+ continue;+ }}if ((tag & 7) === 4 || tag === 0) {break;@@ -3132,6 +3078,9 @@ export const TableMetadata: MessageFns<TableMetadata> = {sortingKeys: globalThis.Array.isArray(object?.sortingKeys)? object.sortingKeys.map((e: any) => globalThis.String(e)): [],+ triggers: globalThis.Array.isArray(object?.triggers)+ ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))+ : [],};},@@ -3191,6 +3140,9 @@ export const TableMetadata: MessageFns<TableMetadata> = {if (message.sortingKeys?.length) {obj.sortingKeys = message.sortingKeys;}+ if (message.triggers?.length) {+ obj.triggers = message.triggers.map((e) => TriggerMetadata.toJSON(e));+ }return obj;},@@ -3225,6 +3177,7 @@ export const TableMetadata: MessageFns<TableMetadata> = {message.checkConstraints = object.checkConstraints?.map((e) => CheckConstraintMetadata.fromPartial(e)) || [];message.owner = object.owner ?? "";message.sortingKeys = object.sortingKeys?.map((e) => e) || [];+ message.triggers = object.triggers?.map((e) => TriggerMetadata.fromPartial(e)) || [];return message;},};diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.tsindex 42de07dc89..257355e08c 100644--- a/frontend/src/types/proto/v1/database_service.ts+++ b/frontend/src/types/proto/v1/database_service.ts@@ -504,11 +504,6 @@ export interface SchemaMetadata {/** The packages is the list of packages in a schema. */packages: PackageMetadata[];owner: string;- /**- * The triggers is the list of triggers in a schema, triggers are sorted by- * table_name, name, event, timing, action_order.- */- triggers: TriggerMetadata[];/** The sequences is the list of sequences in a schema, sorted by name. */sequences: SequenceMetadata[];events: EventMetadata[];@@ -562,13 +557,6 @@ export interface SequenceMetadata {export interface TriggerMetadata {/** The name is the name of the trigger. */name: string;- /** The schema name of the table/view that the trigger is created. */- schemaName: string;- /**- * The table_name is the name of the table/view that the trigger is created- * on.- */- tableName: string;/*** The event is the event of the trigger, such as INSERT, UPDATE, DELETE,* TRUNCATE.@@ -641,6 +629,7 @@ export interface TableMetadata {* Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by*/sortingKeys: string[];+ triggers: TriggerMetadata[];}/** CheckConstraintMetadata is the metadata for check constraints. */@@ -3896,7 +3885,6 @@ function createBaseSchemaMetadata(): SchemaMetadata {materializedViews: [],packages: [],owner: "",- triggers: [],sequences: [],events: [],enumTypes: [],@@ -3938,9 +3926,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {if (message.owner !== "") {writer.uint32(90).string(message.owner);}- for (const v of message.triggers) {- TriggerMetadata.encode(v!, writer.uint32(98).fork()).join();- }for (const v of message.sequences) {SequenceMetadata.encode(v!, writer.uint32(106).fork()).join();}@@ -4048,14 +4033,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {message.owner = reader.string();continue;}- case 12: {- if (tag !== 98) {- break;- }-- message.triggers.push(TriggerMetadata.decode(reader, reader.uint32()));- continue;- }case 13: {if (tag !== 106) {break;@@ -4114,15 +4091,10 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {? object.packages.map((e: any) => PackageMetadata.fromJSON(e)): [],owner: isSet(object.owner) ? globalThis.String(object.owner) : "",- triggers: globalThis.Array.isArray(object?.triggers)- ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))- : [],sequences: globalThis.Array.isArray(object?.sequences)? object.sequences.map((e: any) => SequenceMetadata.fromJSON(e)): [],- events: globalThis.Array.isArray(object?.events)- ? object.events.map((e: any) => EventMetadata.fromJSON(e))- : [],+ events: globalThis.Array.isArray(object?.events) ? object.events.map((e: any) => EventMetadata.fromJSON(e)) : [],enumTypes: globalThis.Array.isArray(object?.enumTypes)? object.enumTypes.map((e: any) => EnumTypeMetadata.fromJSON(e)): [],@@ -4164,9 +4136,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {if (message.owner !== "") {obj.owner = message.owner;}- if (message.triggers?.length) {- obj.triggers = message.triggers.map((e) => TriggerMetadata.toJSON(e));- }if (message.sequences?.length) {obj.sequences = message.sequences.map((e) => SequenceMetadata.toJSON(e));}@@ -4195,7 +4164,6 @@ export const SchemaMetadata: MessageFns<SchemaMetadata> = {message.materializedViews = object.materializedViews?.map((e) => MaterializedViewMetadata.fromPartial(e)) || [];message.packages = object.packages?.map((e) => PackageMetadata.fromPartial(e)) || [];message.owner = object.owner ?? "";- message.triggers = object.triggers?.map((e) => TriggerMetadata.fromPartial(e)) || [];message.sequences = object.sequences?.map((e) => SequenceMetadata.fromPartial(e)) || [];message.events = object.events?.map((e) => EventMetadata.fromPartial(e)) || [];message.enumTypes = object.enumTypes?.map((e) => EnumTypeMetadata.fromPartial(e)) || [];@@ -4654,8 +4622,6 @@ export const SequenceMetadata: MessageFns<SequenceMetadata> = {function createBaseTriggerMetadata(): TriggerMetadata {return {name: "",- schemaName: "",- tableName: "",event: "",timing: "",body: "",@@ -4672,12 +4638,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {if (message.name !== "") {writer.uint32(10).string(message.name);}- if (message.schemaName !== "") {- writer.uint32(74).string(message.schemaName);- }- if (message.tableName !== "") {- writer.uint32(18).string(message.tableName);- }if (message.event !== "") {writer.uint32(26).string(message.event);}@@ -4720,22 +4680,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {message.name = reader.string();continue;}- case 9: {- if (tag !== 74) {- break;- }-- message.schemaName = reader.string();- continue;- }- case 2: {- if (tag !== 18) {- break;- }-- message.tableName = reader.string();- continue;- }case 3: {if (tag !== 26) {break;@@ -4812,8 +4756,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {fromJSON(object: any): TriggerMetadata {return {name: isSet(object.name) ? globalThis.String(object.name) : "",- schemaName: isSet(object.schemaName) ? globalThis.String(object.schemaName) : "",- tableName: isSet(object.tableName) ? globalThis.String(object.tableName) : "",event: isSet(object.event) ? globalThis.String(object.event) : "",timing: isSet(object.timing) ? globalThis.String(object.timing) : "",body: isSet(object.body) ? globalThis.String(object.body) : "",@@ -4830,12 +4772,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {if (message.name !== "") {obj.name = message.name;}- if (message.schemaName !== "") {- obj.schemaName = message.schemaName;- }- if (message.tableName !== "") {- obj.tableName = message.tableName;- }if (message.event !== "") {obj.event = message.event;}@@ -4869,8 +4805,6 @@ export const TriggerMetadata: MessageFns<TriggerMetadata> = {fromPartial(object: DeepPartial<TriggerMetadata>): TriggerMetadata {const message = createBaseTriggerMetadata();message.name = object.name ?? "";- message.schemaName = object.schemaName ?? "";- message.tableName = object.tableName ?? "";message.event = object.event ?? "";message.timing = object.timing ?? "";message.body = object.body ?? "";@@ -5013,6 +4947,7 @@ function createBaseTableMetadata(): TableMetadata {checkConstraints: [],owner: "",sortingKeys: [],+ triggers: [],};}@@ -5072,6 +5007,9 @@ export const TableMetadata: MessageFns<TableMetadata> = {for (const v of message.sortingKeys) {writer.uint32(154).string(v!);}+ for (const v of message.triggers) {+ TriggerMetadata.encode(v!, writer.uint32(162).fork()).join();+ }return writer;},@@ -5226,6 +5164,14 @@ export const TableMetadata: MessageFns<TableMetadata> = {message.sortingKeys.push(reader.string());continue;}+ case 20: {+ if (tag !== 162) {+ break;+ }++ message.triggers.push(TriggerMetadata.decode(reader, reader.uint32()));+ continue;+ }}if ((tag & 7) === 4 || tag === 0) {break;@@ -5267,6 +5213,9 @@ export const TableMetadata: MessageFns<TableMetadata> = {sortingKeys: globalThis.Array.isArray(object?.sortingKeys)? object.sortingKeys.map((e: any) => globalThis.String(e)): [],+ triggers: globalThis.Array.isArray(object?.triggers)+ ? object.triggers.map((e: any) => TriggerMetadata.fromJSON(e))+ : [],};},@@ -5326,6 +5275,9 @@ export const TableMetadata: MessageFns<TableMetadata> = {if (message.sortingKeys?.length) {obj.sortingKeys = message.sortingKeys;}+ if (message.triggers?.length) {+ obj.triggers = message.triggers.map((e) => TriggerMetadata.toJSON(e));+ }return obj;},@@ -5360,6 +5312,7 @@ export const TableMetadata: MessageFns<TableMetadata> = {message.checkConstraints = object.checkConstraints?.map((e) => CheckConstraintMetadata.fromPartial(e)) || [];message.owner = object.owner ?? "";message.sortingKeys = object.sortingKeys?.map((e) => e) || [];+ message.triggers = object.triggers?.map((e) => TriggerMetadata.fromPartial(e)) || [];return message;},};diff --git a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/SchemaPane.vue b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/SchemaPane.vueindex 15b05904b7..afba7c17b2 100644--- a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/SchemaPane.vue+++ b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/SchemaPane.vue@@ -342,6 +342,8 @@ const selectedKeys = computed(() => {parts.push(`indexes/${index}`);} else if (partition) {parts.push(`partitionTables/${partition}`);+ } else if (trigger) {+ parts.push(`triggers/${trigger}`);} else if (foreignKey) {parts.push(`foreignKeys/${foreignKey}`);}@@ -358,8 +360,6 @@ const selectedKeys = computed(() => {parts.push(`functions/${func}`);} else if (sequence) {parts.push(`sequences/${sequence}`);- } else if (trigger) {- parts.push(`triggers/${trigger}`);} else if (externalTable) {parts.push(`externalTables/${externalTable}`);} else if (pack) {diff --git a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsx b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsxindex 64692ae632..0a85935705 100644--- a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsx+++ b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsx@@ -268,6 +268,7 @@ export const useActions = () => {type === "table" ||type === "index" ||type === "foreign-key" ||+ type === "trigger" ||type === "partition-table") {detail.table = (target as NodeTarget<"table">).table.name;@@ -295,6 +296,10 @@ export const useActions = () => {});}}+ if (type === "trigger") {+ const { trigger, position } = target as NodeTarget<"trigger">;+ detail.trigger = keyWithPosition(trigger.name, position);+ }if (type === "view") {detail.view = (target as NodeTarget<"view">).view.name;}@@ -339,10 +344,6 @@ export const useActions = () => {const { sequence, position } = target as NodeTarget<"sequence">;detail.sequence = keyWithPosition(sequence.name, position);}- if (type === "trigger") {- const { trigger, position } = target as NodeTarget<"trigger">;- detail.trigger = keyWithPosition(trigger.name, position);- }if (type === "external-table") {detail.externalTable = (target as NodeTarget<"external-table">diff --git a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.ts b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.tsindex 9d380b30a8..a60b021b34 100644--- a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.ts+++ b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.ts@@ -75,6 +75,10 @@ export type RichPartitionTableMetadata = RichTableMetadata & {parentPartition?: TablePartitionMetadata;partition: TablePartitionMetadata;};+export type RichTriggerMetadata = RichTableMetadata & {+ trigger: TriggerMetadata;+ position: number;+};export type RichViewMetadata = RichSchemaMetadata & {view: ViewMetadata;};@@ -82,10 +86,6 @@ export type RichSequenceMetadata = RichSchemaMetadata & {sequence: SequenceMetadata;position: number;};-export type RichTriggerMetadata = RichSchemaMetadata & {- trigger: TriggerMetadata;- position: number;-};export type RichProcedureMetadata = RichSchemaMetadata & {procedure: ProcedureMetadata;position: number;@@ -310,10 +310,12 @@ export const keyForNodeTarget = <T extends NodeType>(].join("/");}if (type === "trigger") {- const { db, schema, trigger, position } = target as NodeTarget<"trigger">;+ const { db, schema, table, trigger, position } =+ target as NodeTarget<"trigger">;return [db.name,`schemas/${schema.name}`,+ `tables/${table.name}`,`triggers/${keyWithPosition(trigger.name, position)}`,].join("/");}@@ -583,6 +585,15 @@ const mapTableNodes = (target: NodeTarget<"schema">, parent: TreeNode) => {node.children.push(foreignKeysFolderNode);}+ // Show "Triggers" if there's at least 1 function+ if (table.triggers.length > 0) {+ const triggerNode = createExpandableTextNode("trigger", parent, () =>+ t("db.triggers")+ );+ triggerNode.children = mapTriggerNodes(node.meta.target, triggerNode);+ node.children.push(triggerNode);+ }+// Map table-level partitions.if (table.partitions.length > 0) {const partitionsFolderNode = createExpandableTextNode(@@ -760,11 +771,11 @@ const mapSequenceNodes = (return children;};const mapTriggerNodes = (- target: NodeTarget<"schema">,+ target: NodeTarget<"table">,parent: TreeNode<"expandable-text">) => {- const { schema } = target;- const children = schema.triggers.map((trigger, position) =>+ const { table } = target;+ const children = table.triggers.map((trigger, position) =>mapTreeNodeByType("trigger", { ...target, trigger, position }, parent));if (children.length === 0) {@@ -856,15 +867,6 @@ const buildSchemaNodeChildren = (children.push(sequenceNode);}- // Show "Triggers" if there's at least 1 function- if (schema.triggers.length > 0) {- const triggerNode = createExpandableTextNode("trigger", parent, () =>- t("db.triggers")- );- triggerNode.children = mapTriggerNodes(target, triggerNode);- children.push(triggerNode);- }-return children;};export const buildDatabaseSchemaTree = (diff --git a/frontend/src/views/sql-editor/EditorPanel/GutterBar/TabItem.vue b/frontend/src/views/sql-editor/EditorPanel/GutterBar/TabItem.vueindex e252549b2c..3be64dcb0a 100644--- a/frontend/src/views/sql-editor/EditorPanel/GutterBar/TabItem.vue+++ b/frontend/src/views/sql-editor/EditorPanel/GutterBar/TabItem.vue@@ -14,7 +14,6 @@<FunctionIcon v-if="view === 'FUNCTIONS'" :class="iconClass" /><ProcedureIcon v-if="view === 'PROCEDURES'" :class="iconClass" /><SequenceIcon v-if="view === 'SEQUENCES'" :class="iconClass" />- <TriggerIcon v-if="view === 'TRIGGERS'" :class="iconClass" /><PackageIcon v-if="view === 'PACKAGES'" :class="iconClass" /><ExternalTableIconv-if="view === 'EXTERNAL_TABLES'"@@ -43,7 +42,6 @@ import {ExternalTableIcon,PackageIcon,SequenceIcon,- TriggerIcon,} from "@/components/Icon";import { SchemaDiagramIcon } from "@/components/SchemaDiagram";import { useEditorPanelContext } from "../context";@@ -80,8 +78,6 @@ const text = computed(() => {return t("db.procedures");case "SEQUENCES":return t("db.sequences");- case "TRIGGERS":- return t("db.triggers");case "PACKAGES":return t("db.packages");case "EXTERNAL_TABLES":diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vueindex c02491c4fb..e57cef65d2 100644--- a/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vue+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vue@@ -149,38 +149,6 @@</div></div>- <div- v-if="instanceV1SupportsTrigger(database.instanceResource)"- class="flex flex-col gap-2"- >- <div class="flex items-center justify-between">- <h2 class="text-lg">{{ $t("db.triggers") }}</h2>- <SearchBox v-model:value="state.keywords.triggers" />- </div>- <div class="max-h-[16rem] overflow-x-auto overflow-y-hidden">- <TriggersTable- v-if="metadata.schema"- :db="database"- :database="metadata.database"- :schema="metadata.schema"- :triggers="metadata.schema.triggers"- :keyword="state.keywords.triggers"- :max-height="230"- @click="- updateViewState({- view: 'TRIGGERS',- detail: {- trigger: keyWithPosition(- $event.trigger.name,- $event.position- ),- },- })- "- />- </div>- </div>-<divv-if="instanceV1SupportsExternalTable(database.instanceResource)"class="flex flex-col gap-2"@@ -258,7 +226,6 @@ import {instanceV1SupportsExternalTable,instanceV1SupportsPackage,instanceV1SupportsSequence,- instanceV1SupportsTrigger,} from "@/utils";import { keyWithPosition } from "@/views/sql-editor/EditorCommon";import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";@@ -269,7 +236,6 @@ import PackagesTable from "../PackagesPanel/PackagesTable.vue";import ProceduresTable from "../ProceduresPanel/ProceduresTable.vue";import SequencesTable from "../SequencesPanel/SequencesTable.vue";import TablesTable from "../TablesPanel/TablesTable.vue";-import TriggersTable from "../TriggersPanel/TriggersTable.vue";import ViewsTable from "../ViewsPanel/ViewsTable.vue";import { SchemaSelectToolbar } from "../common";@@ -280,7 +246,6 @@ const state = reactive({functions: "",procedures: "",sequences: "",- triggers: "",externalTables: "",packages: "",},diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vueindex 5122cbfc35..142d8d6546 100644--- a/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue@@ -15,7 +15,6 @@:key="tab?.id"/><SequencesPanel v-if="viewState.view === 'SEQUENCES'" :key="tab?.id" />- <TriggersPanel v-if="viewState.view === 'TRIGGERS'" :key="tab?.id" /><PackagesPanel v-if="viewState.view === 'PACKAGES'" :key="tab?.id" /><ExternalTablesPanelv-if="viewState.view === 'EXTERNAL_TABLES'"@@ -58,7 +57,6 @@ import PackagesPanel from "./PackagesPanel";import ProceduresPanel from "./ProceduresPanel";import SequencesPanel from "./SequencesPanel";import TablesPanel from "./TablesPanel";-import TriggersPanel from "./TriggersPanel";import ViewsPanel from "./ViewsPanel";defineProps<{diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TableDetail.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TableDetail.vueindex 8a4a4322bf..470dfa2783 100644--- a/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TableDetail.vue+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TableDetail.vue@@ -57,6 +57,23 @@:table="table":keyword="state.keyword"/>+ <TriggersTable+ v-show="state.view === 'TRIGGERS'"+ :db="db"+ :database="database"+ :schema="schema"+ :table="table"+ :keyword="state.keyword"+ @click="+ ({ trigger, position }) =>+ updateViewState({+ detail: {+ table: table.name,+ trigger: keyWithPosition(trigger.name, position),+ },+ })+ "+ /><PartitionsTablev-show="state.view === 'PARTITIONS'":db="db"@@ -78,6 +95,7 @@ import {IndexIcon,TableIcon,TablePartitionIcon,+ TriggerIcon,} from "@/components/Icon";import { SearchBox } from "@/components/v2";import type { ComposedDatabase } from "@/types";@@ -86,13 +104,15 @@ import type {SchemaMetadata,TableMetadata,} from "@/types/proto/v1/database_service";+import { keyWithPosition } from "@/views/sql-editor/EditorCommon";import { useEditorPanelContext } from "../../context";import ColumnsTable from "./ColumnsTable.vue";import ForeignKeysTable from "./ForeignKeysTable.vue";import IndexesTable from "./IndexesTable.vue";import PartitionsTable from "./PartitionsTable.vue";+import TriggersTable from "./TriggersTable.vue";-type View = "COLUMNS" | "INDEXES" | "FOREIGN-KEYS" | "PARTITIONS";+type View = "COLUMNS" | "INDEXES" | "FOREIGN-KEYS" | "PARTITIONS" | "TRIGGERS";type LocalState = {view: View;keyword: string;@@ -131,6 +151,13 @@ const tabItems = computed(() => {icon: () => h(ForeignKeyIcon),});}+ if (table.triggers.length > 0) {+ items.push({+ view: "TRIGGERS",+ text: t("db.triggers"),+ icon: () => h(TriggerIcon),+ });+ }if (table.partitions.length > 0) {items.push({view: "PARTITIONS",@@ -153,9 +180,10 @@ watch(() => viewState.value?.detail.column,() => viewState.value?.detail.index,() => viewState.value?.detail.foreignKey,+ () => viewState.value?.detail.trigger,() => viewState.value?.detail.partition,],- ([table, column, index, foreignKey, partition]) => {+ ([table, column, index, foreignKey, trigger, partition]) => {if (!table) return;if (column) {state.view = "COLUMNS";@@ -173,6 +201,10 @@ watch(state.view = "PARTITIONS";return;}+ if (trigger) {+ state.view = "TRIGGERS";+ return;+ }// fallbackstate.view = "COLUMNS";},diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/TriggersTable.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TriggersTable.vuesimilarity index 53%rename from frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/TriggersTable.vuerename to frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TriggersTable.vueindex a38a5be87b..608821e052 100644--- a/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/TriggersTable.vue+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TriggersTable.vue@@ -1,39 +1,76 @@<template>- <div ref="containerElRef" class="w-full h-full px-2 py-2 overflow-x-auto">- <NDataTable- v-bind="$attrs"- ref="dataTableRef"- size="small"- :row-key="- ({ trigger, position }) => keyWithPosition(trigger.name, position)- "- :columns="columns"- :data="layoutReady ? filteredTriggers : []"- :row-props="rowProps"- :max-height="tableBodyHeight"- :virtual-scroll="true"- :striped="true"- :bordered="true"- :bottom-bordered="true"- row-class-name="cursor-pointer"- />- </div>+ <Splitpanes+ horizontal+ class="w-full h-full overflow-x-auto relative flex flex-col"+ >+ <Pane class="flex-1 overflow-y-hidden" :size="detail ? 60 : 100">+ <div ref="containerElRef" class="w-full h-full">+ <NDataTable+ v-bind="$attrs"+ ref="dataTableRef"+ size="small"+ :row-key="+ ({ trigger, position }) => keyWithPosition(trigger.name, position)+ "+ :columns="columns"+ :data="layoutReady ? filteredTriggers : []"+ :row-props="rowProps"+ :max-height="tableBodyHeight"+ :virtual-scroll="true"+ :striped="true"+ :bordered="true"+ :bottom-bordered="true"+ row-class-name="cursor-pointer"+ />+ </div>+ </Pane>+ <Pane+ v-if="detail"+ class="flex flex-col items-stretch shrink-0 overflow-hidden"+ :size="40"+ >+ <CodeViewer+ :db="db"+ :title="detail.trigger.name"+ :code="detail.trigger.body"+ header-class="!p-0 h-[34px]"+ >+ <template #title-prefix>+ <NButton text @click="deselect">+ <ChevronDownIcon class="w-5 h-5" />+ <div class="flex items-center gap-1">+ <TriggerIcon class="w-4 h-4" />+ <span>{{ detail.trigger.name }}</span>+ </div>+ </NButton>+ </template>+ </CodeViewer>+ </Pane>+ </Splitpanes></template><script setup lang="tsx">-import { NDataTable, type DataTableColumn } from "naive-ui";-import { computed, h, watch, withModifiers } from "vue";+import { ChevronDownIcon } from "lucide-vue-next";+import { NButton, NDataTable, type DataTableColumn } from "naive-ui";+import { Pane, Splitpanes } from "splitpanes";+import { computed, ref, watch } from "vue";import { useI18n } from "vue-i18n";+import { TriggerIcon } from "@/components/Icon";import type { ComposedDatabase } from "@/types";import type {DatabaseMetadata,TriggerMetadata,SchemaMetadata,+ TableMetadata,} from "@/types/proto/v1/database_service";import { useAutoHeightDataTable } from "@/utils";-import { keyWithPosition } from "@/views/sql-editor/EditorCommon";+import {+ extractKeyWithPosition,+ keyWithPosition,+} from "@/views/sql-editor/EditorCommon";import { EllipsisCell } from "../../common";import { useEditorPanelContext } from "../../context";+import { CodeViewer } from "../common";type TriggerWithPosition = {trigger: TriggerMetadata;@@ -44,7 +81,7 @@ const props = defineProps<{db: ComposedDatabase;database: DatabaseMetadata;schema: SchemaMetadata;- triggers: TriggerMetadata[];+ table: TableMetadata;keyword?: string;maxHeight?: number;}>();@@ -55,6 +92,7 @@ const emit = defineEmits<{metadata: {database: DatabaseMetadata;schema: SchemaMetadata;+ table: TableMetadata;trigger: TriggerMetadata;position: number;}@@ -64,8 +102,14 @@ const emit = defineEmits<{const { t } = useI18n();const { viewState, updateViewState } = useEditorPanelContext();+const detail = ref<TriggerWithPosition>();++const triggers = computed(() => {+ return props.table.triggers;+});+const triggersWithPosition = computed(() => {- return props.triggers.map<TriggerWithPosition>((trigger, position) => ({+ return triggers.value.map<TriggerWithPosition>((trigger, position) => ({trigger,position,}));@@ -74,10 +118,8 @@ const triggersWithPosition = computed(() => {const filteredTriggers = computed(() => {const keyword = props.keyword?.trim().toLowerCase();if (keyword) {- return triggersWithPosition.value.filter(- ({ trigger }) =>- trigger.name.toLowerCase().includes(keyword) ||- trigger.tableName.toLowerCase().includes(keyword)+ return triggersWithPosition.value.filter(({ trigger }) =>+ trigger.name.toLowerCase().includes(keyword));}return triggersWithPosition.value;@@ -95,7 +137,6 @@ const {maxHeight: props.maxHeight ? props.maxHeight : null,})));-const columns = computed(() => {const columns: (DataTableColumn<TriggerWithPosition> & {hide?: boolean;@@ -108,28 +149,6 @@ const columns = computed(() => {return <EllipsisCell content={trigger.name} keyword={props.keyword} />;},},- {- key: "table-name",- title: t("db.trigger.table-name"),- resizable: true,- render: ({ trigger }) => {- return h(EllipsisCell, {- content: trigger.tableName,- keyword: props.keyword,- class: "cursor-pointer hover:underline hover:text-accent",- onClick: withModifiers(() => {- const { schema } = props;- updateViewState({- view: "TABLES",- schema: schema.name,- detail: {- table: trigger.tableName,- },- });- }, ["stop", "prevent"]),- });- },- },{key: "event",title: t("db.trigger.event"),@@ -183,6 +202,7 @@ const rowProps = ({ trigger, position }: TriggerWithPosition) => {emit("click", {database: props.database,schema: props.schema,+ table: props.table,trigger,position,});@@ -190,11 +210,27 @@ const rowProps = ({ trigger, position }: TriggerWithPosition) => {};};+const deselect = () => {+ updateViewState({+ detail: {+ ...viewState.value?.detail,+ trigger: "-1", // Used as a placeholder to prevent the tab going (fallback) to "Columns"+ },+ });+};+watch(- [() => viewState.value?.detail.procedure, virtualListRef],- ([procedure, vl]) => {- if (procedure && vl) {- vl.scrollTo({ key: procedure });+ [() => viewState.value?.detail.trigger, virtualListRef],+ ([trigger, vl]) => {+ if (trigger) {+ const [name, position] = extractKeyWithPosition(trigger);+ const found = triggersWithPosition.value.find(+ (item) => item.trigger.name === name && item.position === position+ );+ detail.value = found;+ }+ if (trigger && vl) {+ vl.scrollTo({ key: trigger });}},{ immediate: true }diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/TriggersPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/TriggersPanel.vuedeleted file mode 100644index 43df1db903..0000000000--- a/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/TriggersPanel.vue+++ /dev/null@@ -1,161 +0,0 @@-<template>- <div v-if="metadata?.schema" class="h-full overflow-hidden flex flex-col">- <div- v-show="!metadata.trigger"- class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-between items-center"- >- <div class="flex items-center justify-start gap-2">- <DatabaseChooser />- <SchemaSelectToolbar simple />- </div>- <div class="flex items-center justify-end">- <SearchBox- v-model:value="state.keyword"- size="small"- style="width: 10rem"- />- </div>- </div>- <TriggersTable- v-show="!metadata.trigger"- :db="database"- :database="metadata.database"- :schema="metadata.schema"- :triggers="metadata.schema.triggers"- :keyword="state.keyword"- @click="select"- />-- <template v-if="metadata.trigger">- <CodeViewer- :db="database"- :title="metadata.trigger.name"- :code="metadata.trigger.body"- @back="deselect"- >- <template #title-icon>- <ProcedureIcon class="w-4 h-4 text-main" />- </template>- <template #content-prefix>- <div- class="grid gap-2 text-sm border-b p-2"- style="grid-template-columns: repeat(3, 1fr)"- >- <div class="inline-flex flex-col gap-1">- <dt class="whitespace-nowrap text-xs font-medium text-gray-500">- {{ $t("db.trigger.table-name") }}- </dt>- <dd- class="whitespace-pre-wrap break-all hover:underline hover:text-accent cursor-pointer"- @click="goTable"- >- {{ $t(metadata.trigger.tableName) }}- </dd>- </div>- <div class="inline-flex flex-col gap-1">- <dt class="whitespace-nowrap text-xs font-medium text-gray-500">- {{ $t("db.trigger.event") }}- </dt>- <dd>{{ $t(metadata.trigger.event) }}</dd>- </div>- <div class="inline-flex flex-col gap-1">- <dt class="whitespace-nowrap text-xs font-medium text-gray-500">- {{ $t("db.trigger.timing") }}- </dt>- <dd>{{ $t(metadata.trigger.timing) }}</dd>- </div>- <div class="col-span-3 inline-flex flex-col gap-1">- <dt class="whitespace-nowrap text-xs font-medium text-gray-500">- SQL mode- </dt>- <dd class="whitespace-pre-wrap break-all">- {{ metadata.trigger.sqlMode }}- </dd>- </div>- </div>- </template>- </CodeViewer>- </template>- </div>-</template>--<script setup lang="ts">-import { computed, reactive } from "vue";-import { ProcedureIcon } from "@/components/Icon";-import { SearchBox } from "@/components/v2";-import {- useConnectionOfCurrentSQLEditorTab,- useDBSchemaV1Store,-} from "@/store";-import {- DatabaseMetadata,- DatabaseMetadataView,- SchemaMetadata,- TriggerMetadata,-} from "@/types/proto/v1/database_service";-import {- extractKeyWithPosition,- keyWithPosition,-} from "@/views/sql-editor/EditorCommon";-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";-import { useEditorPanelContext } from "../../context";-import { SchemaSelectToolbar, CodeViewer } from "../common";-import TriggersTable from "./TriggersTable.vue";--const { database } = useConnectionOfCurrentSQLEditorTab();-const { viewState, updateViewState } = useEditorPanelContext();-const databaseMetadata = computed(() => {- return useDBSchemaV1Store().getDatabaseMetadata(- database.value.name,- DatabaseMetadataView.DATABASE_METADATA_VIEW_FULL- );-});-const state = reactive({- keyword: "",-});--const metadata = computed(() => {- const database = databaseMetadata.value;- const schema = database.schemas.find(- (s) => s.name === viewState.value?.schema- );- const [name, position] = extractKeyWithPosition(- viewState.value?.detail?.trigger ?? ""- );- const trigger = schema?.triggers.find(- (t, i) => t.name === name && i === position- );- return { database, schema, trigger };-});--const select = (selected: {- database: DatabaseMetadata;- schema: SchemaMetadata;- trigger: TriggerMetadata;- position: number;-}) => {- updateViewState({- detail: {- trigger: keyWithPosition(selected.trigger.name, selected.position),- },- });-};--const deselect = () => {- updateViewState({- detail: {},- });-};--const goTable = () => {- const { schema, trigger } = metadata.value;- if (!schema || !trigger) return;- updateViewState({- view: "TABLES",- schema: schema.name,- detail: {- table: trigger.tableName,- },- });-};-</script>diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/index.ts b/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/index.tsdeleted file mode 100644index ebfbdd9326..0000000000--- a/frontend/src/views/sql-editor/EditorPanel/Panels/TriggersPanel/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import TriggersPanel from "./TriggersPanel.vue";--export default TriggersPanel;diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/common/CodeViewer.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/common/CodeViewer.vueindex f4ad921643..f4cabf99f7 100644--- a/frontend/src/views/sql-editor/EditorPanel/Panels/common/CodeViewer.vue+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/common/CodeViewer.vue@@ -1,15 +1,18 @@<template><divclass="w-full h-[44px] px-2 py-2 border-b flex flex-row justify-between items-center"+ :class="headerClass"><div class="flex justify-start items-center gap-2">- <NButton text @click="$emit('back')">- <ChevronLeftIcon class="w-5 h-5" />- <div class="flex items-center gap-1">- <slot name="title-icon" />- <span>{{ title }}</span>- </div>- </NButton>+ <slot name="title-prefix">+ <NButton text @click="$emit('back')">+ <ChevronLeftIcon class="w-5 h-5" />+ <div class="flex items-center gap-1">+ <slot name="title-icon" />+ <span>{{ title }}</span>+ </div>+ </NButton>+ </slot></div><div class="flex justify-end items-center gap-2"><NCheckbox v-model:checked="format">@@ -78,7 +81,7 @@ import { useAIContext } from "@/plugins/ai/logic";import * as promptUtils from "@/plugins/ai/logic/prompt";import type { ComposedDatabase } from "@/types";import { dialectOfEngineV1 } from "@/types";-import { nextAnimationFrame } from "@/utils";+import { nextAnimationFrame, type VueClass } from "@/utils";import { OpenAIButton } from "@/views/sql-editor/EditorCommon";import { useSQLEditorContext } from "@/views/sql-editor/context";@@ -86,6 +89,7 @@ const props = defineProps<{db: ComposedDatabase;title: string;code: string;+ headerClass?: VueClass;}>();defineEmits<{diff --git a/frontend/src/views/sql-editor/EditorPanel/context/index.ts b/frontend/src/views/sql-editor/EditorPanel/context/index.tsindex d915b6194e..6960c6a658 100644--- a/frontend/src/views/sql-editor/EditorPanel/context/index.ts+++ b/frontend/src/views/sql-editor/EditorPanel/context/index.ts@@ -14,7 +14,6 @@ import {instanceV1SupportsExternalTable,instanceV1SupportsPackage,instanceV1SupportsSequence,- instanceV1SupportsTrigger,} from "@/utils";import {defaultViewState,@@ -51,9 +50,6 @@ export const provideEditorPanelContext = (base: {if (instanceV1SupportsSequence(instance.value)) {views.push("SEQUENCES");}- if (instanceV1SupportsTrigger(instance.value)) {- views.push("TRIGGERS");- }if (instanceV1SupportsExternalTable(instance.value)) {views.push("EXTERNAL_TABLES");}diff --git a/frontend/src/views/sql-editor/EditorPanel/types.ts b/frontend/src/views/sql-editor/EditorPanel/types.tsindex f9c0dad92a..66abc43f6d 100644--- a/frontend/src/views/sql-editor/EditorPanel/types.ts+++ b/frontend/src/views/sql-editor/EditorPanel/types.ts@@ -6,7 +6,6 @@ export type EditorPanelView =| "FUNCTIONS"| "PROCEDURES"| "SEQUENCES"- | "TRIGGERS"| "EXTERNAL_TABLES"| "PACKAGES"| "DIAGRAM";@@ -45,6 +44,7 @@ export const typeToView = (type: string): EditorPanelView => {type === "column" ||type === "index" ||type === "foreign-key" ||+ type === "trigger" ||type === "partition-table") {return "TABLES";@@ -57,6 +57,5 @@ export const typeToView = (type: string): EditorPanelView => {if (type === "external-table") return "EXTERNAL_TABLES";if (type === "package") return "PACKAGES";if (type === "sequence") return "SEQUENCES";- if (type === "trigger") return "TRIGGERS";throw new Error(`unsupported type: "${type}"`);};diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex c3f6cede96..88438f6fe7 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -14680,6 +14680,10 @@ components:description: |-The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by+ triggers:+ type: array+ items:+ $ref: '#/components/schemas/TriggerMetadata'description: TableMetadata is the metadata for tables.TablePartitionMetadata:type: object@@ -15155,6 +15159,35 @@ components:error:type: stringdescription: The result of the test, empty if the test is successful.+ TriggerMetadata:+ type: object+ properties:+ name:+ type: string+ description: The name is the name of the trigger.+ event:+ type: string+ description: |-+ The event is the event of the trigger, such as INSERT, UPDATE, DELETE,+ TRUNCATE.+ timing:+ type: string+ description: The timing is the timing of the trigger, such as BEFORE, AFTER.+ body:+ type: string+ description: The body is the body of the trigger.+ sqlMode:+ type: string+ characterSetClient:+ type: string+ collationConnection:+ type: string+ actionOrientation:+ type: string+ description: For Postgres, identifies whether the trigger fires once for each processed row or once for each statement (ROW or STATEMENT).+ condition:+ type: string+ description: For Postgres, the WHEN condition of the trigger.UndeleteEnvironmentRequest:required:- namediff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 6871835559..38cc7ba963 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -1385,7 +1385,6 @@ This is the concept of schema in Postgres, but it's a no-op for MySQL.| sequences | [SequenceMetadata](#bytebase-store-SequenceMetadata) | repeated | The sequences is the list of sequences in a schema. || packages | [PackageMetadata](#bytebase-store-PackageMetadata) | repeated | The packages is the list of packages in a schema. || owner | [string](#string) | | |-| triggers | [TriggerMetadata](#bytebase-store-TriggerMetadata) | repeated | The triggers is the list of triggers in a schema, triggers are sorted by table_name, event, timing, action_order. || events | [EventMetadata](#bytebase-store-EventMetadata) | repeated | || enum_types | [EnumTypeMetadata](#bytebase-store-EnumTypeMetadata) | repeated | |@@ -1519,6 +1518,7 @@ TableMetadata is the metadata for tables.| check_constraints | [CheckConstraintMetadata](#bytebase-store-CheckConstraintMetadata) | repeated | The check_constraints is the list of check constraints in a table. || owner | [string](#string) | | || sorting_keys | [string](#string) | repeated | The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field. Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by |+| triggers | [TriggerMetadata](#bytebase-store-TriggerMetadata) | repeated | |@@ -1579,8 +1579,6 @@ TablePartitionMetadata is the metadata for table partitions.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- || name | [string](#string) | | The name is the name of the trigger. |-| schema_name | [string](#string) | | The schema name of the table/view that the trigger is created. |-| table_name | [string](#string) | | The table_name is the name of the table/view that the trigger is created on. || event | [string](#string) | | The event is the event of the trigger, such as INSERT, UPDATE, DELETE, TRUNCATE. || timing | [string](#string) | | The timing is the timing of the trigger, such as BEFORE, AFTER. || body | [string](#string) | | The body is the body of the trigger. |diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex f01fc65236..ba1f5f0e37 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -4231,14 +4231,6 @@ Snowflake. </p></td><td><p> </p></td></tr>- <tr>- <td>triggers</td>- <td><a href="#bytebase.store.TriggerMetadata">TriggerMetadata</a></td>- <td>repeated</td>- <td><p>The triggers is the list of triggers in a schema, triggers are sorted by-table_name, event, timing, action_order. </p></td>- </tr>-<tr><td>events</td><td><a href="#bytebase.store.EventMetadata">EventMetadata</a></td>@@ -4688,6 +4680,13 @@ classification and user_comment is parsed from the comment. </p></td>Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by </p></td></tr>+ <tr>+ <td>triggers</td>+ <td><a href="#bytebase.store.TriggerMetadata">TriggerMetadata</a></td>+ <td>repeated</td>+ <td><p> </p></td>+ </tr>+</tbody></table>@@ -4885,21 +4884,6 @@ Example: 01ad32a0-1bb6-5e93-0000-000000000001 </p></td><td><p>The name is the name of the trigger. </p></td></tr>- <tr>- <td>schema_name</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>The schema name of the table/view that the trigger is created. </p></td>- </tr>-- <tr>- <td>table_name</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>The table_name is the name of the table/view that the trigger is created-on. </p></td>- </tr>-<tr><td>event</td><td><a href="#string">string</a></td>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 48d3b99af5..b72acb432e 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -2822,7 +2822,6 @@ This is the concept of schema in Postgres, but it's a no-op for MySQL.| materialized_views | [MaterializedViewMetadata](#bytebase-v1-MaterializedViewMetadata) | repeated | The materialized_views is the list of materialized views in a schema. || packages | [PackageMetadata](#bytebase-v1-PackageMetadata) | repeated | The packages is the list of packages in a schema. || owner | [string](#string) | | |-| triggers | [TriggerMetadata](#bytebase-v1-TriggerMetadata) | repeated | The triggers is the list of triggers in a schema, triggers are sorted by table_name, name, event, timing, action_order. || sequences | [SequenceMetadata](#bytebase-v1-SequenceMetadata) | repeated | The sequences is the list of sequences in a schema, sorted by name. || events | [EventMetadata](#bytebase-v1-EventMetadata) | repeated | || enum_types | [EnumTypeMetadata](#bytebase-v1-EnumTypeMetadata) | repeated | |@@ -3032,6 +3031,7 @@ TableMetadata is the metadata for tables.| check_constraints | [CheckConstraintMetadata](#bytebase-v1-CheckConstraintMetadata) | repeated | The check_constraints is the list of check constraints in a table. || owner | [string](#string) | | || sorting_keys | [string](#string) | repeated | The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field. Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by |+| triggers | [TriggerMetadata](#bytebase-v1-TriggerMetadata) | repeated | |@@ -3092,8 +3092,6 @@ TablePartitionMetadata is the metadata for table partitions.| Field | Type | Label | Description || ----- | ---- | ----- | ----------- || name | [string](#string) | | The name is the name of the trigger. |-| schema_name | [string](#string) | | The schema name of the table/view that the trigger is created. |-| table_name | [string](#string) | | The table_name is the name of the table/view that the trigger is created on. || event | [string](#string) | | The event is the event of the trigger, such as INSERT, UPDATE, DELETE, TRUNCATE. || timing | [string](#string) | | The timing is the timing of the trigger, such as BEFORE, AFTER. || body | [string](#string) | | The body is the body of the trigger. |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 565808c594..82328f7416 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -8716,14 +8716,6 @@ Snowflake. </p></td><td><p> </p></td></tr>- <tr>- <td>triggers</td>- <td><a href="#bytebase.v1.TriggerMetadata">TriggerMetadata</a></td>- <td>repeated</td>- <td><p>The triggers is the list of triggers in a schema, triggers are sorted by-table_name, name, event, timing, action_order. </p></td>- </tr>-<tr><td>sequences</td><td><a href="#bytebase.v1.SequenceMetadata">SequenceMetadata</a></td>@@ -9405,6 +9397,13 @@ classification and user_comment is parsed from the comment. </p></td>Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by </p></td></tr>+ <tr>+ <td>triggers</td>+ <td><a href="#bytebase.v1.TriggerMetadata">TriggerMetadata</a></td>+ <td>repeated</td>+ <td><p> </p></td>+ </tr>+</tbody></table>@@ -9602,21 +9601,6 @@ Example: 01ad32a0-1bb6-5e93-0000-000000000001 </p></td><td><p>The name is the name of the trigger. </p></td></tr>- <tr>- <td>schema_name</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>The schema name of the table/view that the trigger is created. </p></td>- </tr>-- <tr>- <td>table_name</td>- <td><a href="#string">string</a></td>- <td></td>- <td><p>The table_name is the name of the table/view that the trigger is created-on. </p></td>- </tr>-<tr><td>event</td><td><a href="#string">string</a></td>diff --git a/proto/generated-go/store/database.pb.go b/proto/generated-go/store/database.pb.goindex d77a16298b..1936d6ab29 100644--- a/proto/generated-go/store/database.pb.go+++ b/proto/generated-go/store/database.pb.go@@ -557,11 +557,8 @@ type SchemaMetadata struct {// The sequences is the list of sequences in a schema.Sequences []*SequenceMetadata `protobuf:"bytes,10,rep,name=sequences,proto3" json:"sequences,omitempty"`// The packages is the list of packages in a schema.- Packages []*PackageMetadata `protobuf:"bytes,11,rep,name=packages,proto3" json:"packages,omitempty"`- Owner string `protobuf:"bytes,12,opt,name=owner,proto3" json:"owner,omitempty"`- // The triggers is the list of triggers in a schema, triggers are sorted by- // table_name, event, timing, action_order.- Triggers []*TriggerMetadata `protobuf:"bytes,13,rep,name=triggers,proto3" json:"triggers,omitempty"`+ Packages []*PackageMetadata `protobuf:"bytes,11,rep,name=packages,proto3" json:"packages,omitempty"`+ Owner string `protobuf:"bytes,12,opt,name=owner,proto3" json:"owner,omitempty"`Events []*EventMetadata `protobuf:"bytes,14,rep,name=events,proto3" json:"events,omitempty"`EnumTypes []*EnumTypeMetadata `protobuf:"bytes,15,rep,name=enum_types,json=enumTypes,proto3" json:"enum_types,omitempty"`unknownFields protoimpl.UnknownFields@@ -682,13 +679,6 @@ func (x *SchemaMetadata) GetOwner() string {return ""}-func (x *SchemaMetadata) GetTriggers() []*TriggerMetadata {- if x != nil {- return x.Triggers- }- return nil-}-func (x *SchemaMetadata) GetEvents() []*EventMetadata {if x != nil {return x.Events@@ -983,11 +973,6 @@ type TriggerMetadata struct {state protoimpl.MessageState `protogen:"open.v1"`// The name is the name of the trigger.Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`- // The schema name of the table/view that the trigger is created.- SchemaName string `protobuf:"bytes,9,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"`- // The table_name is the name of the table/view that the trigger is created- // on.- TableName string `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"`// The event is the event of the trigger, such as INSERT, UPDATE, DELETE,// TRUNCATE.Event string `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"`@@ -1043,20 +1028,6 @@ func (x *TriggerMetadata) GetName() string {return ""}-func (x *TriggerMetadata) GetSchemaName() string {- if x != nil {- return x.SchemaName- }- return ""-}--func (x *TriggerMetadata) GetTableName() string {- if x != nil {- return x.TableName- }- return ""-}-func (x *TriggerMetadata) GetEvent() string {if x != nil {return x.Event@@ -1387,7 +1358,8 @@ type TableMetadata struct {Owner string `protobuf:"bytes,18,opt,name=owner,proto3" json:"owner,omitempty"`// The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.// Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by- SortingKeys []string `protobuf:"bytes,19,rep,name=sorting_keys,json=sortingKeys,proto3" json:"sorting_keys,omitempty"`+ SortingKeys []string `protobuf:"bytes,19,rep,name=sorting_keys,json=sortingKeys,proto3" json:"sorting_keys,omitempty"`+ Triggers []*TriggerMetadata `protobuf:"bytes,20,rep,name=triggers,proto3" json:"triggers,omitempty"`unknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCache}@@ -1548,6 +1520,13 @@ func (x *TableMetadata) GetSortingKeys() []string {return nil}+func (x *TableMetadata) GetTriggers() []*TriggerMetadata {+ if x != nil {+ return x.Triggers+ }+ return nil+}+type CheckConstraintMetadata struct {state protoimpl.MessageState `protogen:"open.v1"`// The name is the name of a check constraint.@@ -3616,7 +3595,7 @@ var file_store_database_proto_rawDesc = []byte{0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xf1, 0x06, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d,+ 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xb4, 0x06, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d,0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a,0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e,@@ -3660,177 +3639,173 @@ var file_store_database_proto_rawDesc = []byte{0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74,0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12,0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,- 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x08, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72,- 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72,- 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65,- 0x72, 0x73, 0x12, 0x35, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03,- 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,- 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,- 0x61, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0a, 0x65, 0x6e, 0x75,- 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x45,- 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52,- 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3e, 0x0a, 0x10, 0x45, 0x6e,- 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12,- 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,- 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03,- 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x0d, 0x45,- 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04,- 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,- 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e,- 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x19, 0x0a,- 0x08, 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x07, 0x73, 0x71, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x72,- 0x61, 0x63, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,- 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65,- 0x72, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x63, 0x6f,- 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,- 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74,- 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc9, 0x02,- 0x0a, 0x10, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,- 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74,- 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54,- 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e,- 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69,- 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61,- 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x56, 0x61,- 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74,- 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e,- 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08,- 0x52, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x63, 0x68, 0x65,- 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x63,- 0x68, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76,- 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74,- 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x74,- 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x77, 0x6e, 0x65,- 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f,- 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77,- 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0xf4, 0x02, 0x0a, 0x0f, 0x54, 0x72,- 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a,- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,- 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65,- 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4e, 0x61,- 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d,- 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x6d, 0x69, 0x6e,- 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x12,- 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62,- 0x6f, 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18,- 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x71, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x30,- 0x0a, 0x14, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x5f,- 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x68,- 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,- 0x12, 0x31, 0x0a, 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f,- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13,- 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,- 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x72,- 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x11, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,- 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18,- 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,- 0x22, 0x80, 0x03, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,+ 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18,+ 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61,+ 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0a,+ 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b,+ 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,+ 0x65, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,+ 0x74, 0x61, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3e, 0x0a,+ 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,- 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63,- 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,- 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75,- 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f,- 0x75, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18,- 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12,- 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x64, 0x65, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x18,- 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x64, 0x65, 0x63, 0x65, 0x73, 0x73,- 0x6f, 0x72, 0x73, 0x12, 0x38, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01,- 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,- 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,- 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a,- 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x64,- 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x46, 0x0a, 0x05, 0x53,- 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e,- 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53,- 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13,- 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x55, 0x53, 0x50, 0x45, 0x4e, 0x44, 0x45,- 0x44, 0x10, 0x02, 0x22, 0xa5, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65,- 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61,- 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,- 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e,- 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12,- 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, 0x70,- 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d,- 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79,- 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,- 0x08, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65,- 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65,- 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64,- 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18,- 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f,- 0x6e, 0x22, 0x2c, 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,- 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x54, 0x41, 0x10, 0x01, 0x22,- 0x5a, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f,- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a,- 0x0c, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12,- 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x45, 0x4e, 0x44, 0x5f, 0x4f,- 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e,- 0x53, 0x45, 0x52, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x03, 0x22, 0xde, 0x05, 0x0a, 0x0d,- 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a,- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,- 0x65, 0x12, 0x38, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03,- 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,- 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,- 0x74, 0x61, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x07, 0x69,- 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62,- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e,- 0x64, 0x65, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x69, 0x6e, 0x64,- 0x65, 0x78, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x04,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09,- 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68,- 0x61, 0x72, 0x73, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61,- 0x72, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e,- 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e,- 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07,- 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d,- 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01,- 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a,- 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03,- 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x46, 0x72, 0x65, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72,- 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,- 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x75,- 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28,- 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x45,- 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0c,- 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4b, 0x65, 0x79,- 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67,- 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69,- 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65,- 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,- 0x61, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x54, 0x0a,- 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e,- 0x74, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43,- 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,- 0x61, 0x52, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69,- 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x12, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x72,- 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52,- 0x0b, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x4d, 0x0a, 0x17,+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18,+ 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xe0, 0x01,+ 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12,+ 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,+ 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f,+ 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74,+ 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65,+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65,+ 0x12, 0x19, 0x0a, 0x08, 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x07, 0x73, 0x71, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63,+ 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x63, 0x6c, 0x69,+ 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x68, 0x61, 0x72, 0x61,+ 0x63, 0x74, 0x65, 0x72, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a,+ 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65,+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63, 0x6f, 0x6c,+ 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,+ 0x22, 0xc9, 0x02, 0x0a, 0x10, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74,+ 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74,+ 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61,+ 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18,+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09,+ 0x6d, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x08, 0x6d, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78,+ 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61,+ 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d,+ 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65,+ 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x07, 0x20,+ 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61,+ 0x63, 0x68, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,+ 0x63, 0x61, 0x63, 0x68, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x73,+ 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c,+ 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65,+ 0x72, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f,+ 0x77, 0x6e, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x77, 0x6e,+ 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0xb4, 0x02, 0x0a,+ 0x0f, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,+ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,+ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69,+ 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x69, 0x6d, 0x69,+ 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f,+ 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x71, 0x6c, 0x4d, 0x6f, 0x64,+ 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x5f, 0x73,+ 0x65, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x12, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69,+ 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,+ 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28,+ 0x09, 0x52, 0x13, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e,+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,+ 0x5f, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x11, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74,+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,+ 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74,+ 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x03, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x65, 0x74, 0x61,+ 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65,+ 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18,+ 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x61, 0x72, 0x65,+ 0x68, 0x6f, 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x61, 0x72,+ 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,+ 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,+ 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x64, 0x65, 0x63, 0x65, 0x73, 0x73, 0x6f,+ 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x64, 0x65, 0x63,+ 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x38, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18,+ 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64,+ 0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,+ 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e,+ 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x46,+ 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45,+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11,+ 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10,+ 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x55, 0x53, 0x50, 0x45,+ 0x4e, 0x44, 0x45, 0x44, 0x10, 0x02, 0x22, 0xa5, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61,+ 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a,+ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,+ 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05,+ 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e,+ 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x04,+ 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65,+ 0x61, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52,+ 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6c, 0x65, 0x18, 0x06,+ 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d,+ 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,+ 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04,+ 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69,+ 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69,+ 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 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, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x54, 0x41,+ 0x10, 0x01, 0x22, 0x5a, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f,+ 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,+ 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54,+ 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x45, 0x4e,+ 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45,+ 0x5f, 0x49, 0x4e, 0x53, 0x45, 0x52, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x03, 0x22, 0x9b,+ 0x06, 0x0a, 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,+ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,+ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18,+ 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4d, 0x65, 0x74,+ 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x37,+ 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,+ 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,+ 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07,+ 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e,+ 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12,+ 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a,+ 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,+ 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x77, 0x5f, 0x63,+ 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x6f, 0x77, 0x43,+ 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a,+ 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7a,+ 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,+ 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x69, 0x7a, 0x65,+ 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18, 0x09, 0x20,+ 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x46, 0x72, 0x65, 0x65, 0x12, 0x25, 0x0a,+ 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,+ 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x74,+ 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18,+ 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21,+ 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0e,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,+ 0x74, 0x12, 0x45, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6b, 0x65, 0x79,+ 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e,+ 0x4b, 0x65, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x66, 0x6f, 0x72,+ 0x65, 0x69, 0x67, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x74,+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61,+ 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61,+ 0x64, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,+ 0x12, 0x54, 0x0a, 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72,+ 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x65,+ 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61,+ 0x64, 0x61, 0x74, 0x61, 0x52, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74,+ 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18,+ 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c,+ 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x13, 0x20, 0x03,+ 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x73, 0x12,+ 0x3b, 0x0a, 0x08, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28,+ 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,+ 0x72, 0x65, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,+ 0x74, 0x61, 0x52, 0x08, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x22, 0x4d, 0x0a, 0x17,0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x4d,0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65,@@ -4245,17 +4220,17 @@ var file_store_database_proto_depIdxs = []int32{23, // 12: bytebase.store.SchemaMetadata.materialized_views:type_name -> bytebase.store.MaterializedViewMetadata11, // 13: bytebase.store.SchemaMetadata.sequences:type_name -> bytebase.store.SequenceMetadata26, // 14: bytebase.store.SchemaMetadata.packages:type_name -> bytebase.store.PackageMetadata- 12, // 15: bytebase.store.SchemaMetadata.triggers:type_name -> bytebase.store.TriggerMetadata- 10, // 16: bytebase.store.SchemaMetadata.events:type_name -> bytebase.store.EventMetadata- 9, // 17: bytebase.store.SchemaMetadata.enum_types:type_name -> bytebase.store.EnumTypeMetadata- 0, // 18: bytebase.store.TaskMetadata.state:type_name -> bytebase.store.TaskMetadata.State- 1, // 19: bytebase.store.StreamMetadata.type:type_name -> bytebase.store.StreamMetadata.Type- 2, // 20: bytebase.store.StreamMetadata.mode:type_name -> bytebase.store.StreamMetadata.Mode- 19, // 21: bytebase.store.TableMetadata.columns:type_name -> bytebase.store.ColumnMetadata- 27, // 22: bytebase.store.TableMetadata.indexes:type_name -> bytebase.store.IndexMetadata- 29, // 23: bytebase.store.TableMetadata.foreign_keys:type_name -> bytebase.store.ForeignKeyMetadata- 18, // 24: bytebase.store.TableMetadata.partitions:type_name -> bytebase.store.TablePartitionMetadata- 16, // 25: bytebase.store.TableMetadata.check_constraints:type_name -> bytebase.store.CheckConstraintMetadata+ 10, // 15: bytebase.store.SchemaMetadata.events:type_name -> bytebase.store.EventMetadata+ 9, // 16: bytebase.store.SchemaMetadata.enum_types:type_name -> bytebase.store.EnumTypeMetadata+ 0, // 17: bytebase.store.TaskMetadata.state:type_name -> bytebase.store.TaskMetadata.State+ 1, // 18: bytebase.store.StreamMetadata.type:type_name -> bytebase.store.StreamMetadata.Type+ 2, // 19: bytebase.store.StreamMetadata.mode:type_name -> bytebase.store.StreamMetadata.Mode+ 19, // 20: bytebase.store.TableMetadata.columns:type_name -> bytebase.store.ColumnMetadata+ 27, // 21: bytebase.store.TableMetadata.indexes:type_name -> bytebase.store.IndexMetadata+ 29, // 22: bytebase.store.TableMetadata.foreign_keys:type_name -> bytebase.store.ForeignKeyMetadata+ 18, // 23: bytebase.store.TableMetadata.partitions:type_name -> bytebase.store.TablePartitionMetadata+ 16, // 24: bytebase.store.TableMetadata.check_constraints:type_name -> bytebase.store.CheckConstraintMetadata+ 12, // 25: bytebase.store.TableMetadata.triggers:type_name -> bytebase.store.TriggerMetadata19, // 26: bytebase.store.ExternalTableMetadata.columns:type_name -> bytebase.store.ColumnMetadata3, // 27: bytebase.store.TablePartitionMetadata.type:type_name -> bytebase.store.TablePartitionMetadata.Type18, // 28: bytebase.store.TablePartitionMetadata.subpartitions:type_name -> bytebase.store.TablePartitionMetadatadiff --git a/proto/generated-go/v1/database_service.pb.go b/proto/generated-go/v1/database_service.pb.goindex 9e8cd1db87..441a47b130 100644--- a/proto/generated-go/v1/database_service.pb.go+++ b/proto/generated-go/v1/database_service.pb.go@@ -1818,9 +1818,6 @@ type SchemaMetadata struct {// The packages is the list of packages in a schema.Packages []*PackageMetadata `protobuf:"bytes,10,rep,name=packages,proto3" json:"packages,omitempty"`Owner string `protobuf:"bytes,11,opt,name=owner,proto3" json:"owner,omitempty"`- // The triggers is the list of triggers in a schema, triggers are sorted by- // table_name, name, event, timing, action_order.- Triggers []*TriggerMetadata `protobuf:"bytes,12,rep,name=triggers,proto3" json:"triggers,omitempty"`// The sequences is the list of sequences in a schema, sorted by name.Sequences []*SequenceMetadata `protobuf:"bytes,13,rep,name=sequences,proto3" json:"sequences,omitempty"`Events []*EventMetadata `protobuf:"bytes,14,rep,name=events,proto3" json:"events,omitempty"`@@ -1936,13 +1933,6 @@ func (x *SchemaMetadata) GetOwner() string {return ""}-func (x *SchemaMetadata) GetTriggers() []*TriggerMetadata {- if x != nil {- return x.Triggers- }- return nil-}-func (x *SchemaMetadata) GetSequences() []*SequenceMetadata {if x != nil {return x.Sequences@@ -2244,11 +2234,6 @@ type TriggerMetadata struct {state protoimpl.MessageState `protogen:"open.v1"`// The name is the name of the trigger.Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`- // The schema name of the table/view that the trigger is created.- SchemaName string `protobuf:"bytes,9,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"`- // The table_name is the name of the table/view that the trigger is created- // on.- TableName string `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"`// The event is the event of the trigger, such as INSERT, UPDATE, DELETE,// TRUNCATE.Event string `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"`@@ -2304,20 +2289,6 @@ func (x *TriggerMetadata) GetName() string {return ""}-func (x *TriggerMetadata) GetSchemaName() string {- if x != nil {- return x.SchemaName- }- return ""-}--func (x *TriggerMetadata) GetTableName() string {- if x != nil {- return x.TableName- }- return ""-}-func (x *TriggerMetadata) GetEvent() string {if x != nil {return x.Event@@ -2485,7 +2456,8 @@ type TableMetadata struct {Owner string `protobuf:"bytes,18,opt,name=owner,proto3" json:"owner,omitempty"`// The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.// Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by- SortingKeys []string `protobuf:"bytes,19,rep,name=sorting_keys,json=sortingKeys,proto3" json:"sorting_keys,omitempty"`+ SortingKeys []string `protobuf:"bytes,19,rep,name=sorting_keys,json=sortingKeys,proto3" json:"sorting_keys,omitempty"`+ Triggers []*TriggerMetadata `protobuf:"bytes,20,rep,name=triggers,proto3" json:"triggers,omitempty"`unknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCache}@@ -2646,6 +2618,13 @@ func (x *TableMetadata) GetSortingKeys() []string {return nil}+func (x *TableMetadata) GetTriggers() []*TriggerMetadata {+ if x != nil {+ return x.Triggers+ }+ return nil+}+// CheckConstraintMetadata is the metadata for check constraints.type CheckConstraintMetadata struct {state protoimpl.MessageState `protogen:"open.v1"`@@ -7516,7 +7495,7 @@ var file_v1_database_service_proto_rawDesc = []byte{0x61, 0x12, 0x33, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,0x65, 0x73, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x7d, 0x2f, 0x6d, 0x65,- 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xca, 0x06, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d,+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x90, 0x06, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x6d,0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a,0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e,@@ -7554,142 +7533,138 @@ var file_v1_database_service_proto_rawDesc = []byte{0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61,0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b,0x61, 0x67, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x0b, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x74, 0x72,- 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62,- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67,- 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x74, 0x72, 0x69, 0x67,- 0x67, 0x65, 0x72, 0x73, 0x12, 0x3b, 0x0a, 0x09, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65,- 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4d, 0x65,- 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x09, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65,- 0x73, 0x12, 0x32, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28,- 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,- 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x65,- 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79,- 0x70, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65,- 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79,- 0x70, 0x65, 0x73, 0x22, 0x3e, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x4d,- 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76,- 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c,- 0x75, 0x65, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74,- 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66,- 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64,- 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d,- 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69,- 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f,- 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x71, 0x6c, 0x4d, 0x6f, 0x64,- 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x5f, 0x73,- 0x65, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x12, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69,- 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,- 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28,- 0x09, 0x52, 0x13, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e,- 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc9, 0x02, 0x0a, 0x10, 0x53, 0x65, 0x71, 0x75, 0x65,- 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e,+ 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x09, 0x73, 0x65,+ 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x71, 0x75,+ 0x65, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x09, 0x73, 0x65,+ 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74,+ 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64,+ 0x61, 0x74, 0x61, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x0a, 0x65,+ 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32,+ 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e,+ 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x09,+ 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3e, 0x0a, 0x10, 0x45, 0x6e, 0x75,+ 0x6d, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a,+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,+ 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,+ 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x0d, 0x45, 0x76,+ 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e,0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,- 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05,- 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61,- 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,- 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,- 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09,- 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x79,- 0x63, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65,- 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,- 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f,- 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12,- 0x21, 0x0a, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18,- 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x75,- 0x6d, 0x6e, 0x22, 0xf4, 0x02, 0x0a, 0x0f, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65,- 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63,- 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74,- 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,- 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76,- 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74,- 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x06, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79,- 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08,- 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,+ 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12,+ 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08,+ 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,0x73, 0x71, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x72, 0x61,0x63, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18,- 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72,+ 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72,0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x63, 0x6f, 0x6c,0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,- 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69,- 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12,- 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,- 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,- 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63,- 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,- 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xca, 0x01, 0x0a, 0x15, 0x45, 0x78,- 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64,- 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,- 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x78, 0x74, 0x65, 0x72,- 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53,- 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x78, 0x74,- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e,- 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x65, 0x78, 0x74, 0x65, 0x72,- 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12,- 0x35, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,- 0x32, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43,- 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x63,- 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x22, 0xcf, 0x05, 0x0a, 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65,- 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x07,- 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75,- 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75,- 0x6d, 0x6e, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x03,- 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,- 0x52, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67,- 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e,- 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,- 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x77,- 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x6f,- 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73,- 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x53,- 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x73, 0x69, 0x7a,- 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x69,- 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18,- 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x46, 0x72, 0x65, 0x65, 0x12,- 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,- 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f,- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,- 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74,- 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74,- 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d,- 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6b,- 0x65, 0x79, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4b,- 0x65, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x66, 0x6f, 0x72, 0x65,- 0x69, 0x67, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x43, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69,- 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x79,- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50,- 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,- 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x51, 0x0a, 0x11,- 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74,- 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74,- 0x72, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x10, 0x63,- 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x12,- 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,- 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67,- 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x72,- 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x4d, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63,+ 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69,+ 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc9, 0x02, 0x0a,+ 0x10, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,+ 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79,+ 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79,+ 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,+ 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f,+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6e,+ 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c,+ 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c,+ 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18,+ 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74,+ 0x12, 0x14, 0x0a, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52,+ 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f,+ 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x63, 0x68,+ 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, 0x61,+ 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x56,+ 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x61,+ 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72,+ 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x63,+ 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77, 0x6e,+ 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0xb4, 0x02, 0x0a, 0x0f, 0x54, 0x72, 0x69,+ 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04,+ 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,+ 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67,+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x12,+ 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f,+ 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x71, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x06,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x71, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x0a,+ 0x14, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x63,+ 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x68, 0x61,+ 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12,+ 0x31, 0x0a, 0x14, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e,+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63,+ 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,+ 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x72, 0x69,+ 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11,+ 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,+ 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22,+ 0xca, 0x01, 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x54, 0x61, 0x62, 0x6c,+ 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a,+ 0x14, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,+ 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x65, 0x78, 0x74,+ 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12,+ 0x34, 0x0a, 0x16, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61,+ 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x14, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,+ 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73,+ 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64,+ 0x61, 0x74, 0x61, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x22, 0x89, 0x06, 0x0a,+ 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12,+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,+ 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x02, 0x20,+ 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,+ 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,+ 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x69, 0x6e, 0x64,+ 0x65, 0x78, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4d, 0x65,+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x12,+ 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,+ 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x61,+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x6c,+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74,+ 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x12,+ 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01,+ 0x28, 0x03, 0x52, 0x08, 0x72, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09,+ 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52,+ 0x08, 0x64, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64,+ 0x65, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69,+ 0x6e, 0x64, 0x65, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61,+ 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x61, 0x74,+ 0x61, 0x46, 0x72, 0x65, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f,+ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63,+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07,+ 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,+ 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63,+ 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73,+ 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x66, 0x6f, 0x72,+ 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32,+ 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f,+ 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4b, 0x65, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,+ 0x52, 0x0b, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x43, 0x0a,+ 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28,+ 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,+ 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65,+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f,+ 0x6e, 0x73, 0x12, 0x51, 0x0a, 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x73,+ 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63,+ 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64,+ 0x61, 0x74, 0x61, 0x52, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72,+ 0x61, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x12,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73,+ 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28,+ 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x38,+ 0x0a, 0x08, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b,+ 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54,+ 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08,+ 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x22, 0x4d, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63,0x6b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64,0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65,@@ -8952,16 +8927,16 @@ var file_v1_database_service_proto_depIdxs = []int32{46, // 22: bytebase.v1.SchemaMetadata.tasks:type_name -> bytebase.v1.TaskMetadata42, // 23: bytebase.v1.SchemaMetadata.materialized_views:type_name -> bytebase.v1.MaterializedViewMetadata45, // 24: bytebase.v1.SchemaMetadata.packages:type_name -> bytebase.v1.PackageMetadata- 33, // 25: bytebase.v1.SchemaMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata- 32, // 26: bytebase.v1.SchemaMetadata.sequences:type_name -> bytebase.v1.SequenceMetadata- 31, // 27: bytebase.v1.SchemaMetadata.events:type_name -> bytebase.v1.EventMetadata- 30, // 28: bytebase.v1.SchemaMetadata.enum_types:type_name -> bytebase.v1.EnumTypeMetadata- 38, // 29: bytebase.v1.ExternalTableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata- 38, // 30: bytebase.v1.TableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata- 48, // 31: bytebase.v1.TableMetadata.indexes:type_name -> bytebase.v1.IndexMetadata- 50, // 32: bytebase.v1.TableMetadata.foreign_keys:type_name -> bytebase.v1.ForeignKeyMetadata- 37, // 33: bytebase.v1.TableMetadata.partitions:type_name -> bytebase.v1.TablePartitionMetadata- 36, // 34: bytebase.v1.TableMetadata.check_constraints:type_name -> bytebase.v1.CheckConstraintMetadata+ 32, // 25: bytebase.v1.SchemaMetadata.sequences:type_name -> bytebase.v1.SequenceMetadata+ 31, // 26: bytebase.v1.SchemaMetadata.events:type_name -> bytebase.v1.EventMetadata+ 30, // 27: bytebase.v1.SchemaMetadata.enum_types:type_name -> bytebase.v1.EnumTypeMetadata+ 38, // 28: bytebase.v1.ExternalTableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata+ 38, // 29: bytebase.v1.TableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata+ 48, // 30: bytebase.v1.TableMetadata.indexes:type_name -> bytebase.v1.IndexMetadata+ 50, // 31: bytebase.v1.TableMetadata.foreign_keys:type_name -> bytebase.v1.ForeignKeyMetadata+ 37, // 32: bytebase.v1.TableMetadata.partitions:type_name -> bytebase.v1.TablePartitionMetadata+ 36, // 33: bytebase.v1.TableMetadata.check_constraints:type_name -> bytebase.v1.CheckConstraintMetadata+ 33, // 34: bytebase.v1.TableMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata3, // 35: bytebase.v1.TablePartitionMetadata.type:type_name -> bytebase.v1.TablePartitionMetadata.Type37, // 36: bytebase.v1.TablePartitionMetadata.subpartitions:type_name -> bytebase.v1.TablePartitionMetadata48, // 37: bytebase.v1.TablePartitionMetadata.indexes:type_name -> bytebase.v1.IndexMetadatadiff --git a/proto/store/database.proto b/proto/store/database.protoindex f89893e947..251b3e0240 100644--- a/proto/store/database.proto+++ b/proto/store/database.proto@@ -92,10 +92,6 @@ message SchemaMetadata {string owner = 12;- // The triggers is the list of triggers in a schema, triggers are sorted by- // table_name, event, timing, action_order.- repeated TriggerMetadata triggers = 13;-repeated EventMetadata events = 14;repeated EnumTypeMetadata enum_types = 15;@@ -165,13 +161,6 @@ message TriggerMetadata {// The name is the name of the trigger.string name = 1;- // The schema name of the table/view that the trigger is created.- string schema_name = 9;-- // The table_name is the name of the table/view that the trigger is created- // on.- string table_name = 2;-// The event is the event of the trigger, such as INSERT, UPDATE, DELETE,// TRUNCATE.string event = 3;@@ -328,6 +317,8 @@ message TableMetadata {// The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.// Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_byrepeated string sorting_keys = 19;++ repeated TriggerMetadata triggers = 20;}message CheckConstraintMetadata {diff --git a/proto/v1/database_service.proto b/proto/v1/database_service.protoindex eb49aa7608..9ed6b94800 100644--- a/proto/v1/database_service.proto+++ b/proto/v1/database_service.proto@@ -506,10 +506,6 @@ message SchemaMetadata {string owner = 11;- // The triggers is the list of triggers in a schema, triggers are sorted by- // table_name, name, event, timing, action_order.- repeated TriggerMetadata triggers = 12;-// The sequences is the list of sequences in a schema, sorted by name.repeated SequenceMetadata sequences = 13;@@ -582,13 +578,6 @@ message TriggerMetadata {// The name is the name of the trigger.string name = 1;- // The schema name of the table/view that the trigger is created.- string schema_name = 9;-- // The table_name is the name of the table/view that the trigger is created- // on.- string table_name = 2;-// The event is the event of the trigger, such as INSERT, UPDATE, DELETE,// TRUNCATE.string event = 3;@@ -682,6 +671,8 @@ message TableMetadata {// The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.// Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_byrepeated string sorting_keys = 19;++ repeated TriggerMetadata triggers = 20;}// CheckConstraintMetadata is the metadata for check constraints.