We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TableDefinition
1 parent 388c255 commit 5c17024Copy full SHA for 5c17024
Sources/StructuredQueriesCore/TableDefinition.swift
@@ -15,4 +15,14 @@ extension TableDefinition {
15
public var queryFragment: QueryFragment {
16
Self.allColumns.map(\.queryFragment).joined(separator: ", ")
17
}
18
+
19
+ // NB: Without this identity subscript, a more confusing error is produced for missing columns:
20
+ //
21
+ // > Referencing subscript 'subscript(dynamicMember:)' on 'TableDefinition' requires that 'T'
22
+ // > conform to 'TableDraft'
23
+ public subscript<Member>(
24
+ dynamicMember keyPath: KeyPath<Self, Member>
25
+ ) -> Member {
26
+ self[keyPath: keyPath]
27
+ }
28
0 commit comments