Documentation

This commit is contained in:
Gwendal Roué committed 2020-05-10 15:34:38 +02:00
1 parent e94be4a06e
commit f799d5f30c
2 files changed
+11 -5

No files matched your search

+8 -2
View File
@@ -87,8 +87,14 @@ public protocol FetchRequest: SQLRequestProtocol, DatabaseRegionConvertible {
///
/// - parameter db: A database connection.
/// - parameter singleResult: A hint that a single result row will be
/// consumed. Implementations can optionally use this to optimize the
/// prepared statement.
/// consumed. Implementations can optionally use it to optimize the
/// prepared statement, for example by adding a `LIMIT 1` SQL clause.
///
/// // Calls makePreparedRequest(db, forSingleResult: true)
/// try request.fetchOne(db)
///
/// // Calls makePreparedRequest(db, forSingleResult: false)
/// try request.fetchAll(db)
/// - returns: A prepared request.
func makePreparedRequest(_ db: Database, forSingleResult singleResult: Bool) throws -> PreparedRequest
+3 -3
View File
@@ -1,13 +1,13 @@
/// The protocol that can generate SQL requests and subqueries.
public protocol SQLRequestProtocol: SQLExpression, SQLCollection {
/// [**Experimental**](http://github.com/groue/GRDB.swift#what-are-experimental-features)
///
///
/// Returns the request SQL.
///
/// - parameter context: An SQL generation context.
/// - parameter singleResult: A hint that a single result row will be
/// consumed. Implementations can optionally use this to optimize the
/// returned SQL.
/// consumed. Implementations can optionally use it to optimize the
/// generated SQL, for example by adding a `LIMIT 1` SQL clause.
/// - returns: An SQL string.
func requestSQL(_ context: SQLGenerationContext, forSingleResult singleResult: Bool) throws -> String
}