diff --git a/Sources/FluentKit/Properties/Timestamp.swift b/Sources/FluentKit/Properties/Timestamp.swift index a55296e2..68af0315 100644 --- a/Sources/FluentKit/Properties/Timestamp.swift +++ b/Sources/FluentKit/Properties/Timestamp.swift @@ -208,7 +208,6 @@ extension Fields { } extension Schema { - static func excludeDeleted(from query: inout DatabaseQuery) { guard let timestamp = self.init().deletedTimestamp else { return diff --git a/Sources/FluentKit/Query/Builder/QueryBuilder.swift b/Sources/FluentKit/Query/Builder/QueryBuilder.swift index 2bebdee5..45a14948 100644 --- a/Sources/FluentKit/Query/Builder/QueryBuilder.swift +++ b/Sources/FluentKit/Query/Builder/QueryBuilder.swift @@ -304,10 +304,9 @@ public final class QueryBuilder } } - // If deleted models aren't included, add filters // to exclude them for each model being queried. - if !self.includeDeleted { + if !self.includeDeleted { for model in self.models { model.excludeDeleted(from: &query) } diff --git a/Sources/FluentKit/Query/Database/DatabaseQuery+Action.swift b/Sources/FluentKit/Query/Database/DatabaseQuery+Action.swift index 7db918ef..fca77cfb 100644 --- a/Sources/FluentKit/Query/Database/DatabaseQuery+Action.swift +++ b/Sources/FluentKit/Query/Database/DatabaseQuery+Action.swift @@ -1,24 +1,5 @@ extension DatabaseQuery { - public enum Action: Sendable, Equatable { - - public static func == (lhs: DatabaseQuery.Action, rhs: DatabaseQuery.Action) -> Bool { - switch (lhs, rhs) { - case (.create, .create), - (.read, .read), - (.update, .update), - (.delete, .delete): - return true - case let (.aggregate(lhs), .aggregate(rhs)): - guard type(of: lhs) == type(of: rhs) else { return false } - return String(describing: lhs) == String(describing: rhs) - case let (.custom(lhs), .custom(rhs)): - guard type(of: lhs) == type(of: rhs) else { return false } - return String(describing: lhs) == String(describing: rhs) - default: - return false - } - } - + public enum Action: Sendable { case create case read case update