SelectionRequest.annotated(with:)

This commit is contained in:
Gwendal Roué committed 2019-05-21 08:05:07 +02:00
1 parent e163b91cf0
commit a4a26e01e7
5 files changed
+95 -2

No files matched your search

@@ -513,6 +513,26 @@ extension TableRecord {
return all().select(literal: sqlLiteral, as: type)
}
/// Creates a request which appends *selection*.
///
/// // SELECT id, email, name FROM player
/// le request = Player
/// .select([Column("id"), Column("email")])
/// .annotated(with: [Column("name")])
public static func annotated(with selection: [SQLSelectable]) -> QueryInterfaceRequest<Self> {
return all().annotated(with: selection)
}
/// Creates a request which appends *selection*.
///
/// // SELECT id, email, name FROM player
/// le request = Player
/// .select([Column("id"), Column("email")])
/// .annotated(with: Column("name"))
public static func annotated(with selection: SQLSelectable...) -> QueryInterfaceRequest<Self> {
return all().annotated(with: selection)
}
/// Creates a request with the provided *predicate*.
///
/// // SELECT * FROM player WHERE email = 'arthur@example.com'