mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
SQLRequestExpressible is a sub protocol of SQLSpecificExpressible
This commit is contained in:
1 parent
69641ff7d6
commit
be249bc697
5 files changed
+23
-103
No files matched your search
@@ -154,20 +154,7 @@ extension SQLInterpolation {
|
||||
/// let request: SQLRequest<Player> = """
|
||||
/// SELECT * FROM player WHERE score = (\(subQuery))
|
||||
/// """
|
||||
public mutating func appendInterpolation<RowDecoder>(_ request: SQLRequest<RowDecoder>) {
|
||||
elements.append(.custom(request.sqlLiteral.sql))
|
||||
}
|
||||
|
||||
/// Appends the request SQL (not wrapped inside parentheses).
|
||||
///
|
||||
/// // SELECT name FROM player WHERE score = (SELECT MAX(score) FROM player)
|
||||
/// let subQuery: SQLRequest<Int> = "SELECT MAX(score) FROM player"
|
||||
/// let request: SQLRequest<Player> = """
|
||||
/// SELECT * FROM player WHERE score = (\(subQuery))
|
||||
/// """
|
||||
public mutating func appendInterpolation<RowDecoder>(_ request: QueryInterfaceRequest<RowDecoder>) {
|
||||
elements.append(.custom { context in
|
||||
try SQLQueryGenerator(query: request.query).sql(context)
|
||||
})
|
||||
public mutating func appendInterpolation(_ request: SQLRequestExpressible) {
|
||||
elements.append(.custom(request.requestSQL))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user