File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Sources/StructuredQueriesCore
Tests/StructuredQueriesTests Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ extension Optional: Table where Wrapped: Table {
114114 Member ? . some ( Wrapped . columns [ keyPath: keyPath] )
115115 }
116116
117+ @_disfavoredOverload
117118 public subscript< QueryValue> (
118119 dynamicMember keyPath: KeyPath < Wrapped . TableColumns , some QueryExpression < QueryValue ? > >
119120 ) -> some QueryExpression < QueryValue ? > {
Original file line number Diff line number Diff line change @@ -19,3 +19,21 @@ private var remindersQuery: some Statement<ReminderRow> {
1919 )
2020 }
2121}
22+
23+ @Table
24+ private struct Foo {
25+ var id : Int
26+ var barId : Int ?
27+ }
28+ @Table
29+ private struct Bar {
30+ var id : Int
31+ var baz : String ?
32+ }
33+ func dynamicMemberLookup( ) {
34+ _ = Foo . all
35+ . leftJoin ( Bar . all) { $0. barId. eq ( $1. id) }
36+ . where { f, b in
37+ b. baz. is ( nil )
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments