Skip to content

Commit ea11803

Browse files
committed
feat: Add experimental count relationships by filter to Materialize API
1 parent 5253a15 commit ea11803

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
syntax = "proto3";
2+
package authzed.api.materialize.v0;
3+
4+
import "buf/validate/validate.proto";
5+
import "validate/validate.proto";
6+
import "authzed/api/v1/core.proto";
7+
import "authzed/api/v1/permission_service.proto";
8+
9+
option go_package = "github.com/authzed/authzed-go/proto/authzed/api/materialize/v0";
10+
option java_multiple_files = true;
11+
option java_package = "com.authzed.api.materialize.v0";
12+
13+
service RelationshipsService {
14+
// EXPERIMENTAL: CountRelationships returns the count of relationships for a given filter.
15+
rpc ExperimentalCountRelationshipsByFilter(ExperimentalCountRelationshipsByFilterRequest) returns (ExperimentalCountRelationshipsByFilterResponse) {}
16+
}
17+
18+
message ExperimentalCountRelationshipsByFilterRequest {
19+
// relationship_filter specifies the filter to apply when counting relationships.
20+
authzed.api.v1.RelationshipFilter relationship_filter = 1 [
21+
(validate.rules).message.required = true,
22+
(buf.validate.field).required = true
23+
];
24+
}
25+
26+
message ExperimentalCountRelationshipsByFilterResponse {
27+
// relationship_count is the count of relationships that match the filter.
28+
uint64 relationship_count = 1;
29+
30+
// read_at is the ZedToken at which the relationship count applies.
31+
authzed.api.v1.ZedToken read_at = 2 [
32+
(validate.rules).message.required = true,
33+
(buf.validate.field).required = true
34+
];
35+
}

0 commit comments

Comments
 (0)