Skip to content

Commit

Permalink
remove several cosmetic defects
Browse files Browse the repository at this point in the history
remove conformity to equatable for query action
  • Loading branch information
bwdmr committed Jan 2, 2025
1 parent ab062df commit cc66701
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
1 change: 0 additions & 1 deletion Sources/FluentKit/Properties/Timestamp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ extension Fields {
}

extension Schema {

static func excludeDeleted(from query: inout DatabaseQuery) {
guard let timestamp = self.init().deletedTimestamp else {
return
Expand Down
3 changes: 1 addition & 2 deletions Sources/FluentKit/Query/Builder/QueryBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,9 @@ public final class QueryBuilder<Model>
}
}


// 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)
}
Expand Down
21 changes: 1 addition & 20 deletions Sources/FluentKit/Query/Database/DatabaseQuery+Action.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit cc66701

Please sign in to comment.