Skip to content

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

feat: add row_count to changeResourcesTable (#10619)

p0nycf199961b5cb
diff --git a/frontend/src/types/proto/store/instance_change_history.ts b/frontend/src/types/proto/store/instance_change_history.ts
index 36fd19c59a..afa70a2b58 100644
--- a/frontend/src/types/proto/store/instance_change_history.ts
+++ b/frontend/src/types/proto/store/instance_change_history.ts
@@ -26,6 +26,8 @@ export interface ChangedResourceSchema {
export interface ChangedResourceTable {
name: string;
+ /** estimated row count of the table */
+ tableRows: Long;
}
function createBaseInstanceChangeHistoryPayload(): InstanceChangeHistoryPayload {
@@ -320,7 +322,7 @@ export const ChangedResourceSchema = {
};
function createBaseChangedResourceTable(): ChangedResourceTable {
- return { name: "" };
+ return { name: "", tableRows: Long.ZERO };
}
export const ChangedResourceTable = {
@@ -328,6 +330,9 @@ export const ChangedResourceTable = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
+ if (!message.tableRows.isZero()) {
+ writer.uint32(16).int64(message.tableRows);
+ }
return writer;
},
@@ -345,6 +350,13 @@ export const ChangedResourceTable = {
message.name = reader.string();
continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.tableRows = reader.int64() as Long;
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -355,7 +367,10 @@ export const ChangedResourceTable = {
},
fromJSON(object: any): ChangedResourceTable {
- return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ tableRows: isSet(object.tableRows) ? Long.fromValue(object.tableRows) : Long.ZERO,
+ };
},
toJSON(message: ChangedResourceTable): unknown {
@@ -363,6 +378,9 @@ export const ChangedResourceTable = {
if (message.name !== "") {
obj.name = message.name;
}
+ if (!message.tableRows.isZero()) {
+ obj.tableRows = (message.tableRows || Long.ZERO).toString();
+ }
return obj;
},
@@ -372,6 +390,9 @@ export const ChangedResourceTable = {
fromPartial(object: DeepPartial<ChangedResourceTable>): ChangedResourceTable {
const message = createBaseChangedResourceTable();
message.name = object.name ?? "";
+ message.tableRows = (object.tableRows !== undefined && object.tableRows !== null)
+ ? Long.fromValue(object.tableRows)
+ : Long.ZERO;
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 4a8acdf179..a9cbeb5a8f 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -1671,6 +1671,7 @@ InstanceOptions is the option for instances.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | |
+| table_rows | [int64](#int64) | | estimated row count of the table |
diff --git a/proto/generated-go/store/instance_change_history.pb.go b/proto/generated-go/store/instance_change_history.pb.go
index 18964d3bc8..3751814653 100644
--- a/proto/generated-go/store/instance_change_history.pb.go
+++ b/proto/generated-go/store/instance_change_history.pb.go
@@ -238,6 +238,8 @@ type ChangedResourceTable struct {
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // estimated row count of the table
+ TableRows int64 `protobuf:"varint,2,opt,name=table_rows,json=tableRows,proto3" json:"table_rows,omitempty"`
}
func (x *ChangedResourceTable) Reset() {
@@ -279,6 +281,13 @@ func (x *ChangedResourceTable) GetName() string {
return ""
}
+func (x *ChangedResourceTable) GetTableRows() int64 {
+ if x != nil {
+ return x.TableRows
+ }
+ return 0
+}
+
var File_store_instance_change_history_proto protoreflect.FileDescriptor
var file_store_instance_change_history_proto_rawDesc = []byte{
@@ -316,11 +325,13 @@ var file_store_instance_change_history_proto_rawDesc = []byte{
0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06,
- 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x2a, 0x0a, 0x14, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
+ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x49, 0x0a, 0x14, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d,
- 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x6f, 0x77, 0x73,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x6f, 0x77,
+ 0x73, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67,
+ 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/store/instance_change_history.proto b/proto/store/instance_change_history.proto
index 6837f8e0a0..a1ded4cc0b 100644
--- a/proto/store/instance_change_history.proto
+++ b/proto/store/instance_change_history.proto
@@ -30,4 +30,7 @@ message ChangedResourceSchema {
message ChangedResourceTable {
string name = 1;
+
+ // estimated row count of the table
+ int64 table_rows = 2;
}