Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: use common position (#15938)
h3n4lafcae239ea43
diff --git a/backend/plugin/db/cockroachdb/cockroachdb.go b/backend/plugin/db/cockroachdb/cockroachdb.goindex bfbfb82fa3..d74e46d3ea 100644--- a/backend/plugin/db/cockroachdb/cockroachdb.go+++ b/backend/plugin/db/cockroachdb/cockroachdb.go@@ -384,11 +384,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOreturn &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(command.FirstStatementLine),Column: int32(command.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(command.LastLine),Column: int32(command.LastColumn),},diff --git a/backend/plugin/db/dm/dm.go b/backend/plugin/db/dm/dm.goindex f9f7694917..2eb0882eaa 100644--- a/backend/plugin/db/dm/dm.go+++ b/backend/plugin/db/dm/dm.go@@ -108,11 +108,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOif err != nil {return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(singleSQL.FirstStatementLine),Column: int32(singleSQL.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(singleSQL.LastLine),Column: int32(singleSQL.LastColumn),},diff --git a/backend/plugin/db/driver.go b/backend/plugin/db/driver.goindex d9ea9df07b..d8bdc0ba67 100644--- a/backend/plugin/db/driver.go+++ b/backend/plugin/db/driver.go@@ -358,8 +358,8 @@ func (o *ExecuteOptions) LogTransactionControl(t storepb.TaskRunLog_TransactionC// ErrorWithPosition is the error with the position information.type ErrorWithPosition struct {Err error- Start *storepb.TaskRunResult_Position- End *storepb.TaskRunResult_Position+ Start *storepb.Position+ End *storepb.Position}func (e *ErrorWithPosition) Error() string {diff --git a/backend/plugin/db/dynamodb/dynamodb.go b/backend/plugin/db/dynamodb/dynamodb.goindex fed04dfe1f..91530bbdcd 100644--- a/backend/plugin/db/dynamodb/dynamodb.go+++ b/backend/plugin/db/dynamodb/dynamodb.go@@ -115,11 +115,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOif err != nil {return 0, &db.ErrorWithPosition{Err: errors.Wrap(err, "failed to execute statement"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(statement.FirstStatementLine),Column: int32(statement.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(statement.LastLine),Column: int32(statement.LastColumn),},diff --git a/backend/plugin/db/mysql/mysql.go b/backend/plugin/db/mysql/mysql.goindex 77fcd2070f..be35ebeca9 100644--- a/backend/plugin/db/mysql/mysql.go+++ b/backend/plugin/db/mysql/mysql.go@@ -351,11 +351,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOreturn &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(command.FirstStatementLine),Column: int32(command.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(command.LastLine),Column: int32(command.LastColumn),},diff --git a/backend/plugin/db/obo/obo.go b/backend/plugin/db/obo/obo.goindex d2317379ab..b9cb42047e 100644--- a/backend/plugin/db/obo/obo.go+++ b/backend/plugin/db/obo/obo.go@@ -110,11 +110,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOif err != nil {return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(singleSQL.FirstStatementLine),Column: int32(singleSQL.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(singleSQL.LastLine),Column: int32(singleSQL.LastColumn),},diff --git a/backend/plugin/db/oracle/oracle.go b/backend/plugin/db/oracle/oracle.goindex 3ce064eb9b..5cb86936be 100644--- a/backend/plugin/db/oracle/oracle.go+++ b/backend/plugin/db/oracle/oracle.go@@ -171,11 +171,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOopts.LogCommandResponse(indexes, 0, nil, err.Error())return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(command.FirstStatementLine),Column: int32(command.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(command.LastLine),Column: int32(command.LastColumn),},diff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.goindex c5f5d0319d..0f3e30d74f 100644--- a/backend/plugin/db/pg/pg.go+++ b/backend/plugin/db/pg/pg.go@@ -494,11 +494,11 @@ func (d *Driver) tryExecute(return &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(command.FirstStatementLine),Column: int32(command.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(command.LastLine),Column: int32(command.LastColumn),},diff --git a/backend/plugin/db/redshift/redshift.go b/backend/plugin/db/redshift/redshift.goindex 855b5f6f23..bfd4e668de 100644--- a/backend/plugin/db/redshift/redshift.go+++ b/backend/plugin/db/redshift/redshift.go@@ -205,11 +205,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOif err != nil {return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(command.FirstStatementLine),Column: int32(command.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(command.LastLine),Column: int32(command.LastColumn),},diff --git a/backend/plugin/db/risingwave/risingwave.go b/backend/plugin/db/risingwave/risingwave.goindex 2ac2e53a06..9f901effbb 100644--- a/backend/plugin/db/risingwave/risingwave.go+++ b/backend/plugin/db/risingwave/risingwave.go@@ -234,11 +234,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOif err != nil {return 0, &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(command.FirstStatementLine),Column: int32(command.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(command.LastLine),Column: int32(command.LastColumn),},diff --git a/backend/plugin/db/tidb/tidb.go b/backend/plugin/db/tidb/tidb.goindex adcdef016b..f66b76984f 100644--- a/backend/plugin/db/tidb/tidb.go+++ b/backend/plugin/db/tidb/tidb.go@@ -246,11 +246,11 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteOreturn &db.ErrorWithPosition{Err: errors.Wrapf(err, "failed to execute context in a transaction"),- Start: &storepb.TaskRunResult_Position{+ Start: &storepb.Position{Line: int32(command.FirstStatementLine),Column: int32(command.FirstStatementColumn),},- End: &storepb.TaskRunResult_Position{+ End: &storepb.Position{Line: int32(command.LastLine),Column: int32(command.LastColumn),},diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.tsindex 1576d9993b..2fdf22f5e2 100644--- a/frontend/src/types/proto/google/protobuf/descriptor.ts+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts@@ -210,19 +210,11 @@ export interface FileDescriptorProto {* The supported values are "proto2", "proto3", and "editions".** If `edition` is present, this value must be "editions".- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.*/syntax?:| string| undefined;- /**- * The edition of the proto file.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** The edition of the proto file. */edition?: Edition | undefined;}@@ -939,12 +931,7 @@ export interface FileOptions {rubyPackage?:| string| undefined;- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?:| FeatureSet| undefined;@@ -1096,12 +1083,7 @@ export interface MessageOptions {deprecatedLegacyJsonFieldConflicts?:| boolean| undefined;- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?:| FeatureSet| undefined;@@ -1206,12 +1188,7 @@ export interface FieldOptions {retention?: FieldOptions_OptionRetention | undefined;targets: FieldOptions_OptionTargetType[];editionDefaults: FieldOptions_EditionDefault[];- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?: FeatureSet | undefined;featureSupport?:| FieldOptions_FeatureSupport@@ -1547,12 +1524,7 @@ export interface FieldOptions_FeatureSupport {}export interface OneofOptions {- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?:| FeatureSet| undefined;@@ -1590,12 +1562,7 @@ export interface EnumOptions {deprecatedLegacyJsonFieldConflicts?:| boolean| undefined;- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?:| FeatureSet| undefined;@@ -1613,12 +1580,7 @@ export interface EnumValueOptions {deprecated?:| boolean| undefined;- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?:| FeatureSet| undefined;@@ -1639,12 +1601,7 @@ export interface EnumValueOptions {}export interface ServiceOptions {- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?:| FeatureSet| undefined;@@ -1672,12 +1629,7 @@ export interface MethodOptions {idempotencyLevel?:| MethodOptions_IdempotencyLevel| undefined;- /**- * Any features defined in the specific edition.- * WARNING: This field should only be used by protobuf plugins or special- * cases like the proto compiler. Other uses are discouraged and- * developers should rely on the protoreflect APIs for their client language.- */+ /** Any features defined in the specific edition. */features?:| FeatureSet| undefined;@@ -1794,7 +1746,6 @@ export interface FeatureSet {utf8Validation?: FeatureSet_Utf8Validation | undefined;messageEncoding?: FeatureSet_MessageEncoding | undefined;jsonFormat?: FeatureSet_JsonFormat | undefined;- enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined;}export enum FeatureSet_FieldPresence {@@ -2123,59 +2074,6 @@ export function featureSet_JsonFormatToNumber(object: FeatureSet_JsonFormat): nu}}-export enum FeatureSet_EnforceNamingStyle {- ENFORCE_NAMING_STYLE_UNKNOWN = "ENFORCE_NAMING_STYLE_UNKNOWN",- STYLE2024 = "STYLE2024",- STYLE_LEGACY = "STYLE_LEGACY",- UNRECOGNIZED = "UNRECOGNIZED",-}--export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle {- switch (object) {- case 0:- case "ENFORCE_NAMING_STYLE_UNKNOWN":- return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;- case 1:- case "STYLE2024":- return FeatureSet_EnforceNamingStyle.STYLE2024;- case 2:- case "STYLE_LEGACY":- return FeatureSet_EnforceNamingStyle.STYLE_LEGACY;- case -1:- case "UNRECOGNIZED":- default:- return FeatureSet_EnforceNamingStyle.UNRECOGNIZED;- }-}--export function featureSet_EnforceNamingStyleToJSON(object: FeatureSet_EnforceNamingStyle): string {- switch (object) {- case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:- return "ENFORCE_NAMING_STYLE_UNKNOWN";- case FeatureSet_EnforceNamingStyle.STYLE2024:- return "STYLE2024";- case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:- return "STYLE_LEGACY";- case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:- default:- return "UNRECOGNIZED";- }-}--export function featureSet_EnforceNamingStyleToNumber(object: FeatureSet_EnforceNamingStyle): number {- switch (object) {- case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:- return 0;- case FeatureSet_EnforceNamingStyle.STYLE2024:- return 1;- case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:- return 2;- case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:- default:- return -1;- }-}-/*** A compiled specification for the defaults of a set of features. These* messages are generated from FeatureSet extensions and can be used to seed@@ -6262,7 +6160,6 @@ function createBaseFeatureSet(): FeatureSet {utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,- enforceNamingStyle: FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,};}@@ -6297,12 +6194,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat));}- if (- message.enforceNamingStyle !== undefined &&- message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN- ) {- writer.uint32(56).int32(featureSet_EnforceNamingStyleToNumber(message.enforceNamingStyle));- }return writer;},@@ -6361,14 +6252,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32());continue;}- case 7: {- if (tag !== 56) {- break;- }-- message.enforceNamingStyle = featureSet_EnforceNamingStyleFromJSON(reader.int32());- continue;- }}if ((tag & 7) === 4 || tag === 0) {break;@@ -6398,9 +6281,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {jsonFormat: isSet(object.jsonFormat)? featureSet_JsonFormatFromJSON(object.jsonFormat): FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,- enforceNamingStyle: isSet(object.enforceNamingStyle)- ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle)- : FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,};},@@ -6435,12 +6315,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat);}- if (- message.enforceNamingStyle !== undefined &&- message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN- ) {- obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle);- }return obj;},@@ -6456,8 +6330,6 @@ export const FeatureSet: MessageFns<FeatureSet> = {message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;- message.enforceNamingStyle = object.enforceNamingStyle ??- FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;return message;},};diff --git a/frontend/src/types/proto/google/protobuf/wrappers.ts b/frontend/src/types/proto/google/protobuf/wrappers.tsindex bb730b69e5..07224c0f85 100644--- a/frontend/src/types/proto/google/protobuf/wrappers.ts+++ b/frontend/src/types/proto/google/protobuf/wrappers.ts@@ -14,9 +14,6 @@ export const protobufPackage = "google.protobuf";* Wrapper message for `double`.** The JSON representation for `DoubleValue` is JSON number.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface DoubleValue {/** The double value. */@@ -27,9 +24,6 @@ export interface DoubleValue {* Wrapper message for `float`.** The JSON representation for `FloatValue` is JSON number.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface FloatValue {/** The float value. */@@ -40,9 +34,6 @@ export interface FloatValue {* Wrapper message for `int64`.** The JSON representation for `Int64Value` is JSON string.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface Int64Value {/** The int64 value. */@@ -53,9 +44,6 @@ export interface Int64Value {* Wrapper message for `uint64`.** The JSON representation for `UInt64Value` is JSON string.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface UInt64Value {/** The uint64 value. */@@ -66,9 +54,6 @@ export interface UInt64Value {* Wrapper message for `int32`.** The JSON representation for `Int32Value` is JSON number.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface Int32Value {/** The int32 value. */@@ -79,9 +64,6 @@ export interface Int32Value {* Wrapper message for `uint32`.** The JSON representation for `UInt32Value` is JSON number.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface UInt32Value {/** The uint32 value. */@@ -92,9 +74,6 @@ export interface UInt32Value {* Wrapper message for `bool`.** The JSON representation for `BoolValue` is JSON `true` and `false`.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface BoolValue {/** The bool value. */@@ -105,9 +84,6 @@ export interface BoolValue {* Wrapper message for `string`.** The JSON representation for `StringValue` is JSON string.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface StringValue {/** The string value. */@@ -118,9 +94,6 @@ export interface StringValue {* Wrapper message for `bytes`.** The JSON representation for `BytesValue` is JSON string.- *- * Not recommended for use in new APIs, but still useful for legacy APIs and- * has no plan to be removed.*/export interface BytesValue {/** The bytes value. */diff --git a/frontend/src/types/proto/store/task_run.ts b/frontend/src/types/proto/store/task_run.tsindex 3eb60aa25c..f4c3b261e7 100644--- a/frontend/src/types/proto/store/task_run.ts+++ b/frontend/src/types/proto/store/task_run.ts@@ -17,9 +17,10 @@ export interface TaskRunResult {/** Format: instances/{instance}/databases/{database}/changelogs/{changelog} */changelog: string;version: string;- startPosition: TaskRunResult_Position | undefined;+ /** The following fields are used for error reporting. */+ startPosition: Position | undefined;endPosition:- | TaskRunResult_Position+ | Position| undefined;/** The uid of the export archive. */exportArchiveUid: number;@@ -27,15 +28,6 @@ export interface TaskRunResult {priorBackupDetail: PriorBackupDetail | undefined;}-/**- * The following fields are used for error reporting.- * TODO(zp): Use common Position instead.- */-export interface TaskRunResult_Position {- line: number;- column: number;-}-export interface PriorBackupDetail {items: PriorBackupDetail_Item[];}@@ -95,10 +87,10 @@ export const TaskRunResult: MessageFns<TaskRunResult> = {writer.uint32(26).string(message.version);}if (message.startPosition !== undefined) {- TaskRunResult_Position.encode(message.startPosition, writer.uint32(34).fork()).join();+ Position.encode(message.startPosition, writer.uint32(34).fork()).join();}if (message.endPosition !== undefined) {- TaskRunResult_Position.encode(message.endPosition, writer.uint32(42).fork()).join();+ Position.encode(message.endPosition, writer.uint32(42).fork()).join();}if (message.exportArchiveUid !== 0) {writer.uint32(48).int32(message.exportArchiveUid);@@ -145,7 +137,7 @@ export const TaskRunResult: MessageFns<TaskRunResult> = {break;}- message.startPosition = TaskRunResult_Position.decode(reader, reader.uint32());+ message.startPosition = Position.decode(reader, reader.uint32());continue;}case 5: {@@ -153,7 +145,7 @@ export const TaskRunResult: MessageFns<TaskRunResult> = {break;}- message.endPosition = TaskRunResult_Position.decode(reader, reader.uint32());+ message.endPosition = Position.decode(reader, reader.uint32());continue;}case 6: {@@ -186,8 +178,8 @@ export const TaskRunResult: MessageFns<TaskRunResult> = {detail: isSet(object.detail) ? globalThis.String(object.detail) : "",changelog: isSet(object.changelog) ? globalThis.String(object.changelog) : "",version: isSet(object.version) ? globalThis.String(object.version) : "",- startPosition: isSet(object.startPosition) ? TaskRunResult_Position.fromJSON(object.startPosition) : undefined,- endPosition: isSet(object.endPosition) ? TaskRunResult_Position.fromJSON(object.endPosition) : undefined,+ startPosition: isSet(object.startPosition) ? Position.fromJSON(object.startPosition) : undefined,+ endPosition: isSet(object.endPosition) ? Position.fromJSON(object.endPosition) : undefined,exportArchiveUid: isSet(object.exportArchiveUid) ? globalThis.Number(object.exportArchiveUid) : 0,priorBackupDetail: isSet(object.priorBackupDetail)? PriorBackupDetail.fromJSON(object.priorBackupDetail)@@ -207,10 +199,10 @@ export const TaskRunResult: MessageFns<TaskRunResult> = {obj.version = message.version;}if (message.startPosition !== undefined) {- obj.startPosition = TaskRunResult_Position.toJSON(message.startPosition);+ obj.startPosition = Position.toJSON(message.startPosition);}if (message.endPosition !== undefined) {- obj.endPosition = TaskRunResult_Position.toJSON(message.endPosition);+ obj.endPosition = Position.toJSON(message.endPosition);}if (message.exportArchiveUid !== 0) {obj.exportArchiveUid = Math.round(message.exportArchiveUid);@@ -230,10 +222,10 @@ export const TaskRunResult: MessageFns<TaskRunResult> = {message.changelog = object.changelog ?? "";message.version = object.version ?? "";message.startPosition = (object.startPosition !== undefined && object.startPosition !== null)- ? TaskRunResult_Position.fromPartial(object.startPosition)+ ? Position.fromPartial(object.startPosition): undefined;message.endPosition = (object.endPosition !== undefined && object.endPosition !== null)- ? TaskRunResult_Position.fromPartial(object.endPosition)+ ? Position.fromPartial(object.endPosition): undefined;message.exportArchiveUid = object.exportArchiveUid ?? 0;message.priorBackupDetail = (object.priorBackupDetail !== undefined && object.priorBackupDetail !== null)@@ -243,82 +235,6 @@ export const TaskRunResult: MessageFns<TaskRunResult> = {},};-function createBaseTaskRunResult_Position(): TaskRunResult_Position {- return { line: 0, column: 0 };-}--export const TaskRunResult_Position: MessageFns<TaskRunResult_Position> = {- encode(message: TaskRunResult_Position, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {- if (message.line !== 0) {- writer.uint32(8).int32(message.line);- }- if (message.column !== 0) {- writer.uint32(16).int32(message.column);- }- return writer;- },-- decode(input: BinaryReader | Uint8Array, length?: number): TaskRunResult_Position {- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseTaskRunResult_Position();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1: {- if (tag !== 8) {- break;- }-- message.line = reader.int32();- continue;- }- case 2: {- if (tag !== 16) {- break;- }-- message.column = reader.int32();- continue;- }- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skip(tag & 7);- }- return message;- },-- fromJSON(object: any): TaskRunResult_Position {- return {- line: isSet(object.line) ? globalThis.Number(object.line) : 0,- column: isSet(object.column) ? globalThis.Number(object.column) : 0,- };- },-- toJSON(message: TaskRunResult_Position): unknown {- const obj: any = {};- if (message.line !== 0) {- obj.line = Math.round(message.line);- }- if (message.column !== 0) {- obj.column = Math.round(message.column);- }- return obj;- },-- create(base?: DeepPartial<TaskRunResult_Position>): TaskRunResult_Position {- return TaskRunResult_Position.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<TaskRunResult_Position>): TaskRunResult_Position {- const message = createBaseTaskRunResult_Position();- message.line = object.line ?? 0;- message.column = object.column ?? 0;- return message;- },-};-function createBasePriorBackupDetail(): PriorBackupDetail {return { items: [] };}diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 7e8684d81d..15c229bc6b 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -303,7 +303,6 @@- [SchedulerInfo](#bytebase-store-SchedulerInfo)- [SchedulerInfo.WaitingCause](#bytebase-store-SchedulerInfo-WaitingCause)- [TaskRunResult](#bytebase-store-TaskRunResult)- - [TaskRunResult.Position](#bytebase-store-TaskRunResult-Position)- [store/task_run_log.proto](#store_task_run_log-proto)- [TaskRunLog](#bytebase-store-TaskRunLog)@@ -4784,8 +4783,8 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.| detail | [string](#string) | | || changelog | [string](#string) | | Format: instances/{instance}/databases/{database}/changelogs/{changelog} || version | [string](#string) | | |-| start_position | [TaskRunResult.Position](#bytebase-store-TaskRunResult-Position) | | |-| end_position | [TaskRunResult.Position](#bytebase-store-TaskRunResult-Position) | | |+| start_position | [Position](#bytebase-store-Position) | | The following fields are used for error reporting. |+| end_position | [Position](#bytebase-store-Position) | | || export_archive_uid | [int32](#int32) | | The uid of the export archive. || prior_backup_detail | [PriorBackupDetail](#bytebase-store-PriorBackupDetail) | | The prior backup detail that will be used to rollback the task run. |@@ -4793,23 +4792,6 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.--<a name="bytebase-store-TaskRunResult-Position"></a>--### TaskRunResult.Position-The following fields are used for error reporting.-TODO(zp): Use common Position instead.---| Field | Type | Label | Description |-| ----- | ---- | ----- | ----------- |-| line | [int32](#int32) | | |-| column | [int32](#int32) | | |-----diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 146eee6ad2..b8c060391b 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -1405,10 +1405,6 @@<a href="#bytebase.store.TaskRunResult"><span class="badge">M</span>TaskRunResult</a></li>- <li>- <a href="#bytebase.store.TaskRunResult.Position"><span class="badge">M</span>TaskRunResult.Position</a>- </li>-@@ -12246,14 +12242,14 @@ Format: instances/{instance}/databases/{database} </p></td><tr><td>start_position</td>- <td><a href="#bytebase.store.TaskRunResult.Position">TaskRunResult.Position</a></td>+ <td><a href="#bytebase.store.Position">Position</a></td><td></td>- <td><p> </p></td>+ <td><p>The following fields are used for error reporting. </p></td></tr><tr><td>end_position</td>- <td><a href="#bytebase.store.TaskRunResult.Position">TaskRunResult.Position</a></td>+ <td><a href="#bytebase.store.Position">Position</a></td><td></td><td><p> </p></td></tr>@@ -12279,37 +12275,6 @@ Format: instances/{instance}/databases/{database} </p></td>- <h3 id="bytebase.store.TaskRunResult.Position">TaskRunResult.Position</h3>- <p>The following fields are used for error reporting.</p><p>TODO(zp): Use common Position instead.</p>--- <table class="field-table">- <thead>- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>- </thead>- <tbody>-- <tr>- <td>line</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-- <tr>- <td>column</td>- <td><a href="#int32">int32</a></td>- <td></td>- <td><p> </p></td>- </tr>-- </tbody>- </table>-----diff --git a/proto/generated-go/store/task_run.pb.go b/proto/generated-go/store/task_run.pb.goindex 56cf98a52e..a7244601b2 100644--- a/proto/generated-go/store/task_run.pb.go+++ b/proto/generated-go/store/task_run.pb.go@@ -26,10 +26,11 @@ type TaskRunResult struct {state protoimpl.MessageState `protogen:"open.v1"`Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"`// Format: instances/{instance}/databases/{database}/changelogs/{changelog}- Changelog string `protobuf:"bytes,8,opt,name=changelog,proto3" json:"changelog,omitempty"`- Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`- StartPosition *TaskRunResult_Position `protobuf:"bytes,4,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"`- EndPosition *TaskRunResult_Position `protobuf:"bytes,5,opt,name=end_position,json=endPosition,proto3" json:"end_position,omitempty"`+ Changelog string `protobuf:"bytes,8,opt,name=changelog,proto3" json:"changelog,omitempty"`+ Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`+ // The following fields are used for error reporting.+ StartPosition *Position `protobuf:"bytes,4,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"`+ EndPosition *Position `protobuf:"bytes,5,opt,name=end_position,json=endPosition,proto3" json:"end_position,omitempty"`// The uid of the export archive.ExportArchiveUid int32 `protobuf:"varint,6,opt,name=export_archive_uid,json=exportArchiveUid,proto3" json:"export_archive_uid,omitempty"`// The prior backup detail that will be used to rollback the task run.@@ -89,14 +90,14 @@ func (x *TaskRunResult) GetVersion() string {return ""}-func (x *TaskRunResult) GetStartPosition() *TaskRunResult_Position {+func (x *TaskRunResult) GetStartPosition() *Position {if x != nil {return x.StartPosition}return nil}-func (x *TaskRunResult) GetEndPosition() *TaskRunResult_Position {+func (x *TaskRunResult) GetEndPosition() *Position {if x != nil {return x.EndPosition}@@ -213,60 +214,6 @@ func (x *SchedulerInfo) GetWaitingCause() *SchedulerInfo_WaitingCause {return nil}-// The following fields are used for error reporting.-// TODO(zp): Use common Position instead.-type TaskRunResult_Position struct {- state protoimpl.MessageState `protogen:"open.v1"`- Line int32 `protobuf:"varint,1,opt,name=line,proto3" json:"line,omitempty"`- Column int32 `protobuf:"varint,2,opt,name=column,proto3" json:"column,omitempty"`- unknownFields protoimpl.UnknownFields- sizeCache protoimpl.SizeCache-}--func (x *TaskRunResult_Position) Reset() {- *x = TaskRunResult_Position{}- mi := &file_store_task_run_proto_msgTypes[3]- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- ms.StoreMessageInfo(mi)-}--func (x *TaskRunResult_Position) String() string {- return protoimpl.X.MessageStringOf(x)-}--func (*TaskRunResult_Position) ProtoMessage() {}--func (x *TaskRunResult_Position) ProtoReflect() protoreflect.Message {- mi := &file_store_task_run_proto_msgTypes[3]- if x != nil {- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))- if ms.LoadMessageInfo() == nil {- ms.StoreMessageInfo(mi)- }- return ms- }- return mi.MessageOf(x)-}--// Deprecated: Use TaskRunResult_Position.ProtoReflect.Descriptor instead.-func (*TaskRunResult_Position) Descriptor() ([]byte, []int) {- return file_store_task_run_proto_rawDescGZIP(), []int{0, 0}-}--func (x *TaskRunResult_Position) GetLine() int32 {- if x != nil {- return x.Line- }- return 0-}--func (x *TaskRunResult_Position) GetColumn() int32 {- if x != nil {- return x.Column- }- return 0-}-type PriorBackupDetail_Item struct {state protoimpl.MessageState `protogen:"open.v1"`// The original table information.@@ -281,7 +228,7 @@ type PriorBackupDetail_Item struct {func (x *PriorBackupDetail_Item) Reset() {*x = PriorBackupDetail_Item{}- mi := &file_store_task_run_proto_msgTypes[4]+ mi := &file_store_task_run_proto_msgTypes[3]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -293,7 +240,7 @@ func (x *PriorBackupDetail_Item) String() string {func (*PriorBackupDetail_Item) ProtoMessage() {}func (x *PriorBackupDetail_Item) ProtoReflect() protoreflect.Message {- mi := &file_store_task_run_proto_msgTypes[4]+ mi := &file_store_task_run_proto_msgTypes[3]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -350,7 +297,7 @@ type PriorBackupDetail_Item_Table struct {func (x *PriorBackupDetail_Item_Table) Reset() {*x = PriorBackupDetail_Item_Table{}- mi := &file_store_task_run_proto_msgTypes[5]+ mi := &file_store_task_run_proto_msgTypes[4]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -362,7 +309,7 @@ func (x *PriorBackupDetail_Item_Table) String() string {func (*PriorBackupDetail_Item_Table) ProtoMessage() {}func (x *PriorBackupDetail_Item_Table) ProtoReflect() protoreflect.Message {- mi := &file_store_task_run_proto_msgTypes[5]+ mi := &file_store_task_run_proto_msgTypes[4]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -412,7 +359,7 @@ type SchedulerInfo_WaitingCause struct {func (x *SchedulerInfo_WaitingCause) Reset() {*x = SchedulerInfo_WaitingCause{}- mi := &file_store_task_run_proto_msgTypes[6]+ mi := &file_store_task_run_proto_msgTypes[5]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -424,7 +371,7 @@ func (x *SchedulerInfo_WaitingCause) String() string {func (*SchedulerInfo_WaitingCause) ProtoMessage() {}func (x *SchedulerInfo_WaitingCause) ProtoReflect() protoreflect.Message {- mi := &file_store_task_run_proto_msgTypes[6]+ mi := &file_store_task_run_proto_msgTypes[5]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -485,18 +432,15 @@ var File_store_task_run_proto protoreflect.FileDescriptorconst file_store_task_run_proto_rawDesc = "" +"\n" +- "\x14store/task_run.proto\x12\x0ebytebase.store\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x12store/common.proto\"\xb2\x03\n" ++ "\x14store/task_run.proto\x12\x0ebytebase.store\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x12store/common.proto\"\xde\x02\n" +"\rTaskRunResult\x12\x16\n" +"\x06detail\x18\x01 \x01(\tR\x06detail\x12\x1c\n" +"\tchangelog\x18\b \x01(\tR\tchangelog\x12\x18\n" +- "\aversion\x18\x03 \x01(\tR\aversion\x12M\n" +- "\x0estart_position\x18\x04 \x01(\v2&.bytebase.store.TaskRunResult.PositionR\rstartPosition\x12I\n" +- "\fend_position\x18\x05 \x01(\v2&.bytebase.store.TaskRunResult.PositionR\vendPosition\x12,\n" ++ "\aversion\x18\x03 \x01(\tR\aversion\x12?\n" ++ "\x0estart_position\x18\x04 \x01(\v2\x18.bytebase.store.PositionR\rstartPosition\x12;\n" ++ "\fend_position\x18\x05 \x01(\v2\x18.bytebase.store.PositionR\vendPosition\x12,\n" +"\x12export_archive_uid\x18\x06 \x01(\x05R\x10exportArchiveUid\x12Q\n" +- "\x13prior_backup_detail\x18\a \x01(\v2!.bytebase.store.PriorBackupDetailR\x11priorBackupDetail\x1a6\n" +- "\bPosition\x12\x12\n" +- "\x04line\x18\x01 \x01(\x05R\x04line\x12\x16\n" +- "\x06column\x18\x02 \x01(\x05R\x06column\"\xcd\x03\n" ++ "\x13prior_backup_detail\x18\a \x01(\v2!.bytebase.store.PriorBackupDetailR\x11priorBackupDetail\"\xcd\x03\n" +"\x11PriorBackupDetail\x12<\n" +"\x05items\x18\x01 \x03(\v2&.bytebase.store.PriorBackupDetail.ItemR\x05items\x1a\xf9\x02\n" +"\x04Item\x12O\n" +@@ -529,29 +473,28 @@ func file_store_task_run_proto_rawDescGZIP() []byte {return file_store_task_run_proto_rawDescData}-var file_store_task_run_proto_msgTypes = make([]protoimpl.MessageInfo, 7)+var file_store_task_run_proto_msgTypes = make([]protoimpl.MessageInfo, 6)var file_store_task_run_proto_goTypes = []any{(*TaskRunResult)(nil), // 0: bytebase.store.TaskRunResult(*PriorBackupDetail)(nil), // 1: bytebase.store.PriorBackupDetail(*SchedulerInfo)(nil), // 2: bytebase.store.SchedulerInfo- (*TaskRunResult_Position)(nil), // 3: bytebase.store.TaskRunResult.Position- (*PriorBackupDetail_Item)(nil), // 4: bytebase.store.PriorBackupDetail.Item- (*PriorBackupDetail_Item_Table)(nil), // 5: bytebase.store.PriorBackupDetail.Item.Table- (*SchedulerInfo_WaitingCause)(nil), // 6: bytebase.store.SchedulerInfo.WaitingCause+ (*PriorBackupDetail_Item)(nil), // 3: bytebase.store.PriorBackupDetail.Item+ (*PriorBackupDetail_Item_Table)(nil), // 4: bytebase.store.PriorBackupDetail.Item.Table+ (*SchedulerInfo_WaitingCause)(nil), // 5: bytebase.store.SchedulerInfo.WaitingCause+ (*Position)(nil), // 6: bytebase.store.Position(*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp- (*Position)(nil), // 8: bytebase.store.Position}var file_store_task_run_proto_depIdxs = []int32{- 3, // 0: bytebase.store.TaskRunResult.start_position:type_name -> bytebase.store.TaskRunResult.Position- 3, // 1: bytebase.store.TaskRunResult.end_position:type_name -> bytebase.store.TaskRunResult.Position+ 6, // 0: bytebase.store.TaskRunResult.start_position:type_name -> bytebase.store.Position+ 6, // 1: bytebase.store.TaskRunResult.end_position:type_name -> bytebase.store.Position1, // 2: bytebase.store.TaskRunResult.prior_backup_detail:type_name -> bytebase.store.PriorBackupDetail- 4, // 3: bytebase.store.PriorBackupDetail.items:type_name -> bytebase.store.PriorBackupDetail.Item+ 3, // 3: bytebase.store.PriorBackupDetail.items:type_name -> bytebase.store.PriorBackupDetail.Item7, // 4: bytebase.store.SchedulerInfo.report_time:type_name -> google.protobuf.Timestamp- 6, // 5: bytebase.store.SchedulerInfo.waiting_cause:type_name -> bytebase.store.SchedulerInfo.WaitingCause- 5, // 6: bytebase.store.PriorBackupDetail.Item.source_table:type_name -> bytebase.store.PriorBackupDetail.Item.Table- 5, // 7: bytebase.store.PriorBackupDetail.Item.target_table:type_name -> bytebase.store.PriorBackupDetail.Item.Table- 8, // 8: bytebase.store.PriorBackupDetail.Item.start_position:type_name -> bytebase.store.Position- 8, // 9: bytebase.store.PriorBackupDetail.Item.end_position:type_name -> bytebase.store.Position+ 5, // 5: bytebase.store.SchedulerInfo.waiting_cause:type_name -> bytebase.store.SchedulerInfo.WaitingCause+ 4, // 6: bytebase.store.PriorBackupDetail.Item.source_table:type_name -> bytebase.store.PriorBackupDetail.Item.Table+ 4, // 7: bytebase.store.PriorBackupDetail.Item.target_table:type_name -> bytebase.store.PriorBackupDetail.Item.Table+ 6, // 8: bytebase.store.PriorBackupDetail.Item.start_position:type_name -> bytebase.store.Position+ 6, // 9: bytebase.store.PriorBackupDetail.Item.end_position:type_name -> bytebase.store.Position10, // [10:10] is the sub-list for method output_type10, // [10:10] is the sub-list for method input_type10, // [10:10] is the sub-list for extension type_name@@ -565,7 +508,7 @@ func file_store_task_run_proto_init() {return}file_store_common_proto_init()- file_store_task_run_proto_msgTypes[6].OneofWrappers = []any{+ file_store_task_run_proto_msgTypes[5].OneofWrappers = []any{(*SchedulerInfo_WaitingCause_ConnectionLimit)(nil),(*SchedulerInfo_WaitingCause_TaskUid)(nil),}@@ -575,7 +518,7 @@ func file_store_task_run_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_task_run_proto_rawDesc), len(file_store_task_run_proto_rawDesc)),NumEnums: 0,- NumMessages: 7,+ NumMessages: 6,NumExtensions: 0,NumServices: 0,},diff --git a/proto/store/task_run.proto b/proto/store/task_run.protoindex 2e693c2be1..37f0828de7 100644--- a/proto/store/task_run.proto+++ b/proto/store/task_run.proto@@ -14,11 +14,6 @@ message TaskRunResult {string version = 3;// The following fields are used for error reporting.- // TODO(zp): Use common Position instead.- message Position {- int32 line = 1;- int32 column = 2;- }Position start_position = 4;Position end_position = 5;