diff --git a/Sources/StructuredQueriesCore/Statement.swift b/Sources/StructuredQueriesCore/Statement.swift index 76677e41..b81a5aa0 100644 --- a/Sources/StructuredQueriesCore/Statement.swift +++ b/Sources/StructuredQueriesCore/Statement.swift @@ -1,5 +1,5 @@ /// A type that represents a full SQL query. -public protocol Statement: QueryExpression, Hashable { +public protocol Statement: QueryExpression { /// A type representing the table being queried. associatedtype From: Table @@ -15,13 +15,3 @@ extension Statement { "(\(.newline)\(query.indented())\(.newline))" } } - -extension Statement { - public static func == (lhs: Self, rhs: Self) -> Bool { - lhs.query == rhs.query - } - - public func hash(into hasher: inout Hasher) { - hasher.combine(query) - } -} diff --git a/Tests/StructuredQueriesTests/EphemeralTests.swift b/Tests/StructuredQueriesTests/EphemeralTests.swift index b0b18ada..c35719c8 100644 --- a/Tests/StructuredQueriesTests/EphemeralTests.swift +++ b/Tests/StructuredQueriesTests/EphemeralTests.swift @@ -17,10 +17,14 @@ extension SnapshotTests { """ } } + + @Test func equality() { + #expect(TestTable(displayName: "Blob Jr") != TestTable(displayName: "Blob Sr")) + } } } -@Table private struct TestTable { +@Table private struct TestTable: Equatable { var firstName = "" var lastName = "" @Ephemeral