@@ -13,6 +13,8 @@ public struct User: ZeroTable, Codable, Hashable, Identifiable {
1313 // Relationships, filled when a query asks for them with `related`.
1414 public var createdIssues : [ Issue ] ?
1515 public var assignedIssues : [ Issue ] ?
16+ // The aggregates a query asked for in `related`; nil when it asked for none.
17+ public var aggregates : RelationshipAggregates < User > ?
1618
1719 public init (
1820 id : String ,
@@ -21,7 +23,8 @@ public struct User: ZeroTable, Codable, Hashable, Identifiable {
2123 avatar : String ,
2224 role : UserRole ,
2325 createdIssues : [ Issue ] ? = nil ,
24- assignedIssues : [ Issue ] ? = nil
26+ assignedIssues : [ Issue ] ? = nil ,
27+ aggregates : RelationshipAggregates < User > ? = nil
2528 ) {
2629 self . id = id
2730 self . login = login
@@ -30,6 +33,7 @@ public struct User: ZeroTable, Codable, Hashable, Identifiable {
3033 self . role = role
3134 self . createdIssues = createdIssues
3235 self . assignedIssues = assignedIssues
36+ self . aggregates = aggregates
3337 }
3438
3539 public static let tableName = " user "
@@ -55,6 +59,7 @@ public struct User: ZeroTable, Codable, Hashable, Identifiable {
5559 role = try entry . column ( " role " , 4 )
5660 createdIssues = try entry . relationship ( " createdIssues " )
5761 assignedIssues = try entry . relationship ( " assignedIssues " )
62+ aggregates = RelationshipAggregates ( entry : entry )
5863 }
5964
6065 public var columnValues : Row {
@@ -130,6 +135,8 @@ public struct Project: ZeroTable, Codable, Hashable, Identifiable {
130135 // Relationships, filled when a query asks for them with `related`.
131136 public var issues : [ Issue ] ?
132137 public var labels : [ Label ] ?
138+ // The aggregates a query asked for in `related`; nil when it asked for none.
139+ public var aggregates : RelationshipAggregates < Project > ?
133140
134141 public init (
135142 id : String ,
@@ -140,7 +147,8 @@ public struct Project: ZeroTable, Codable, Hashable, Identifiable {
140147 markURL : String ? = nil ,
141148 logoURL : String ? = nil ,
142149 issues : [ Issue ] ? = nil ,
143- labels : [ Label ] ? = nil
150+ labels : [ Label ] ? = nil ,
151+ aggregates : RelationshipAggregates < Project > ? = nil
144152 ) {
145153 self . id = id
146154 self . name = name
@@ -151,6 +159,7 @@ public struct Project: ZeroTable, Codable, Hashable, Identifiable {
151159 self . logoURL = logoURL
152160 self . issues = issues
153161 self . labels = labels
162+ self . aggregates = aggregates
154163 }
155164
156165 public static let tableName = " project "
@@ -180,6 +189,7 @@ public struct Project: ZeroTable, Codable, Hashable, Identifiable {
180189 logoURL = try entry . column ( " logoURL " , 6 )
181190 issues = try entry . relationship ( " issues " )
182191 labels = try entry . relationship ( " labels " )
192+ aggregates = RelationshipAggregates ( entry : entry )
183193 }
184194
185195 public var columnValues : Row {
@@ -276,6 +286,8 @@ public struct Issue: ZeroTable, Codable, Hashable, Identifiable {
276286 public var viewState : [ ViewState ] ?
277287 public var emoji : [ Emoji ] ?
278288 @ Indirect public var notificationState : IssueNotifications ?
289+ // The aggregates a query asked for in `related`; nil when it asked for none.
290+ public var aggregates : RelationshipAggregates < Issue > ?
279291
280292 public init (
281293 id : String ,
@@ -297,7 +309,8 @@ public struct Issue: ZeroTable, Codable, Hashable, Identifiable {
297309 assignee : User ? = nil ,
298310 viewState : [ ViewState ] ? = nil ,
299311 emoji : [ Emoji ] ? = nil ,
300- notificationState : IssueNotifications ? = nil
312+ notificationState : IssueNotifications ? = nil ,
313+ aggregates : RelationshipAggregates < Issue > ? = nil
301314 ) {
302315 self . id = id
303316 self . shortID = shortID
@@ -319,6 +332,7 @@ public struct Issue: ZeroTable, Codable, Hashable, Identifiable {
319332 self . viewState = viewState
320333 self . emoji = emoji
321334 self . notificationState = notificationState
335+ self . aggregates = aggregates
322336 }
323337
324338 public static let tableName = " issue "
@@ -370,6 +384,7 @@ public struct Issue: ZeroTable, Codable, Hashable, Identifiable {
370384 viewState = try entry . relationship ( " viewState " )
371385 emoji = try entry . relationship ( " emoji " )
372386 notificationState = try entry . relationship ( " notificationState " )
387+ aggregates = RelationshipAggregates ( entry : entry )
373388 }
374389
375390 public var columnValues : Row {
@@ -474,6 +489,8 @@ public struct Comment: ZeroTable, Codable, Hashable, Identifiable {
474489 @ Indirect public var creator : User ?
475490 public var emoji : [ Emoji ] ?
476491 @ Indirect public var issue : Issue ?
492+ // The aggregates a query asked for in `related`; nil when it asked for none.
493+ public var aggregates : RelationshipAggregates < Comment > ?
477494
478495 public init (
479496 id : String ,
@@ -483,7 +500,8 @@ public struct Comment: ZeroTable, Codable, Hashable, Identifiable {
483500 creatorID : String ,
484501 creator : User ? = nil ,
485502 emoji : [ Emoji ] ? = nil ,
486- issue : Issue ? = nil
503+ issue : Issue ? = nil ,
504+ aggregates : RelationshipAggregates < Comment > ? = nil
487505 ) {
488506 self . id = id
489507 self . issueID = issueID
@@ -493,6 +511,7 @@ public struct Comment: ZeroTable, Codable, Hashable, Identifiable {
493511 self . creator = creator
494512 self . emoji = emoji
495513 self . issue = issue
514+ self . aggregates = aggregates
496515 }
497516
498517 public static let tableName = " comment "
@@ -520,6 +539,7 @@ public struct Comment: ZeroTable, Codable, Hashable, Identifiable {
520539 creator = try entry . relationship ( " creator " )
521540 emoji = try entry . relationship ( " emoji " )
522541 issue = try entry . relationship ( " issue " )
542+ aggregates = RelationshipAggregates ( entry : entry )
523543 }
524544
525545 public var columnValues : Row {
@@ -590,17 +610,21 @@ public struct Label: ZeroTable, Codable, Hashable, Identifiable {
590610
591611 // Relationships, filled when a query asks for them with `related`.
592612 @ Indirect public var project : Project ?
613+ // The aggregates a query asked for in `related`; nil when it asked for none.
614+ public var aggregates : RelationshipAggregates < Label > ?
593615
594616 public init (
595617 id : String ,
596618 name : String ,
597619 projectID : String ,
598- project : Project ? = nil
620+ project : Project ? = nil ,
621+ aggregates : RelationshipAggregates < Label > ? = nil
599622 ) {
600623 self . id = id
601624 self . name = name
602625 self . projectID = projectID
603626 self . project = project
627+ self . aggregates = aggregates
604628 }
605629
606630 public static let tableName = " label "
@@ -620,6 +644,7 @@ public struct Label: ZeroTable, Codable, Hashable, Identifiable {
620644 name = try entry . column ( " name " , 1 )
621645 projectID = try entry . column ( " projectID " , 2 )
622646 project = try entry . relationship ( " project " )
647+ aggregates = RelationshipAggregates ( entry : entry )
623648 }
624649
625650 public var columnValues : Row {
@@ -681,19 +706,23 @@ public struct IssueLabel: ZeroTable, Codable, Hashable {
681706 // Relationships, filled when a query asks for them with `related`.
682707 @ Indirect public var issue : Issue ?
683708 @ Indirect public var label : Label ?
709+ // The aggregates a query asked for in `related`; nil when it asked for none.
710+ public var aggregates : RelationshipAggregates < IssueLabel > ?
684711
685712 public init (
686713 issueID : String ,
687714 labelID : String ,
688715 projectID : String ,
689716 issue : Issue ? = nil ,
690- label : Label ? = nil
717+ label : Label ? = nil ,
718+ aggregates : RelationshipAggregates < IssueLabel > ? = nil
691719 ) {
692720 self . issueID = issueID
693721 self . labelID = labelID
694722 self . projectID = projectID
695723 self . issue = issue
696724 self . label = label
725+ self . aggregates = aggregates
697726 }
698727
699728 public static let tableName = " issueLabel "
@@ -715,6 +744,7 @@ public struct IssueLabel: ZeroTable, Codable, Hashable {
715744 projectID = try entry . column ( " projectID " , 2 )
716745 issue = try entry . relationship ( " issue " )
717746 label = try entry . relationship ( " label " )
747+ aggregates = RelationshipAggregates ( entry : entry )
718748 }
719749
720750 public var columnValues : Row {
@@ -870,6 +900,8 @@ public struct Emoji: ZeroTable, Codable, Hashable, Identifiable {
870900 @ Indirect public var creator : User ?
871901 @ Indirect public var issue : Issue ?
872902 @ Indirect public var comment : Comment ?
903+ // The aggregates a query asked for in `related`; nil when it asked for none.
904+ public var aggregates : RelationshipAggregates < Emoji > ?
873905
874906 public init (
875907 id : String ,
@@ -880,7 +912,8 @@ public struct Emoji: ZeroTable, Codable, Hashable, Identifiable {
880912 created : Double ,
881913 creator : User ? = nil ,
882914 issue : Issue ? = nil ,
883- comment : Comment ? = nil
915+ comment : Comment ? = nil ,
916+ aggregates : RelationshipAggregates < Emoji > ? = nil
884917 ) {
885918 self . id = id
886919 self . value = value
@@ -891,6 +924,7 @@ public struct Emoji: ZeroTable, Codable, Hashable, Identifiable {
891924 self . creator = creator
892925 self . issue = issue
893926 self . comment = comment
927+ self . aggregates = aggregates
894928 }
895929
896930 public static let tableName = " emoji "
@@ -920,6 +954,7 @@ public struct Emoji: ZeroTable, Codable, Hashable, Identifiable {
920954 creator = try entry . relationship ( " creator " )
921955 issue = try entry . relationship ( " issue " )
922956 comment = try entry . relationship ( " comment " )
957+ aggregates = RelationshipAggregates ( entry : entry )
923958 }
924959
925960 public var columnValues : Row {
0 commit comments