44/// to generate values of this type.
55@dynamicMemberLookup
66public struct ColumnGroup < Root: Table , Values: Table > : _TableColumnExpression
7- where Values. QueryOutput == Values {
7+ where Values. QueryOutput: Table {
88 public typealias Value = Values
99
1010 public var _names : [ String ] { Values . TableColumns. allColumns. map ( \. name) }
1111
1212 public typealias QueryValue = Values
1313
14- public let keyPath : KeyPath < Root , Values >
14+ public let keyPath : KeyPath < Root , Values . QueryOutput >
1515
16- public init ( keyPath: KeyPath < Root , Values > ) {
16+ public init ( keyPath: KeyPath < Root , Values . QueryOutput > ) {
1717 self . keyPath = keyPath
1818 }
1919
@@ -22,7 +22,7 @@ where Values.QueryOutput == Values {
2222 }
2323
2424 public subscript< Member> (
25- dynamicMember keyPath: KeyPath < Values . TableColumns , TableColumn < Values , Member > >
25+ dynamicMember keyPath: KeyPath < Values . TableColumns , TableColumn < Values . QueryOutput , Member > >
2626 ) -> TableColumn < Root , Member > {
2727 let column = Values . columns [ keyPath: keyPath]
2828 return TableColumn < Root , Member > (
@@ -33,7 +33,7 @@ where Values.QueryOutput == Values {
3333 }
3434
3535 public subscript< Member> (
36- dynamicMember keyPath: KeyPath < Values . TableColumns , GeneratedColumn < Values , Member > >
36+ dynamicMember keyPath: KeyPath < Values . TableColumns , GeneratedColumn < Values . QueryOutput , Member > >
3737 ) -> GeneratedColumn < Root , Member > {
3838 let column = Values . columns [ keyPath: keyPath]
3939 return GeneratedColumn < Root , Member > (
@@ -44,7 +44,7 @@ where Values.QueryOutput == Values {
4444 }
4545
4646 public subscript< Member> (
47- dynamicMember keyPath: KeyPath < Values . TableColumns , ColumnGroup < Values , Member > >
47+ dynamicMember keyPath: KeyPath < Values . TableColumns , ColumnGroup < Values . QueryOutput , Member > >
4848 ) -> ColumnGroup < Root , Member > {
4949 let column = Values . columns [ keyPath: keyPath]
5050 return ColumnGroup < Root , Member > (
@@ -53,12 +53,12 @@ where Values.QueryOutput == Values {
5353 }
5454
5555 public var _allColumns : [ any TableColumnExpression ] {
56- Values . TableColumns. allColumns. map { column in
56+ Values . QueryOutput . TableColumns. allColumns. map { column in
5757 func open< R, V> (
5858 _ column: some TableColumnExpression < R , V >
5959 ) -> any TableColumnExpression {
6060 let keyPath = keyPath. appending (
61- path: unsafeDowncast ( column. keyPath, to: KeyPath< Values, V . QueryOutput> . self )
61+ path: unsafeDowncast ( column. keyPath, to: KeyPath< Values . QueryOutput , V . QueryOutput> . self )
6262 )
6363 return TableColumn < Root , V > (
6464 column. name,
@@ -71,12 +71,12 @@ where Values.QueryOutput == Values {
7171 }
7272
7373 public var _writableColumns : [ any WritableTableColumnExpression ] {
74- Values . TableColumns. writableColumns. map { column in
74+ Values . QueryOutput . TableColumns. writableColumns. map { column in
7575 func open< R, V> (
7676 _ column: some WritableTableColumnExpression < R , V >
7777 ) -> any WritableTableColumnExpression {
7878 let keyPath = keyPath. appending (
79- path: unsafeDowncast ( column. keyPath, to: KeyPath< Values, V . QueryOutput> . self )
79+ path: unsafeDowncast ( column. keyPath, to: KeyPath< Values . QueryOutput , V . QueryOutput> . self )
8080 )
8181 return TableColumn < Root , V > (
8282 column. name,
0 commit comments