Xcode 12.3 formatting

This commit is contained in:
Gwendal Roué committed 2020-12-23 12:13:05 +01:00
1 parent 3a76b84eae
commit 836efb120f
70 files changed
+612 -634

No files matched your search

@@ -39,7 +39,7 @@ struct SQLExpressionNot: SQLExpression {
case .false:
return SQLExpressionEqual(.equal, self, false.sqlExpression)
case .falsey:
// Support `NOT (NOT expression)` as a technique to build 0 or 1
return SQLExpressionNot(self)
@@ -726,10 +726,9 @@ struct SQLExpressionContains: SQLExpression {
}
func _identifyingRowIDs(_ db: Database, for alias: TableAlias) throws -> Set<Int64>? {
if
let expressions = collection._collectionExpressions,
let column = try expression._column(db, for: alias),
try db.columnIsRowID(column, of: alias.tableName)
if let expressions = collection._collectionExpressions,
let column = try expression._column(db, for: alias),
try db.columnIsRowID(column, of: alias.tableName)
{
return Set(expressions.compactMap {
($0 as? DatabaseValue).flatMap { Int64.fromDatabaseValue($0) }
@@ -776,7 +775,7 @@ struct SQLExpressionContains: SQLExpression {
}
if let expressions = collection._collectionExpressions,
expressions.contains(where: \._isAggregate)
expressions.contains(where: \._isAggregate)
{
// SELECT expr IN (aggregate, ...)
return true
@@ -914,9 +913,8 @@ struct SQLExpressionFunction: SQLExpression {
var _isConstantInRequest: Bool {
let function = self.function.uppercased()
guard
((function == "MAX" || function == "MIN") && arguments.count > 1)
|| Self.knownPureFunctions.contains(function)
guard ((function == "MAX" || function == "MIN") && arguments.count > 1)
|| Self.knownPureFunctions.contains(function)
else {
return false // Don't know - assume not constant
}
+3 -3
View File
@@ -135,7 +135,7 @@ public protocol _SQLExpression {
///
/// This property supports `_identifyingColums(_:for:)`
var _isConstantInRequest: Bool { get }
/// Returns true iff the expression is trivially true.
///
/// When in doubt, returns false.
@@ -213,7 +213,7 @@ extension SQLExpression {
/// :nodoc:
public var _isConstantInRequest: Bool { false }
/// :nodoc:
public var _isTrue: Bool { false }
@@ -236,7 +236,7 @@ extension SQLExpression {
/// :nodoc:
public func _columnCount(_ db: Database) throws -> Int { 1 }
/// :nodoc:
public func _count(distinct: Bool) -> _SQLCount? {
if distinct {
+1 -1
View File
@@ -138,7 +138,7 @@ extension SQLQuery {
return try QueryInterfaceRequest(query: countQuery).fetchOne(db)!
}
}
// SELECT COUNT(*) FROM (self)
func fetchTrivialCount(_ db: Database) throws -> Int {
let request = QueryInterfaceRequest<Void>(query: unordered())
+5 -5
View File
@@ -368,11 +368,11 @@ extension SQLRelation {
func removingChildrenForPrefetchedAssociations() -> Self {
filteringChildren {
switch $0.kind {
case .allPrefetched, .allNotPrefetched: return false
case .oneRequired, .oneOptional: return true
}
}
switch $0.kind {
case .allPrefetched, .allNotPrefetched: return false
case .oneRequired, .oneOptional: return true
}
}
}
}
+1 -1
View File
@@ -57,7 +57,7 @@ struct SQLRowValue: SQLExpression {
return false
}
func _qualifiedExpression(with alias: TableAlias) -> SQLExpression {
SQLRowValue(expressions.map { $0._qualifiedExpression(with: alias) })
}
@@ -109,7 +109,7 @@ struct SQLQualifiedAllColumns: SQLSelectable {
}
func _count(distinct: Bool) -> _SQLCount? { nil }
func _countedSQL(_ context: SQLGenerationContext) throws -> String {
if context.qualifier(for: alias) != nil {
// SELECT COUNT(t.*) is invalid SQL
@@ -143,7 +143,7 @@ struct SQLAliasedExpression: SQLSelectable {
self.expression = expression
self.name = name
}
func _columnCount(_ db: Database) throws -> Int { 1 }
func _count(distinct: Bool) -> _SQLCount? {
+1 -1
View File
@@ -19,7 +19,7 @@ public protocol _SQLSelectable {
/// - parameter context: An SQL generation context which accepts
/// statement arguments.
func _countedSQL(_ context: SQLGenerationContext) throws -> String
/// Returns true if the selectable is an aggregate.
///
/// When in doubt, returns false.