Skip to content

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

feat(proto): config sync databases in the instance options (#14678)

ecmadaod76f85c002a3
diff --git a/frontend/src/types/proto/store/instance.ts b/frontend/src/types/proto/store/instance.ts
index 9bb5c9b97f..1be538733c 100644
--- a/frontend/src/types/proto/store/instance.ts
+++ b/frontend/src/types/proto/store/instance.ts
@@ -23,6 +23,11 @@ export interface InstanceOptions {
* The default is 10 if the value is unset or zero.
*/
maximumConnections: number;
+ /**
+ * Enable sync for following databases in {schema}/{database} format.
+ * Default empty, means sync all schemas & databases.
+ */
+ syncDatabases: string[];
}
/** InstanceMetadata is the metadata for instances. */
@@ -57,7 +62,7 @@ export interface InstanceRole {
}
function createBaseInstanceOptions(): InstanceOptions {
- return { syncInterval: undefined, maximumConnections: 0 };
+ return { syncInterval: undefined, maximumConnections: 0, syncDatabases: [] };
}
export const InstanceOptions: MessageFns<InstanceOptions> = {
@@ -68,6 +73,9 @@ export const InstanceOptions: MessageFns<InstanceOptions> = {
if (message.maximumConnections !== 0) {
writer.uint32(24).int32(message.maximumConnections);
}
+ for (const v of message.syncDatabases) {
+ writer.uint32(34).string(v!);
+ }
return writer;
},
@@ -94,6 +102,14 @@ export const InstanceOptions: MessageFns<InstanceOptions> = {
message.maximumConnections = reader.int32();
continue;
}
+ case 4: {
+ if (tag !== 34) {
+ break;
+ }
+
+ message.syncDatabases.push(reader.string());
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -107,6 +123,9 @@ export const InstanceOptions: MessageFns<InstanceOptions> = {
return {
syncInterval: isSet(object.syncInterval) ? Duration.fromJSON(object.syncInterval) : undefined,
maximumConnections: isSet(object.maximumConnections) ? globalThis.Number(object.maximumConnections) : 0,
+ syncDatabases: globalThis.Array.isArray(object?.syncDatabases)
+ ? object.syncDatabases.map((e: any) => globalThis.String(e))
+ : [],
};
},
@@ -118,6 +137,9 @@ export const InstanceOptions: MessageFns<InstanceOptions> = {
if (message.maximumConnections !== 0) {
obj.maximumConnections = Math.round(message.maximumConnections);
}
+ if (message.syncDatabases?.length) {
+ obj.syncDatabases = message.syncDatabases;
+ }
return obj;
},
@@ -130,6 +152,7 @@ export const InstanceOptions: MessageFns<InstanceOptions> = {
? Duration.fromPartial(object.syncInterval)
: undefined;
message.maximumConnections = object.maximumConnections ?? 0;
+ message.syncDatabases = object.syncDatabases?.map((e) => e) || [];
return message;
},
};
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 0393404f14..55983cb05e 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -10882,6 +10882,13 @@ components:
The maximum number of connections.
The default is 10 if the value is unset or zero.
format: int32
+ syncDatabases:
+ type: array
+ items:
+ type: string
+ description: |-
+ Enable sync for following databases in {schema}/{database} format.
+ Default empty, means sync all schemas & databases.
description: InstanceOptions is the option for instances.
InstanceResource:
type: object
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 4ba73d3416..a680fead7a 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -2810,6 +2810,7 @@ InstanceOptions is the option for instances.
| ----- | ---- | ----- | ----------- |
| sync_interval | [google.protobuf.Duration](#google-protobuf-Duration) | | How often the instance is synced. |
| maximum_connections | [int32](#int32) | | The maximum number of connections. The default is 10 if the value is unset or zero. |
+| sync_databases | [string](#string) | repeated | Enable sync for following databases in {schema}/{database} format. Default empty, means sync all schemas &amp; databases. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index ea8f55a7b2..7d80f1ade4 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -7667,6 +7667,14 @@ It is used to determine whether the table names and database names are case sens
The default is 10 if the value is unset or zero. </p></td>
</tr>
+ <tr>
+ <td>sync_databases</td>
+ <td><a href="#string">string</a></td>
+ <td>repeated</td>
+ <td><p>Enable sync for following databases in {schema}/{database} format.
+Default empty, means sync all schemas &amp; databases. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/store/instance.pb.go b/proto/generated-go/store/instance.pb.go
index 5a2293afdd..d818a502d7 100644
--- a/proto/generated-go/store/instance.pb.go
+++ b/proto/generated-go/store/instance.pb.go
@@ -30,8 +30,11 @@ type InstanceOptions struct {
// The maximum number of connections.
// The default is 10 if the value is unset or zero.
MaximumConnections int32 `protobuf:"varint,3,opt,name=maximum_connections,json=maximumConnections,proto3" json:"maximum_connections,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // Enable sync for following databases in {schema}/{database} format.
+ // Default empty, means sync all schemas & databases.
+ SyncDatabases []string `protobuf:"bytes,4,rep,name=sync_databases,json=syncDatabases,proto3" json:"sync_databases,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *InstanceOptions) Reset() {
@@ -78,6 +81,13 @@ func (x *InstanceOptions) GetMaximumConnections() int32 {
return 0
}
+func (x *InstanceOptions) GetSyncDatabases() []string {
+ if x != nil {
+ return x.SyncDatabases
+ }
+ return nil
+}
+
// InstanceMetadata is the metadata for instances.
type InstanceMetadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -225,7 +235,7 @@ var file_store_instance_proto_rawDesc = []byte{
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
- 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74,
+ 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74,
0x61, 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x0d, 0x73,
0x79, 0x6e, 0x63, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
@@ -233,35 +243,38 @@ var file_store_instance_proto_rawDesc = []byte{
0x79, 0x6e, 0x63, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2f, 0x0a, 0x13, 0x6d,
0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75,
- 0x6d, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x04, 0x08, 0x01,
- 0x10, 0x02, 0x22, 0xc8, 0x01, 0x0a, 0x10, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d,
- 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x1c, 0x6d, 0x79, 0x73, 0x71, 0x6c,
- 0x5f, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c,
- 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x6d,
- 0x79, 0x73, 0x71, 0x6c, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x54, 0x61, 0x62,
- 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f,
- 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x6c, 0x61, 0x73,
- 0x74, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x72, 0x6f, 0x6c,
- 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e,
- 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0xce, 0x01,
- 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x12,
- 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0f,
- 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88,
- 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69,
- 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64,
- 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72,
- 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x09, 0x61,
- 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f,
- 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74,
- 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c,
- 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 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, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e,
+ 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x04,
+ 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xc8, 0x01, 0x0a, 0x10, 0x49, 0x6e,
+ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e,
+ 0x0a, 0x1c, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x63, 0x61,
+ 0x73, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x4c, 0x6f, 0x77, 0x65, 0x72,
+ 0x43, 0x61, 0x73, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x40,
+ 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+ 0x6d, 0x70, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65,
+ 0x12, 0x32, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
+ 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72,
+ 0x6f, 0x6c, 0x65, 0x73, 0x22, 0xce, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
+ 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01,
+ 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12,
+ 0x21, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01,
+ 0x28, 0x09, 0x48, 0x02, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x88,
+ 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 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,
}
var (
diff --git a/proto/store/instance.proto b/proto/store/instance.proto
index 4345c0ea03..cd384dc8d0 100644
--- a/proto/store/instance.proto
+++ b/proto/store/instance.proto
@@ -17,6 +17,10 @@ message InstanceOptions {
// The maximum number of connections.
// The default is 10 if the value is unset or zero.
int32 maximum_connections = 3;
+
+ // Enable sync for following databases in {schema}/{database} format.
+ // Default empty, means sync all schemas & databases.
+ repeated string sync_databases = 4;
}
// InstanceMetadata is the metadata for instances.