mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
CommonTableExpression.contains(_:)
This commit is contained in:
1 parent
26c7441b49
commit
f94cecb329
3 files changed
+38
No files matched your search
@@ -145,6 +145,19 @@ extension CommonTableExpression {
|
||||
public func all() -> QueryInterfaceRequest<RowDecoder> {
|
||||
QueryInterfaceRequest(relation: relationForAll)
|
||||
}
|
||||
|
||||
/// An SQL expression that checks the inclusion of an expression in a
|
||||
/// common table expression.
|
||||
///
|
||||
/// let playerNameCTE = CommonTableExpression<Void>(
|
||||
/// named: "playerName",
|
||||
/// request: Player.select(Column("name"))
|
||||
///
|
||||
/// // name IN playerName
|
||||
/// playerNameCTE.contains(Column("name"))
|
||||
public func contains(_ element: SQLExpressible) -> SQLExpression {
|
||||
SQLLiteral("\(element.sqlExpression) IN \(sql: tableName.quotedDatabaseIdentifier)").sqlExpression
|
||||
}
|
||||
}
|
||||
|
||||
/// A low-level common table expression
|
||||
|
||||
Reference in new issue
Block a user