diff --git a/GRDB/Core/Database+Statements.swift b/GRDB/Core/Database+Statements.swift index 7f5c15d37..1238e79bb 100644 --- a/GRDB/Core/Database+Statements.swift +++ b/GRDB/Core/Database+Statements.swift @@ -547,7 +547,7 @@ struct StatementCache { let statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT)) #else let statement: Statement - if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+ + if #available(macOS 10.14, *) { // SQLite 3.20+ statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT)) } else { statement = try db.makeStatement(sql: sql) diff --git a/GRDB/Core/DatabasePublishers.swift b/GRDB/Core/DatabasePublishers.swift index 8f8054953..88c0c4806 100644 --- a/GRDB/Core/DatabasePublishers.swift +++ b/GRDB/Core/DatabasePublishers.swift @@ -1,5 +1,5 @@ #if canImport(Combine) /// A namespace for database Combine publishers. -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) public enum DatabasePublishers { } #endif diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 5fac0df44..ca694be0d 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -458,7 +458,7 @@ extension DatabaseReader { /// - parameter value: A closure which accesses the database. /// - throws: The error thrown by `value`, or any ``DatabaseError`` that /// would happen while establishing the database access. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func read(_ value: @Sendable @escaping (Database) throws -> T) async throws -> T { try await withUnsafeThrowingContinuation { continuation in asyncRead { result in @@ -504,7 +504,7 @@ extension DatabaseReader { /// - parameter value: A closure which accesses the database. /// - throws: The error thrown by `value`, or any ``DatabaseError`` that /// would happen while establishing the database access. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func unsafeRead(_ value: @Sendable @escaping (Database) throws -> T) async throws -> T { try await withUnsafeThrowingContinuation { continuation in asyncUnsafeRead { result in @@ -549,7 +549,7 @@ extension DatabaseReader { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter value: A closure which accesses the database. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func readPublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, value: @escaping (Database) throws -> Output) @@ -567,7 +567,7 @@ extension DatabaseReader { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that reads from the database. /// @@ -586,7 +586,7 @@ extension DatabasePublishers { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Publisher where Failure == Error { fileprivate func eraseToReadPublisher() -> DatabasePublishers.Read { .init(upstream: eraseToAnyPublisher()) diff --git a/GRDB/Core/DatabaseRegionObservation.swift b/GRDB/Core/DatabaseRegionObservation.swift index 4f1e1473c..242214bc4 100644 --- a/GRDB/Core/DatabaseRegionObservation.swift +++ b/GRDB/Core/DatabaseRegionObservation.swift @@ -128,7 +128,7 @@ extension DatabaseRegionObservation { } #if canImport(Combine) -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension DatabaseRegionObservation { // MARK: - Publishing Impactful Transactions @@ -140,7 +140,7 @@ extension DatabaseRegionObservation { /// /// Do not reschedule the publisher with `receive(on:options:)` or any /// `Publisher` method that schedules publisher elements. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func publisher(in writer: some DatabaseWriter) -> DatabasePublishers.DatabaseRegion { DatabasePublishers.DatabaseRegion(self, in: writer) } @@ -186,7 +186,7 @@ private class DatabaseRegionObserver: TransactionObserver { } #if canImport(Combine) -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that tracks transactions that modify a database region. /// diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index b4de8f6fd..87937214a 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -541,7 +541,7 @@ extension DatabaseWriter { /// /// - Parameter filePath: file path for new database @_disfavoredOverload // SR-15150 Async overloading in protocol implementation fails - @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) + @available(iOS 14, macOS 10.16, tvOS 14, *) public func vacuum(into filePath: String) throws { try writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -607,7 +607,7 @@ extension DatabaseWriter { /// - throws: The error thrown by `updates`, or any ``DatabaseError`` that /// would happen while establishing the database access or committing /// the transaction. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func write(_ updates: @Sendable @escaping (Database) throws -> T) async throws -> T { try await withUnsafeThrowingContinuation { continuation in asyncWrite(updates, completion: { _, result in @@ -645,7 +645,7 @@ extension DatabaseWriter { /// /// - parameter updates: A closure which accesses the database. /// - throws: The error thrown by `updates`. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func writeWithoutTransaction(_ updates: @Sendable @escaping (Database) throws -> T) async throws -> T { try await withUnsafeThrowingContinuation { continuation in asyncWriteWithoutTransaction { db in @@ -697,7 +697,7 @@ extension DatabaseWriter { /// /// - parameter updates: A closure which accesses the database. /// - throws: The error thrown by `updates`. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func barrierWriteWithoutTransaction( _ updates: @Sendable @escaping (Database) throws -> T) async throws -> T @@ -712,7 +712,7 @@ extension DatabaseWriter { /// Erase the database: delete all content, drop all tables, etc. /// /// - note: [**🔥 EXPERIMENTAL**](https://github.com/groue/GRDB.swift/blob/master/README.md#what-are-experimental-features) - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func erase() async throws { try await writeWithoutTransaction { try $0.erase() } } @@ -723,7 +723,7 @@ extension DatabaseWriter { /// - note: [**🔥 EXPERIMENTAL**](https://github.com/groue/GRDB.swift/blob/master/README.md#what-are-experimental-features) /// /// Related SQLite documentation: - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func vacuum() async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM") } } @@ -740,7 +740,7 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -755,7 +755,7 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -800,7 +800,7 @@ extension DatabaseWriter { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter updates: A closure which accesses the database. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func writePublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, updates: @escaping (Database) throws -> Output) @@ -865,7 +865,7 @@ extension DatabaseWriter { /// - parameter scheduler: A Combine Scheduler. /// - parameter updates: A closure which writes in the database. /// - parameter value: A closure which reads from the database. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func writePublisher( receiveOn scheduler: S = DispatchQueue.main, updates: @escaping (Database) throws -> T, @@ -897,7 +897,7 @@ extension DatabaseWriter { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that writes into the database. /// @@ -916,7 +916,7 @@ extension DatabasePublishers { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Publisher where Failure == Error { fileprivate func eraseToWritePublisher() -> DatabasePublishers.Write { .init(upstream: self.eraseToAnyPublisher()) diff --git a/GRDB/Core/Statement.swift b/GRDB/Core/Statement.swift index 669a1a776..68d33e22a 100644 --- a/GRDB/Core/Statement.swift +++ b/GRDB/Core/Statement.swift @@ -146,7 +146,7 @@ public final class Statement { database.sqliteConnection, statementStart, -1, prepFlags, &sqliteStatement, statementEnd) #else - if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+ + if #available(macOS 10.14, *) { // SQLite 3.20+ code = sqlite3_prepare_v3( database.sqliteConnection, statementStart, -1, prepFlags, &sqliteStatement, statementEnd) diff --git a/GRDB/Dump/DumpFormats/JSONDumpFormat.swift b/GRDB/Dump/DumpFormats/JSONDumpFormat.swift index 82c93ba5f..62ffce35a 100644 --- a/GRDB/Dump/DumpFormats/JSONDumpFormat.swift +++ b/GRDB/Dump/DumpFormats/JSONDumpFormat.swift @@ -52,7 +52,7 @@ public struct JSONDumpFormat: Sendable { public static var defaultEncoder: JSONEncoder { // This encoder MUST NOT CHANGE, because some people rely on this format. let encoder = JSONEncoder() - if #available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) { + if #available(iOS 13.0, macOS 10.15, tvOS 13.0, *) { encoder.outputFormatting = .withoutEscapingSlashes } encoder.nonConformingFloatEncodingStrategy = .convertToString( diff --git a/GRDB/FTS/FTS3.swift b/GRDB/FTS/FTS3.swift index 80e677ae1..26f0643d1 100644 --- a/GRDB/FTS/FTS3.swift +++ b/GRDB/FTS/FTS3.swift @@ -47,7 +47,7 @@ public struct FTS3 { #elseif !GRDBCIPHER /// Remove diacritics from Latin script characters. This option matches /// the `remove_diacritics=2` tokenizer argument. - @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.27+ + @available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.27+ case remove #endif } diff --git a/GRDB/FTS/FTS5.swift b/GRDB/FTS/FTS5.swift index 32378a6e0..76400a3f2 100644 --- a/GRDB/FTS/FTS5.swift +++ b/GRDB/FTS/FTS5.swift @@ -69,7 +69,7 @@ public struct FTS5 { /// Remove diacritics from Latin script characters. This /// option matches the raw "remove_diacritics=2" tokenizer argument, /// available from SQLite 3.27.0 - @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.27+ + @available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.27+ case remove #endif } @@ -130,7 +130,7 @@ public struct FTS5 { return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer) #else // GRDB is linked against the system SQLite. - if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+ + if #available(macOS 10.14, *) { // SQLite 3.20+ return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer) } else { return api_v1(db) diff --git a/GRDB/Fixits.swift b/GRDB/Fixits.swift index ed82d514d..516c650bb 100644 --- a/GRDB/Fixits.swift +++ b/GRDB/Fixits.swift @@ -119,7 +119,7 @@ extension PersistableRecord { public func performSave(_ db: Database) throws { preconditionFailure() } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension QueryInterfaceRequest where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible { @available(*, unavailable, message: "selectID() has been removed. You may use selectPrimaryKey(as:) instead.") public func selectID() -> QueryInterfaceRequest { preconditionFailure() } @@ -144,13 +144,13 @@ extension SelectionRequest { @available(*, unavailable, renamed: "SQLExpression.AssociativeBinaryOperator") public typealias SQLAssociativeBinaryOperator = SQLExpression.AssociativeBinaryOperator -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible { @available(*, unavailable, message: "selectID() has been removed. You may use selectPrimaryKey(as:) instead.") public func selectID() -> QueryInterfaceRequest { preconditionFailure() } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { @available(*, unavailable, message: "selectID() has been removed. You may use selectPrimaryKey(as:) instead.") public static func selectID() -> QueryInterfaceRequest { preconditionFailure() } diff --git a/GRDB/Migration/DatabaseMigrator.swift b/GRDB/Migration/DatabaseMigrator.swift index f4de96c69..2bb9d8517 100644 --- a/GRDB/Migration/DatabaseMigrator.swift +++ b/GRDB/Migration/DatabaseMigrator.swift @@ -496,7 +496,7 @@ extension DatabaseMigrator { /// - parameter writer: A DatabaseWriter. /// where migrations should apply. /// - parameter scheduler: A Combine Scheduler. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func migratePublisher( _ writer: some DatabaseWriter, receiveOn scheduler: some Scheduler = DispatchQueue.main) @@ -514,7 +514,7 @@ extension DatabaseMigrator { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that migrates a database. /// diff --git a/GRDB/QueryInterface/Request/RequestProtocols.swift b/GRDB/QueryInterface/Request/RequestProtocols.swift index def5c2f52..71413dda7 100644 --- a/GRDB/QueryInterface/Request/RequestProtocols.swift +++ b/GRDB/QueryInterface/Request/RequestProtocols.swift @@ -583,7 +583,7 @@ extension TableRequest where Self: FilteredRequest, Self: TypedRequest { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension TableRequest where Self: FilteredRequest, Self: TypedRequest, diff --git a/GRDB/QueryInterface/SQL/SQLExpression.swift b/GRDB/QueryInterface/SQL/SQLExpression.swift index ad772c8df..140556270 100644 --- a/GRDB/QueryInterface/SQL/SQLExpression.swift +++ b/GRDB/QueryInterface/SQL/SQLExpression.swift @@ -1989,7 +1989,7 @@ struct SQLAggregateFunctionInvocation { var arguments: [SQLExpression] var isDistinct = false var ordering: SQLOrdering? = nil // SQLite 3.44.0+ - var filter: SQLExpression? = nil // @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) SQLite 3.30+ + var filter: SQLExpression? = nil // @available(iOS 14, macOS 10.16, tvOS 14, *) SQLite 3.30+ /// A boolean value indicating if a function is known to return a /// JSON value. @@ -2328,13 +2328,13 @@ extension SQLSpecificExpressible { } #elseif !GRDBCIPHER /// An ordering term for ascending order (nulls last). - @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+ + @available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+ public var ascNullsLast: SQLOrdering { .ascNullsLast(sqlExpression) } /// An ordering term for descending order (nulls first). - @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+ + @available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+ public var descNullsFirst: SQLOrdering { .descNullsFirst(sqlExpression) } diff --git a/GRDB/QueryInterface/SQL/SQLFunctions.swift b/GRDB/QueryInterface/SQL/SQLFunctions.swift index 08a1a39ea..fab42b8e4 100644 --- a/GRDB/QueryInterface/SQL/SQLFunctions.swift +++ b/GRDB/QueryInterface/SQL/SQLFunctions.swift @@ -34,7 +34,7 @@ public func average( /// // AVG(length) FILTER (WHERE length > 0) /// average(Column("length"), filter: Column("length") > 0) /// ``` -@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+ +@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+ public func average( _ value: some SQLSpecificExpressible, filter: some SQLSpecificExpressible) @@ -145,7 +145,7 @@ public func max( /// // MAX(score) FILTER (WHERE score < 0) /// max(Column("score"), filter: Column("score") < 0) /// ``` -@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+ +@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+ public func max( _ value: some SQLSpecificExpressible, filter: some SQLSpecificExpressible) @@ -190,7 +190,7 @@ public func min( /// // MIN(score) FILTER (WHERE score > 0) /// min(Column("score"), filter: Column("score") > 0) /// ``` -@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+ +@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+ public func min( _ value: some SQLSpecificExpressible, filter: some SQLSpecificExpressible) @@ -248,7 +248,7 @@ public func sum( /// See also ``total(_:)``. /// /// Related SQLite documentation: . -@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+ +@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+ public func sum( _ value: some SQLSpecificExpressible, filter: some SQLSpecificExpressible) @@ -312,7 +312,7 @@ public func total( /// See also ``total(_:)``. /// /// Related SQLite documentation: . -@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+ +@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+ public func total( _ value: some SQLSpecificExpressible, filter: some SQLSpecificExpressible) diff --git a/GRDB/QueryInterface/SQL/Table.swift b/GRDB/QueryInterface/SQL/Table.swift index c6de851c7..86948aa7b 100644 --- a/GRDB/QueryInterface/SQL/Table.swift +++ b/GRDB/QueryInterface/SQL/Table.swift @@ -723,7 +723,7 @@ extension Table { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible { /// Returns a request filtered by primary key. /// @@ -1546,7 +1546,7 @@ extension Table { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible @@ -1688,7 +1688,7 @@ extension Table { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible diff --git a/GRDB/QueryInterface/Schema/TableAlteration.swift b/GRDB/QueryInterface/Schema/TableAlteration.swift index c731e7ea5..a61e6ba8d 100644 --- a/GRDB/QueryInterface/Schema/TableAlteration.swift +++ b/GRDB/QueryInterface/Schema/TableAlteration.swift @@ -129,7 +129,7 @@ public final class TableAlteration { /// /// - parameter name: the old name of the column. /// - parameter newName: the new name of the column. - @available(iOS 13, tvOS 13, watchOS 6, *) // SQLite 3.25+ + @available(iOS 13, tvOS 13, *) // SQLite 3.25+ public func rename(column name: String, to newName: String) { _rename(column: name, to: newName) } diff --git a/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift b/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift index 8044373f3..74b802feb 100644 --- a/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift @@ -605,7 +605,7 @@ extension TableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Returns a request filtered by primary key. /// diff --git a/GRDB/Record/FetchableRecord+TableRecord.swift b/GRDB/Record/FetchableRecord+TableRecord.swift index 97178adeb..be0b83926 100644 --- a/GRDB/Record/FetchableRecord+TableRecord.swift +++ b/GRDB/Record/FetchableRecord+TableRecord.swift @@ -217,7 +217,7 @@ extension FetchableRecord where Self: TableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension FetchableRecord where Self: TableRecord & Identifiable, ID: DatabaseValueConvertible { // MARK: Fetching by Single-Column Primary Key @@ -359,7 +359,7 @@ extension FetchableRecord where Self: TableRecord & Hashable { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension FetchableRecord where Self: TableRecord & Hashable & Identifiable, ID: DatabaseValueConvertible { /// Returns a set of records identified by their primary keys. /// diff --git a/GRDB/Record/TableRecord.swift b/GRDB/Record/TableRecord.swift index 2fe56388f..db6edc45e 100644 --- a/GRDB/Record/TableRecord.swift +++ b/GRDB/Record/TableRecord.swift @@ -319,7 +319,7 @@ extension TableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Returns whether a record exists for this primary key. /// @@ -455,7 +455,7 @@ extension TableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Deletes records identified by their primary keys, and returns the number /// of deleted records. @@ -774,7 +774,7 @@ extension TableRecord where Self: EncodableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Returns an error for a record that does not exist in the database. /// diff --git a/GRDB/Utils/OnDemandFuture.swift b/GRDB/Utils/OnDemandFuture.swift index 6826014a4..e1d8dff6c 100644 --- a/GRDB/Utils/OnDemandFuture.swift +++ b/GRDB/Utils/OnDemandFuture.swift @@ -14,7 +14,7 @@ import Foundation /// Both two extra scheduling guarantees are used by GRDB in order to be /// able to spawn concurrent database reads right from the database writer /// queue, and fulfill GRDB preconditions. -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) struct OnDemandFuture: Publisher { typealias Promise = (Result) -> Void typealias Output = Output @@ -33,7 +33,7 @@ struct OnDemandFuture: Publisher { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) private class OnDemandFutureSubscription: Subscription { typealias Promise = (Result) -> Void diff --git a/GRDB/Utils/ReceiveValuesOn.swift b/GRDB/Utils/ReceiveValuesOn.swift index abc688f78..7cbbde7c1 100644 --- a/GRDB/Utils/ReceiveValuesOn.swift +++ b/GRDB/Utils/ReceiveValuesOn.swift @@ -11,7 +11,7 @@ import Foundation /// This scheduling guarantee is used by GRDB in order to be able /// to make promises on the scheduling of database values without surprising /// the users as in . -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) struct ReceiveValuesOn: Publisher { typealias Output = Upstream.Output typealias Failure = Upstream.Failure @@ -30,7 +30,7 @@ struct ReceiveValuesOn: Publisher { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) private class ReceiveValuesOnSubscription: Subscription, Subscriber where Upstream: Publisher, @@ -211,7 +211,7 @@ where } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Publisher { /// Specifies the scheduler on which to receive values from the publisher /// diff --git a/GRDB/ValueObservation/SharedValueObservation.swift b/GRDB/ValueObservation/SharedValueObservation.swift index 0a0e742ae..e58d01885 100644 --- a/GRDB/ValueObservation/SharedValueObservation.swift +++ b/GRDB/ValueObservation/SharedValueObservation.swift @@ -291,7 +291,7 @@ public final class SharedValueObservation { /// print("fresh players: \(players)") /// } /// ``` - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func publisher() -> DatabasePublishers.Value { DatabasePublishers.Value { onError, onChange in self.start(onError: onError, onChange: onChange) @@ -368,7 +368,7 @@ extension SharedValueObservation { /// print("Fresh players: \(players)") /// } /// ``` - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func values(bufferingPolicy: AsyncValueObservation.BufferingPolicy = .unbounded) -> AsyncValueObservation { diff --git a/GRDB/ValueObservation/ValueObservation.swift b/GRDB/ValueObservation/ValueObservation.swift index cfb082046..17b8a60b8 100644 --- a/GRDB/ValueObservation/ValueObservation.swift +++ b/GRDB/ValueObservation/ValueObservation.swift @@ -294,7 +294,7 @@ extension ValueObservation { /// ``` /// /// - parameter reader: A DatabaseReader. - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func values( in reader: some DatabaseReader, bufferingPolicy: AsyncValueObservation.BufferingPolicy = .unbounded) @@ -334,7 +334,7 @@ extension ValueObservation { /// /// You build an `AsyncValueObservation` from ``ValueObservation`` or /// ``SharedValueObservation``. -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) public struct AsyncValueObservation: AsyncSequence { public typealias BufferingPolicy = AsyncThrowingStream.Continuation.BufferingPolicy public typealias AsyncIterator = Iterator @@ -436,7 +436,7 @@ extension ValueObservation { /// - parameter scheduler: A ValueObservationScheduler. By default, fresh /// values are dispatched asynchronously on the main dispatch queue. /// - returns: A Combine publisher - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) public func publisher( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler = .async(onQueue: .main)) @@ -453,7 +453,7 @@ extension ValueObservation { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that publishes the values of a ``ValueObservation``. /// diff --git a/README.md b/README.md index e1fab8c16..92a73a374 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ **Latest release**: March 23, 2024 • [version 6.26.0](https://github.com/groue/GRDB.swift/tree/v6.26.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md) -**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / visionOS 1.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 15.3+ +**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / visionOS 1.0+ / watchOS 7.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 15.3+ **Contact**: diff --git a/SQLiteCustom/GRDBDeploymentTarget.xcconfig b/SQLiteCustom/GRDBDeploymentTarget.xcconfig index c96b1bdb8..3a0726764 100644 --- a/SQLiteCustom/GRDBDeploymentTarget.xcconfig +++ b/SQLiteCustom/GRDBDeploymentTarget.xcconfig @@ -1,5 +1,5 @@ IPHONEOS_DEPLOYMENT_TARGET = 12.0 MACOSX_DEPLOYMENT_TARGET = 10.13 TVOS_DEPLOYMENT_TARGET = 12.0 -WATCHOS_DEPLOYMENT_TARGET = 4.0 +WATCHOS_DEPLOYMENT_TARGET = 7.0 XROS_DEPLOYMENT_TARGET = 1.0 diff --git a/Support/GRDBDeploymentTarget.xcconfig b/Support/GRDBDeploymentTarget.xcconfig index 50721e784..9abddd624 100644 --- a/Support/GRDBDeploymentTarget.xcconfig +++ b/Support/GRDBDeploymentTarget.xcconfig @@ -1,7 +1,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 12.0 MACOSX_DEPLOYMENT_TARGET = 10.13 TVOS_DEPLOYMENT_TARGET = 12.0 -WATCHOS_DEPLOYMENT_TARGET = 4.0 +WATCHOS_DEPLOYMENT_TARGET = 7.0 XROS_DEPLOYMENT_TARGET = 1.0 OTHER_SWIFT_FLAGS = $(inherited) -D SQLITE_ENABLE_FTS5 diff --git a/TODO.md b/TODO.md index 25fd32965..1ca93eb7a 100644 --- a/TODO.md +++ b/TODO.md @@ -91,7 +91,7 @@ - [X] GRDB7: stop exporting CSQLite https://github.com/groue/GRDB.swift/issues/642#issuecomment-1937347696 - [ ] GRDB7: AsyncValueObservation: experiment with an immediate scheduler that does not hop to the main queue. - [ ] GRDB7: Question Sendability of SQLExpressible et al. If we can copy Sendable representations in requests, it's not needed. -- [ ] GRDB7: Raise the minimum watchOS target https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836 +- [X] GRDB7: Raise the minimum watchOS target https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836 - [ ] GRDB7: Consider putting a Task cancellation handler on async methods. - [ ] GRDB7: All writes should be immediate, right? https://github.com/groue/GRDB.swift/pull/1485#issuecomment-1953793553 - [ ] GRDB7: Sendable conformances diff --git a/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift b/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift index 402b3f553..b32fdbde4 100644 --- a/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift +++ b/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation which waits for the timeout to expire, or /// the recorded publisher to complete. diff --git a/Tests/CombineExpectations/PublisherExpectations/Finished.swift b/Tests/CombineExpectations/PublisherExpectations/Finished.swift index 0a47d09f6..5f866e7c9 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Finished.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Finished.swift @@ -17,7 +17,7 @@ import XCTest // try wait(for: recorder.finished.inverted, timeout: 1) // } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation which waits for the recorded publisher /// to complete. diff --git a/Tests/CombineExpectations/PublisherExpectations/Inverted.swift b/Tests/CombineExpectations/PublisherExpectations/Inverted.swift index c7f8d72cc..6900f834e 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Inverted.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Inverted.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation that fails if the base expectation is fulfilled. /// diff --git a/Tests/CombineExpectations/PublisherExpectations/Map.swift b/Tests/CombineExpectations/PublisherExpectations/Map.swift index ab4f95c73..0c6a22c4c 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Map.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Map.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation that transforms the value of a base expectation. /// @@ -20,7 +20,7 @@ extension PublisherExpectations { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectation { /// Returns a publisher expectation that transforms the value of the /// base expectation. diff --git a/Tests/CombineExpectations/PublisherExpectations/Next.swift b/Tests/CombineExpectations/PublisherExpectations/Next.swift index 76ad0c105..70e73836f 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Next.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Next.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation which waits for the recorded publisher to emit /// `count` elements, or to complete. diff --git a/Tests/CombineExpectations/PublisherExpectations/NextOne.swift b/Tests/CombineExpectations/PublisherExpectations/NextOne.swift index 84ee6233e..6bc8ff10e 100644 --- a/Tests/CombineExpectations/PublisherExpectations/NextOne.swift +++ b/Tests/CombineExpectations/PublisherExpectations/NextOne.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation which waits for the recorded publisher to emit /// one element, or to complete. diff --git a/Tests/CombineExpectations/PublisherExpectations/Prefix.swift b/Tests/CombineExpectations/PublisherExpectations/Prefix.swift index 11aced69d..f3fcd2053 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Prefix.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Prefix.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation which waits for the recorded publisher to emit /// `maxLength` elements, or to complete. diff --git a/Tests/CombineExpectations/PublisherExpectations/Recording.swift b/Tests/CombineExpectations/PublisherExpectations/Recording.swift index 0b95292dc..2327188f6 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Recording.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Recording.swift @@ -2,7 +2,7 @@ import Combine import XCTest -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// A publisher expectation which waits for the recorded publisher /// to complete. diff --git a/Tests/CombineExpectations/Recorder.swift b/Tests/CombineExpectations/Recorder.swift index 0d7031aaf..3d5be6f7b 100644 --- a/Tests/CombineExpectations/Recorder.swift +++ b/Tests/CombineExpectations/Recorder.swift @@ -13,7 +13,7 @@ import XCTest /// /// let elements = try wait(for: recorder.elements, timeout: 1) /// XCTAssertEqual(elements, ["foo", "bar", "baz"]) -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) public class Recorder: Subscriber { public typealias Input = Input public typealias Failure = Failure @@ -287,7 +287,7 @@ public class Recorder: Subscriber { // MARK: - Publisher Expectations -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension PublisherExpectations { /// The type of the publisher expectation returned by `Recorder.completion`. public typealias Completion = Map, Subscribers.Completion> @@ -302,7 +302,7 @@ extension PublisherExpectations { public typealias Single = Map, Input> } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Recorder { /// Returns a publisher expectation which waits for the timeout to expire, /// or the recorded publisher to complete. @@ -584,7 +584,7 @@ extension Recorder { // MARK: - Publisher + Recorder -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Publisher { /// Returns a subscribed Recorder. /// diff --git a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift index f2b42977c..56cb6d1e1 100644 --- a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift @@ -22,7 +22,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -128,7 +128,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // frame #71: 0x00007fff72311cc9 libdyld.dylib`start + 1 // frame #72: 0x00007fff72311cc9 libdyld.dylib`start + 1 func testReadPublisherError() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -157,7 +157,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherIsAsynchronous() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -197,7 +197,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherDefaultScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -237,7 +237,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherCustomScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -278,7 +278,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherIsReadonly() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift index e126c54b3..8c5e870f1 100644 --- a/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift @@ -20,7 +20,7 @@ private struct Player: Codable, FetchableRecord, PersistableRecord { class DatabaseRegionObservationPublisherTests : XCTestCase { func testChangesNotifications() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -61,7 +61,7 @@ class DatabaseRegionObservationPublisherTests : XCTestCase { // TODO: do the same, but asynchronously. If this is too hard, update the // public API so that users can easily do it. func testPrependInitialDatabaseSync() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift b/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift index 1ab142081..cc3903dab 100644 --- a/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift @@ -22,7 +22,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -49,7 +49,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherValue() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -76,7 +76,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherError() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -99,7 +99,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { } func testWritePublisherErrorRollbacksTransaction() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -132,7 +132,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherIsAsynchronous() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -168,7 +168,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherDefaultScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -206,7 +206,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherCustomScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -247,7 +247,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // TODO: Fix flaky test with both pool and on-disk queue: // - Expectation timeout func testWriteThenReadPublisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -274,7 +274,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWriteThenReadPublisherIsReadonly() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -299,7 +299,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWriteThenReadPublisherWriteError() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -322,7 +322,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { } func testWriteThenReadPublisherWriteErrorRollbacksTransaction() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -359,7 +359,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // TODO: Fix flaky test with both pool and on-disk queue: // - Expectation timeout func testWriteThenReadPublisherReadError() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -386,7 +386,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // Regression test against deadlocks created by concurrent completion // and cancellations triggered by .switchToLatest().prefix(1) func testDeadlockPrevention() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBCombineTests/Support.swift b/Tests/GRDBCombineTests/Support.swift index d8f2ec838..0805d0bc0 100644 --- a/Tests/GRDBCombineTests/Support.swift +++ b/Tests/GRDBCombineTests/Support.swift @@ -51,7 +51,7 @@ final class Test { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) final class AsyncTest { // Raise the repeatCount in order to help spotting flaky tests. private let repeatCount: Int @@ -100,7 +100,7 @@ final class AsyncTest { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) public func assertNoFailure( _ completion: Subscribers.Completion, file: StaticString = #file, @@ -111,7 +111,7 @@ public func assertNoFailure( } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) public func assertFailure( _ completion: Subscribers.Completion, file: StaticString = #file, diff --git a/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift b/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift index b55fd98c6..fff31440f 100644 --- a/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift +++ b/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift @@ -22,7 +22,7 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Default Scheduler func testDefaultSchedulerChangesNotifications() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -64,7 +64,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDefaultSchedulerFirstValueIsEmittedAsynchronously() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -97,7 +97,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDefaultSchedulerError() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -123,7 +123,7 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Immediate Scheduler func testImmediateSchedulerChangesNotifications() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -165,7 +165,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testImmediateSchedulerEmitsFirstValueSynchronously() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -201,7 +201,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testImmediateSchedulerError() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -226,7 +226,7 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Demand - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) private class DemandSubscriber: Subscriber { private var subscription: Subscription? let subject = PassthroughSubject() @@ -257,7 +257,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandNoneReceivesNoElement() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -292,7 +292,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandOneReceivesOneElement() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -330,7 +330,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandOneDoesNotReceiveTwoElements() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -372,7 +372,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandTwoReceivesTwoElements() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -418,7 +418,7 @@ class ValueObservationPublisherTests : XCTestCase { /// Regression test for https://github.com/groue/GRDB.swift/issues/1194 func testIssue1194() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift index 6fdf7d875..b9219589f 100644 --- a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift @@ -23,7 +23,7 @@ private struct RecordWithData: EncodableRecord, Enco var data: Data } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension RecordWithData: Identifiable { var id: Data { data } } @@ -33,7 +33,7 @@ private struct RecordWithOptionalData: EncodableReco var data: Data? } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension RecordWithOptionalData: Identifiable { var id: Data? { data } } @@ -150,7 +150,7 @@ extension DatabaseDataEncodingStrategyTests { } func testFilterID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } @@ -230,7 +230,7 @@ extension DatabaseDataEncodingStrategyTests { } func testDeleteID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift index 98b1ab605..6db6c0b4c 100644 --- a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift @@ -50,7 +50,7 @@ private struct RecordWithDate: EncodableRecord, Enco var date: Date } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension RecordWithDate: Identifiable { var id: Date { date } } @@ -60,7 +60,7 @@ private struct RecordWithOptionalDate: EncodableReco var date: Date? } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension RecordWithOptionalDate: Identifiable { var id: Date? { date } } @@ -260,7 +260,7 @@ extension DatabaseDateEncodingStrategyTests { } func testFilterID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } @@ -340,7 +340,7 @@ extension DatabaseDateEncodingStrategyTests { } func testDeleteID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseDumpTests.swift b/Tests/GRDBTests/DatabaseDumpTests.swift index 9d53629cd..e42cf06dc 100644 --- a/Tests/GRDBTests/DatabaseDumpTests.swift +++ b/Tests/GRDBTests/DatabaseDumpTests.swift @@ -240,7 +240,7 @@ final class DatabaseDumpTests: GRDBTestCase { // MARK: - JSON func test_json_value_formatting() throws { - guard #available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) else { + guard #available(iOS 13.0, macOS 10.15, tvOS 13.0, *) else { throw XCTSkip("Skip because this test relies on JSONEncoder.OutputFormatting.withoutEscapingSlashes") } diff --git a/Tests/GRDBTests/DatabaseMigratorTests.swift b/Tests/GRDBTests/DatabaseMigratorTests.swift index e9a65cba4..2fd75e8fb 100644 --- a/Tests/GRDBTests/DatabaseMigratorTests.swift +++ b/Tests/GRDBTests/DatabaseMigratorTests.swift @@ -35,7 +35,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -147,7 +147,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -203,7 +203,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -229,7 +229,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -256,7 +256,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherDefaultScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -285,7 +285,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherCustomScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBTests/DatabaseReaderTests.swift b/Tests/GRDBTests/DatabaseReaderTests.swift index 0881fd3d6..3defa5950 100644 --- a/Tests/GRDBTests/DatabaseReaderTests.swift +++ b/Tests/GRDBTests/DatabaseReaderTests.swift @@ -33,7 +33,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_ReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -75,7 +75,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_ReadPreventsDatabaseModification() async throws { func test(_ dbReader: some DatabaseReader) async throws { do { @@ -119,7 +119,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_UnsafeReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in diff --git a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift index 99ae96abd..6a58ff405 100644 --- a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift +++ b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift @@ -220,7 +220,7 @@ final class DatabaseSnapshotPoolTests: GRDBTestCase { try XCTAssertEqual(dbPool.read(counter.value), 2) } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func test_read_async() async throws { let dbPool = try makeDatabasePool() let counter = try Counter(dbPool: dbPool) // 0 diff --git a/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift index 2245a8be6..85c573377 100644 --- a/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift @@ -23,7 +23,7 @@ private struct RecordWithUUID: EncodableRecord, Enco var uuid: UUID } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension RecordWithUUID: Identifiable { var id: UUID { uuid } } @@ -33,7 +33,7 @@ private struct RecordWithOptionalUUID: EncodableReco var uuid: UUID? } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension RecordWithOptionalUUID: Identifiable { var id: UUID? { uuid } } @@ -184,7 +184,7 @@ extension DatabaseUUIDEncodingStrategyTests { } func testFilterID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } @@ -303,7 +303,7 @@ extension DatabaseUUIDEncodingStrategyTests { } func testDeleteID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseWriterTests.swift b/Tests/GRDBTests/DatabaseWriterTests.swift index 7a7fc8921..2ddfdc485 100644 --- a/Tests/GRDBTests/DatabaseWriterTests.swift +++ b/Tests/GRDBTests/DatabaseWriterTests.swift @@ -204,7 +204,7 @@ class DatabaseWriterTests : GRDBTestCase { } func testVacuumInto() throws { - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip("VACUUM INTO is not available") } // Prevent SQLCipher failures @@ -275,7 +275,7 @@ class DatabaseWriterTests : GRDBTestCase { try DatabaseQueue().backup(to: dbQueue) } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_write() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -295,7 +295,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_writeWithoutTransaction() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -318,7 +318,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_barrierWriteWithoutTransaction() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -341,7 +341,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_erase() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -359,7 +359,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_vacuum() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -375,7 +375,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // async + vacuum into + @available(iOS 14, macOS 10.16, tvOS 14, *) // async + vacuum into func testAsyncAwait_vacuumInto() async throws { // Prevent SQLCipher failures guard sqlite3_libversion_number() >= 3027000 else { @@ -406,7 +406,7 @@ class DatabaseWriterTests : GRDBTestCase { } /// A test related to - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncWriteThenRead() async throws { /// An async read performed after an async write should see the write. func test(_ dbWriter: some DatabaseWriter) async throws { diff --git a/Tests/GRDBTests/FTS3TableBuilderTests.swift b/Tests/GRDBTests/FTS3TableBuilderTests.swift index b2434da37..d0f1bbaa6 100644 --- a/Tests/GRDBTests/FTS3TableBuilderTests.swift +++ b/Tests/GRDBTests/FTS3TableBuilderTests.swift @@ -76,7 +76,7 @@ class FTS3TableBuilderTests: GRDBTestCase { } #elseif !GRDBCIPHER func testUnicode61TokenizerDiacriticsRemove() throws { - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip() } let dbQueue = try makeDatabaseQueue() diff --git a/Tests/GRDBTests/FTS5TableBuilderTests.swift b/Tests/GRDBTests/FTS5TableBuilderTests.swift index b44dc6589..fe63cfc42 100644 --- a/Tests/GRDBTests/FTS5TableBuilderTests.swift +++ b/Tests/GRDBTests/FTS5TableBuilderTests.swift @@ -130,7 +130,7 @@ class FTS5TableBuilderTests: GRDBTestCase { } #elseif !GRDBCIPHER func testUnicode61TokenizerDiacriticsRemove() throws { - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip() } diff --git a/Tests/GRDBTests/JoinSupportTests.swift b/Tests/GRDBTests/JoinSupportTests.swift index b2ae7eeea..4b703bd71 100644 --- a/Tests/GRDBTests/JoinSupportTests.swift +++ b/Tests/GRDBTests/JoinSupportTests.swift @@ -92,7 +92,7 @@ private struct FlatModel: FetchableRecord { self.t5count = row.scopes[Scopes.suffix]!["t5count"] } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) static func modernAll() -> some FetchRequest { all() } @@ -138,7 +138,7 @@ private struct CodableFlatModel: FetchableRecord, Codable { var t3: T3? var t5count: Int - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) static func modernAll() -> some FetchRequest { all() } @@ -186,7 +186,7 @@ private struct CodableNestedModel: FetchableRecord, Codable { var t3: T3? var t5count: Int - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) static func modernAll() -> some FetchRequest { all() } diff --git a/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift b/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift index e2e50cb24..a4248160f 100644 --- a/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift +++ b/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift @@ -1512,7 +1512,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase { throw XCTSkip("FILTER clause on aggregate functions is not available") } #else - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip("FILTER clause on aggregate functions is not available") } #endif @@ -1561,7 +1561,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase { throw XCTSkip("FILTER clause on aggregate functions is not available") } #else - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip("FILTER clause on aggregate functions is not available") } #endif @@ -1594,7 +1594,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase { throw XCTSkip("FILTER clause on aggregate functions is not available") } #else - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip("FILTER clause on aggregate functions is not available") } #endif @@ -1627,7 +1627,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase { throw XCTSkip("FILTER clause on aggregate functions is not available") } #else - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip("FILTER clause on aggregate functions is not available") } #endif @@ -1684,7 +1684,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase { throw XCTSkip("FILTER clause on aggregate functions is not available") } #else - guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else { + guard #available(iOS 14, macOS 10.16, tvOS 14, *) else { throw XCTSkip("FILTER clause on aggregate functions is not available") } #endif diff --git a/Tests/GRDBTests/QueryInterfaceRequestTests.swift b/Tests/GRDBTests/QueryInterfaceRequestTests.swift index 91f032354..0e075fb28 100644 --- a/Tests/GRDBTests/QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/QueryInterfaceRequestTests.swift @@ -779,7 +779,7 @@ class QueryInterfaceRequestTests: GRDBTestCase { sql(dbQueue, tableRequest.order(Col.age.descNullsFirst)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") #elseif !GRDBCIPHER - if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) { + if #available(iOS 14, macOS 10.16, tvOS 14, *) { XCTAssertEqual( sql(dbQueue, tableRequest.order(Col.age.ascNullsLast)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") @@ -809,7 +809,7 @@ class QueryInterfaceRequestTests: GRDBTestCase { sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).descNullsFirst)), "SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE DESC NULLS FIRST") #elseif !GRDBCIPHER - if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) { + if #available(iOS 14, macOS 10.16, tvOS 14, *) { XCTAssertEqual( sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).ascNullsLast)), "SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE ASC NULLS LAST") @@ -858,7 +858,7 @@ class QueryInterfaceRequestTests: GRDBTestCase { sql(dbQueue, tableRequest.order(Col.age.ascNullsLast).reversed()), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") #elseif !GRDBCIPHER - if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) { + if #available(iOS 14, macOS 10.16, tvOS 14, *) { XCTAssertEqual( sql(dbQueue, tableRequest.order(Col.age.descNullsFirst).reversed()), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") @@ -888,7 +888,7 @@ class QueryInterfaceRequestTests: GRDBTestCase { sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).descNullsFirst).reversed()), "SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE ASC NULLS LAST") #elseif !GRDBCIPHER - if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) { + if #available(iOS 14, macOS 10.16, tvOS 14, *) { XCTAssertEqual( sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).ascNullsLast).reversed()), "SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE DESC NULLS FIRST") diff --git a/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift b/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift index 1ce98c182..21896ae5b 100644 --- a/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift +++ b/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift @@ -41,7 +41,7 @@ private class MinimalNonOptionalPrimaryKeySingle: Record, Hashable { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension MinimalNonOptionalPrimaryKeySingle: Identifiable { } class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { @@ -471,7 +471,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids) @@ -510,7 +510,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids) @@ -548,7 +548,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids) @@ -583,7 +583,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.fetchOne(db, id: record.id)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -611,7 +611,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { _ = try MinimalNonOptionalPrimaryKeySingle.find(db, key: "missing") XCTFail("Expected RecordError") @@ -651,7 +651,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db) @@ -690,7 +690,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db) @@ -728,7 +728,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db) @@ -763,7 +763,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.filter(id: record.id).fetchOne(db)! XCTAssertTrue(fetchedRecord.id == record.id) diff --git a/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift b/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift index 43e649f46..37a577b21 100644 --- a/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift +++ b/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift @@ -45,7 +45,7 @@ class MinimalRowID : Record, Hashable { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension MinimalRowID: Identifiable { } class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { @@ -505,7 +505,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try MinimalRowID.fetchCursor(db, ids: ids) @@ -544,7 +544,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids) @@ -582,7 +582,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids) @@ -617,7 +617,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalRowID.fetchOne(db, id: record.id!)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -648,7 +648,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { _ = try MinimalRowID.find(db, id: -1) XCTFail("Expected RecordError") @@ -691,7 +691,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db) @@ -730,7 +730,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db) @@ -768,7 +768,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db) @@ -803,7 +803,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalRowID.filter(id: record.id!).fetchOne(db)! XCTAssertTrue(fetchedRecord.id == record.id) diff --git a/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift b/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift index 8c5c1f036..028d6ea6d 100644 --- a/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift +++ b/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift @@ -39,7 +39,7 @@ class MinimalSingle: Record, Hashable { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension MinimalSingle: Identifiable { /// Test non-optional ID type var id: String { UUID! } @@ -529,7 +529,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs) @@ -570,7 +570,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs) @@ -610,7 +610,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs) @@ -646,7 +646,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalSingle.fetchOne(db, id: record.UUID!)! XCTAssertTrue(fetchedRecord.UUID == record.UUID) @@ -675,7 +675,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { _ = try MinimalSingle.find(db, id: "missing") XCTFail("Expected RecordError") @@ -717,7 +717,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db) @@ -758,7 +758,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db) @@ -798,7 +798,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db) @@ -834,7 +834,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalSingle.filter(id: record.UUID!).fetchOne(db)! XCTAssertTrue(fetchedRecord.UUID == record.UUID) diff --git a/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift b/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift index 677772281..d2388e1d9 100644 --- a/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift +++ b/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift @@ -77,7 +77,7 @@ private class Person : Record, Hashable { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Person: Identifiable { } class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { @@ -597,7 +597,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try Person.fetchCursor(db, ids: ids) @@ -636,7 +636,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.fetchAll(db, ids: ids) @@ -674,7 +674,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.fetchSet(db, ids: ids) @@ -712,7 +712,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try Person.fetchOne(db, id: record.id!)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -749,7 +749,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { _ = try Person.find(db, id: -1) XCTFail("Expected RecordError") @@ -795,7 +795,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try Person.filter(ids: ids).fetchCursor(db) @@ -834,7 +834,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.filter(ids: ids).fetchAll(db) @@ -872,7 +872,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.filter(ids: ids).fetchSet(db) @@ -910,7 +910,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try Person.filter(id: record.id!).fetchOne(db)! XCTAssertTrue(fetchedRecord.id == record.id) diff --git a/Tests/GRDBTests/SharedValueObservationTests.swift b/Tests/GRDBTests/SharedValueObservationTests.swift index ca53c61d9..1df93529c 100644 --- a/Tests/GRDBTests/SharedValueObservationTests.swift +++ b/Tests/GRDBTests/SharedValueObservationTests.swift @@ -104,7 +104,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_immediate_publisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -381,7 +381,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_async_publisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -511,7 +511,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_observationLifetime() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -567,7 +567,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_whileObserved() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -621,7 +621,7 @@ class SharedValueObservationTests: GRDBTestCase { } #endif - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait() async throws { let dbQueue = try makeDatabaseQueue() try await dbQueue.write { db in diff --git a/Tests/GRDBTests/TableDefinitionTests.swift b/Tests/GRDBTests/TableDefinitionTests.swift index 0a114b3b1..8a831882c 100644 --- a/Tests/GRDBTests/TableDefinitionTests.swift +++ b/Tests/GRDBTests/TableDefinitionTests.swift @@ -806,7 +806,7 @@ class TableDefinitionTests: GRDBTestCase { throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") } #if !GRDBCUSTOMSQLITE && !GRDBCIPHER - guard #available(iOS 13, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, tvOS 13, *) else { throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") } #endif @@ -834,7 +834,7 @@ class TableDefinitionTests: GRDBTestCase { throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") } #if !GRDBCUSTOMSQLITE && !GRDBCIPHER - guard #available(iOS 13, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, tvOS 13, *) else { throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") } #endif diff --git a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift index a141e18e9..6d01e8f7a 100644 --- a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift @@ -259,7 +259,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { sql(dbQueue, Reader.order(Col.age.descNullsFirst)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") #elseif !GRDBCIPHER - if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) { + if #available(iOS 14, macOS 10.16, tvOS 14, *) { XCTAssertEqual( sql(dbQueue, Reader.order(Col.age.ascNullsLast)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") @@ -357,7 +357,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { } func testExistsIdentifiable() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { + guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable is not available") } diff --git a/Tests/GRDBTests/TableRecordDeleteTests.swift b/Tests/GRDBTests/TableRecordDeleteTests.swift index 88e9c8174..8c5d11e6e 100644 --- a/Tests/GRDBTests/TableRecordDeleteTests.swift +++ b/Tests/GRDBTests/TableRecordDeleteTests.swift @@ -6,7 +6,7 @@ private struct Hacker : TableRecord { var id: Int64? // Optional } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Hacker: Identifiable { } private struct Person : Codable, PersistableRecord, FetchableRecord, Hashable { @@ -16,7 +16,7 @@ private struct Person : Codable, PersistableRecord, FetchableRecord, Hashable { var email: String } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Person: Identifiable { } private struct Citizenship : TableRecord { @@ -46,7 +46,7 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertTrue(deleted) XCTAssertEqual(try Hacker.fetchCount(db), 0) - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { try db.execute(sql: "INSERT INTO hackers (rowid, name) VALUES (?, ?)", arguments: [1, "Arthur"]) try XCTAssertFalse(Hacker.deleteOne(db, id: nil)) deleted = try Hacker.deleteOne(db, id: 1) @@ -62,7 +62,7 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertEqual(deletedCount, 2) XCTAssertEqual(try Hacker.fetchCount(db), 1) - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { try db.execute(sql: "INSERT INTO hackers (rowid, name) VALUES (?, ?)", arguments: [2, "Barbara"]) try db.execute(sql: "INSERT INTO hackers (rowid, name) VALUES (?, ?)", arguments: [3, "Craig"]) let deletedCount = try Hacker.deleteAll(db, ids: [2, 3, 4]) @@ -85,7 +85,7 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertTrue(deleted) XCTAssertEqual(try Person.fetchCount(db), 0) - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { try db.execute(sql: "INSERT INTO persons (id, name, email) VALUES (?, ?, ?)", arguments: [1, "Arthur", "arthur@example.com"]) deleted = try Person.deleteOne(db, id: 1) XCTAssertTrue(deleted) @@ -100,7 +100,7 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertEqual(deletedCount, 2) XCTAssertEqual(try Person.fetchCount(db), 1) - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { try db.execute(sql: "INSERT INTO persons (id, name, email) VALUES (?, ?, ?)", arguments: [2, "Barbara", "barbara@example.com"]) try db.execute(sql: "INSERT INTO persons (id, name, email) VALUES (?, ?, ?)", arguments: [3, "Craig", "craig@example.com"]) let deletedCount = try Person.deleteAll(db, ids: [2, 3, 4]) @@ -190,7 +190,7 @@ class TableRecordDeleteTests: GRDBTestCase { try Person.filter(keys: [1, 2]).deleteAll(db) XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2)") - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { try Person.filter(id: 1).deleteAll(db) XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1") @@ -279,7 +279,7 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2) RETURNING *") #if GRDBCUSTOMSQLITE || GRDBCIPHER - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { _ = try Person.filter(id: 1).deleteAndFetchCursor(db).next() XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *") diff --git a/Tests/GRDBTests/TableRecordUpdateTests.swift b/Tests/GRDBTests/TableRecordUpdateTests.swift index b5de3fab7..dd375bc8d 100644 --- a/Tests/GRDBTests/TableRecordUpdateTests.swift +++ b/Tests/GRDBTests/TableRecordUpdateTests.swift @@ -17,7 +17,7 @@ private struct Player: Codable, PersistableRecord, FetchableRecord, Hashable { } } -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) +@available(iOS 13, macOS 10.15, tvOS 13, *) extension Player: Identifiable { } private enum Columns: String, ColumnExpression { @@ -56,7 +56,7 @@ class TableRecordUpdateTests: GRDBTestCase { UPDATE "player" SET "score" = 0 WHERE "id" IN (1, 2) """) - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { try Player.filter(id: 1).updateAll(db, assignment) XCTAssertEqual(self.lastSQLQuery, """ UPDATE "player" SET "score" = 0 WHERE "id" = 1 diff --git a/Tests/GRDBTests/TableTests.swift b/Tests/GRDBTests/TableTests.swift index 46c8f5a19..7278fa11f 100644 --- a/Tests/GRDBTests/TableTests.swift +++ b/Tests/GRDBTests/TableTests.swift @@ -117,7 +117,7 @@ class TableTests: GRDBTestCase { """) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { struct Player: Identifiable { var id: Int64 } let t = Table("player") @@ -129,7 +129,7 @@ class TableTests: GRDBTestCase { """) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { struct Player: Identifiable { var id: Int64? } let t = Table("player") @@ -806,7 +806,7 @@ class TableTests: GRDBTestCase { """) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { // Non-optional ID struct Country: Identifiable { var id: String } @@ -821,7 +821,7 @@ class TableTests: GRDBTestCase { """) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { // Optional ID struct Country: Identifiable { var id: String? } @@ -920,7 +920,7 @@ class TableTests: GRDBTestCase { """) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { // Non-optional ID struct Country: Identifiable { var id: String } @@ -930,7 +930,7 @@ class TableTests: GRDBTestCase { """) } - if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) { + if #available(iOS 13, macOS 10.15, tvOS 13, *) { // Optional ID struct Country: Identifiable { var id: String? } diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index 6be608438..b6253d3f7 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -799,7 +799,7 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Async Await - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_values_prefix() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -833,7 +833,7 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_values_break() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -871,7 +871,7 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) + @available(iOS 13, macOS 10.15, tvOS 13, *) func testAsyncAwait_values_cancelled() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change