From 8c40592955a1bb0cc9cd24fcff2011bc2fc58457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 21 Sep 2024 13:55:55 +0200 Subject: [PATCH 1/3] [BREAKING] iOS 13+ --- GRDB.swift.podspec | 2 +- GRDB/Core/Database+Statements.swift | 2 +- GRDB/Core/Database.swift | 6 ++-- GRDB/Core/DatabasePool.swift | 8 ++--- GRDB/Core/DatabasePublishers.swift | 2 +- GRDB/Core/DatabaseQueue.swift | 8 ++--- GRDB/Core/DatabaseReader.swift | 14 ++++---- GRDB/Core/DatabaseRegionObservation.swift | 6 ++-- GRDB/Core/DatabaseSnapshot.swift | 4 +-- GRDB/Core/DatabaseSnapshotPool.swift | 4 +-- GRDB/Core/DatabaseWriter.swift | 30 ++++++++-------- GRDB/Core/SerializedDatabase.swift | 8 ++--- GRDB/Dump/DumpFormats/JSONDumpFormat.swift | 2 +- GRDB/Fixits.swift | 6 ++-- GRDB/Migration/DatabaseMigrator.swift | 4 +-- .../Request/QueryInterfaceRequest.swift | 2 +- .../Request/RequestProtocols.swift | 2 +- GRDB/QueryInterface/SQL/Table.swift | 6 ++-- .../Schema/TableAlteration.swift | 2 +- .../TableRecord+QueryInterfaceRequest.swift | 2 +- GRDB/Record/FetchableRecord+TableRecord.swift | 4 +-- GRDB/Record/TableRecord.swift | 6 ++-- GRDB/Utils/OnDemandFuture.swift | 4 +-- GRDB/Utils/ReceiveValuesOn.swift | 6 ++-- .../SharedValueObservation.swift | 4 +-- GRDB/ValueObservation/ValueObservation.swift | 10 +++--- .../ValueObservationScheduler.swift | 8 ++--- Package.swift | 2 +- README.md | 2 +- SQLiteCustom/GRDBDeploymentTarget.xcconfig | 2 +- Support/GRDBDeploymentTarget.xcconfig | 2 +- Tests/CocoaPods/GRDBiOS-framework/Podfile | 2 +- .../iOS.xcodeproj/project.pbxproj | 8 ++--- Tests/CocoaPods/GRDBiOS-static/Podfile | 2 +- .../iOS.xcodeproj/project.pbxproj | 4 +-- .../AvailableElements.swift | 2 +- .../PublisherExpectations/Finished.swift | 2 +- .../PublisherExpectations/Inverted.swift | 2 +- .../PublisherExpectations/Map.swift | 4 +-- .../PublisherExpectations/Next.swift | 2 +- .../PublisherExpectations/NextOne.swift | 2 +- .../PublisherExpectations/Prefix.swift | 2 +- .../PublisherExpectations/Recording.swift | 2 +- Tests/CombineExpectations/Recorder.swift | 8 ++--- .../DatabaseReaderReadPublisherTests.swift | 12 +++---- ...abaseRegionObservationPublisherTests.swift | 4 +-- .../DatabaseWriterWritePublisherTests.swift | 26 +++++++------- Tests/GRDBCombineTests/Support.swift | 6 ++-- .../ValueObservationPublisherTests.swift | 24 ++++++------- Tests/GRDBTests/AsyncSemaphore.swift | 2 +- .../DatabaseDataEncodingStrategyTests.swift | 8 ++--- .../DatabaseDateEncodingStrategyTests.swift | 8 ++--- Tests/GRDBTests/DatabaseDumpTests.swift | 2 +- Tests/GRDBTests/DatabaseMigratorTests.swift | 12 +++---- Tests/GRDBTests/DatabaseReaderTests.swift | 22 ++++++------ .../DatabaseRegionObservationTests.swift | 2 +- .../GRDBTests/DatabaseSnapshotPoolTests.swift | 2 +- .../DatabaseUUIDEncodingStrategyTests.swift | 8 ++--- Tests/GRDBTests/DatabaseWriterTests.swift | 36 +++++++++---------- Tests/GRDBTests/JoinSupportTests.swift | 6 ++-- ...imalNonOptionalPrimaryKeySingleTests.swift | 20 +++++------ .../RecordMinimalPrimaryKeyRowIDTests.swift | 20 +++++------ .../RecordMinimalPrimaryKeySingleTests.swift | 20 +++++------ .../RecordPrimaryKeyHiddenRowIDTests.swift | 20 +++++------ .../SharedValueObservationTests.swift | 18 +++++----- Tests/GRDBTests/TableDefinitionTests.swift | 4 +-- ...bleRecord+QueryInterfaceRequestTests.swift | 2 +- Tests/GRDBTests/TableRecordDeleteTests.swift | 18 +++++----- Tests/GRDBTests/TableRecordUpdateTests.swift | 4 +-- Tests/GRDBTests/TableTests.swift | 12 +++---- ...ValueObservationRegionRecordingTests.swift | 4 +-- Tests/GRDBTests/ValueObservationTests.swift | 34 +++++++++--------- 72 files changed, 284 insertions(+), 284 deletions(-) diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index 80cf93ccb8..48182864df 100644 --- a/GRDB.swift.podspec +++ b/GRDB.swift.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.module_name = 'GRDB' s.swift_versions = ['5.10'] - s.ios.deployment_target = '12.0' + s.ios.deployment_target = '13.0' s.osx.deployment_target = '10.13' s.watchos.deployment_target = '7.0' s.tvos.deployment_target = '12.0' diff --git a/GRDB/Core/Database+Statements.swift b/GRDB/Core/Database+Statements.swift index 9c5119e3b1..f252a6bff4 100644 --- a/GRDB/Core/Database+Statements.swift +++ b/GRDB/Core/Database+Statements.swift @@ -492,7 +492,7 @@ extension Database { // and throws the user-provided cancelled commit error. try observationBroker?.statementDidFail(statement) - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { switch ResultCode(rawValue: resultCode) { case .SQLITE_INTERRUPT, .SQLITE_ABORT: if suspensionMutex.load().isCancelled { diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index e5fd1870a5..1d19d0302c 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -1199,7 +1199,7 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib /// will throw `CancellationError`, until `uncancel()` is called. /// /// This method can be called from any thread. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func cancel() { let needsInterrupt = suspensionMutex.withLock { suspension in if suspension.isCancelled { @@ -1216,7 +1216,7 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib } /// Undo `cancel()`. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func uncancel() { suspensionMutex.withLock { $0.isCancelled = false @@ -1320,7 +1320,7 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib break case .cancel: - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { throw CancellationError() } else { // GRDB bug: cancellation is a Swift concurrency feature diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index cddd0f4674..de5c5f6297 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -351,7 +351,7 @@ extension DatabasePool: DatabaseReader { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -436,7 +436,7 @@ extension DatabasePool: DatabaseReader { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -803,7 +803,7 @@ extension DatabasePool: DatabaseWriter { try writer.sync(updates) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -820,7 +820,7 @@ extension DatabasePool: DatabaseWriter { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabasePublishers.swift b/GRDB/Core/DatabasePublishers.swift index 88c0c48067..a21777814b 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, *) +@available(macOS 10.15, tvOS 13, *) public enum DatabasePublishers { } #endif diff --git a/GRDB/Core/DatabaseQueue.swift b/GRDB/Core/DatabaseQueue.swift index 57e6f88f8e..90f7c6fc10 100644 --- a/GRDB/Core/DatabaseQueue.swift +++ b/GRDB/Core/DatabaseQueue.swift @@ -233,7 +233,7 @@ extension DatabaseQueue: DatabaseReader { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -272,7 +272,7 @@ extension DatabaseQueue: DatabaseReader { try writer.sync(value) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -386,7 +386,7 @@ extension DatabaseQueue: DatabaseWriter { try writer.sync(updates) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -398,7 +398,7 @@ extension DatabaseQueue: DatabaseWriter { try writer.sync(updates) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index dbb13bb0f4..d36fb3fd72 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -216,7 +216,7 @@ public protocol DatabaseReader: AnyObject, Sendable { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `value`, or /// `CancellationError` if the task is cancelled. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -323,7 +323,7 @@ public protocol DatabaseReader: AnyObject, Sendable { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `value`, or /// `CancellationError` if the task is cancelled. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -535,7 +535,7 @@ extension DatabaseReader { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter value: A closure which accesses the database. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func readPublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, value: @escaping @Sendable (Database) throws -> Output @@ -550,7 +550,7 @@ extension DatabaseReader { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that reads from the database. /// @@ -569,7 +569,7 @@ extension DatabasePublishers { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension Publisher where Failure == Error { fileprivate func eraseToReadPublisher() -> DatabasePublishers.Read { .init(upstream: eraseToAnyPublisher()) @@ -660,7 +660,7 @@ extension AnyDatabaseReader: DatabaseReader { try base.read(value) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -678,7 +678,7 @@ extension AnyDatabaseReader: DatabaseReader { try base.unsafeRead(value) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseRegionObservation.swift b/GRDB/Core/DatabaseRegionObservation.swift index dc4d00f8f6..15d9ba92c6 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, *) +@available(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, *) + @available(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, *) +@available(macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that tracks transactions that modify a database region. /// diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 9752a90f14..9b8e9236d6 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -151,7 +151,7 @@ extension DatabaseSnapshot: DatabaseSnapshotReader { try reader.sync(block) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -173,7 +173,7 @@ extension DatabaseSnapshot: DatabaseSnapshotReader { // We can't provide this as a default implementation in // `DatabaseSnapshotReader`, because of // . - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseSnapshotPool.swift b/GRDB/Core/DatabaseSnapshotPool.swift index fa88f15343..fb66e79107 100644 --- a/GRDB/Core/DatabaseSnapshotPool.swift +++ b/GRDB/Core/DatabaseSnapshotPool.swift @@ -293,7 +293,7 @@ extension DatabaseSnapshotPool: DatabaseSnapshotReader { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -353,7 +353,7 @@ extension DatabaseSnapshotPool: DatabaseSnapshotReader { // We can't provide this as a default implementation in // `DatabaseSnapshotReader`, because of // . - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 44fd4ad98e..f717f0c56a 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -131,7 +131,7 @@ public protocol DatabaseWriter: DatabaseReader { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -217,7 +217,7 @@ public protocol DatabaseWriter: DatabaseReader { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -649,7 +649,7 @@ extension DatabaseWriter { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func write( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -666,7 +666,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, *) + @available(macOS 10.15, tvOS 13, *) public func erase() async throws { try await writeWithoutTransaction { try $0.erase() } } @@ -677,7 +677,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, *) + @available(macOS 10.15, tvOS 13, *) public func vacuum() async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM") } } @@ -694,7 +694,7 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -709,7 +709,7 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -754,7 +754,7 @@ extension DatabaseWriter { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter updates: A closure which accesses the database. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func writePublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, updates: @escaping @Sendable (Database) throws -> Output @@ -818,7 +818,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, *) + @available(macOS 10.15, tvOS 13, *) public func writePublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, updates: @escaping @Sendable (Database) throws -> T, @@ -848,7 +848,7 @@ extension DatabaseWriter { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that writes into the database. /// @@ -867,7 +867,7 @@ extension DatabasePublishers { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension Publisher where Failure == Error { fileprivate func eraseToWritePublisher() -> DatabasePublishers.Write { .init(upstream: self.eraseToAnyPublisher()) @@ -911,7 +911,7 @@ extension AnyDatabaseWriter: DatabaseReader { try base.read(value) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -929,7 +929,7 @@ extension AnyDatabaseWriter: DatabaseReader { try base.unsafeRead(value) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -964,7 +964,7 @@ extension AnyDatabaseWriter: DatabaseWriter { try base.writeWithoutTransaction(updates) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -976,7 +976,7 @@ extension AnyDatabaseWriter: DatabaseWriter { try base.barrierWriteWithoutTransaction(updates) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/SerializedDatabase.swift b/GRDB/Core/SerializedDatabase.swift index bcd5c953ac..6a64e40121 100644 --- a/GRDB/Core/SerializedDatabase.swift +++ b/GRDB/Core/SerializedDatabase.swift @@ -244,7 +244,7 @@ final class SerializedDatabase { } /// Asynchrously executes the block. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func execute( _ block: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -309,7 +309,7 @@ extension SerializedDatabase: @unchecked Sendable { } // MARK: - Task Cancellation Support -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) enum DatabaseAccessCancellationState: @unchecked Sendable { // @unchecked Sendable because database is only accessed from its // dispatch queue. @@ -319,7 +319,7 @@ enum DatabaseAccessCancellationState: @unchecked Sendable { case expired } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) typealias CancellableDatabaseAccess = Mutex /// Supports Task cancellation in async database accesses. @@ -341,7 +341,7 @@ typealias CancellableDatabaseAccess = Mutex /// } /// } /// ``` -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension CancellableDatabaseAccess: DatabaseCancellable { convenience init() { self.init(.notConnected) diff --git a/GRDB/Dump/DumpFormats/JSONDumpFormat.swift b/GRDB/Dump/DumpFormats/JSONDumpFormat.swift index 027cca3791..a3a036e5ba 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, *) { + if #available(macOS 10.15, tvOS 13.0, *) { encoder.outputFormatting = .withoutEscapingSlashes } encoder.nonConformingFloatEncodingStrategy = .convertToString( diff --git a/GRDB/Fixits.swift b/GRDB/Fixits.swift index 516c650bb4..42b768ce86 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, *) +@available(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, *) +@available(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, *) +@available(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 b67336b799..1e8b6ce2f9 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, *) + @available(macOS 10.15, tvOS 13, *) public func migratePublisher( _ writer: some DatabaseWriter, receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main) @@ -514,7 +514,7 @@ extension DatabaseMigrator { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that migrates a database. /// diff --git a/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift b/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift index e4dccaaa63..8f747ff3be 100644 --- a/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift @@ -646,7 +646,7 @@ extension QueryInterfaceRequest { /// - parameter db: A database connection. /// - returns: A set of deleted ids. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. - @available(iOS 13, macOS 10.15, tvOS 13, *) // Identifiable + @available(macOS 10.15, tvOS 13, *) // Identifiable public func deleteAndFetchIds(_ db: Database) throws -> Set where RowDecoder: TableRecord & Identifiable, diff --git a/GRDB/QueryInterface/Request/RequestProtocols.swift b/GRDB/QueryInterface/Request/RequestProtocols.swift index d4c57fc6e5..9a51e8701c 100644 --- a/GRDB/QueryInterface/Request/RequestProtocols.swift +++ b/GRDB/QueryInterface/Request/RequestProtocols.swift @@ -631,7 +631,7 @@ extension TableRequest where Self: FilteredRequest, Self: TypedRequest { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension TableRequest where Self: FilteredRequest, Self: TypedRequest, diff --git a/GRDB/QueryInterface/SQL/Table.swift b/GRDB/QueryInterface/SQL/Table.swift index 8e2a74f705..3e7dd8180a 100644 --- a/GRDB/QueryInterface/SQL/Table.swift +++ b/GRDB/QueryInterface/SQL/Table.swift @@ -722,7 +722,7 @@ extension Table { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible { /// Returns a request filtered by primary key. /// @@ -1545,7 +1545,7 @@ extension Table { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible @@ -1686,7 +1686,7 @@ extension Table { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(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 a61e6ba8d9..f10919b231 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, *) // SQLite 3.25+ + @available(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 1b1ed8c8e6..ce98f1772a 100644 --- a/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift @@ -604,7 +604,7 @@ extension TableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(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 736ca21e4e..ed006713ee 100644 --- a/GRDB/Record/FetchableRecord+TableRecord.swift +++ b/GRDB/Record/FetchableRecord+TableRecord.swift @@ -216,7 +216,7 @@ extension FetchableRecord where Self: TableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension FetchableRecord where Self: TableRecord & Identifiable, ID: DatabaseValueConvertible { // MARK: Fetching by Single-Column Primary Key @@ -358,7 +358,7 @@ extension FetchableRecord where Self: TableRecord & Hashable { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(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 46e2ad3255..cf53d3462f 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, *) +@available(macOS 10.15, tvOS 13, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Returns whether a record exists for this primary key. /// @@ -454,7 +454,7 @@ extension TableRecord { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(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, *) +@available(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 c18dc54654..03b2ad08c6 100644 --- a/GRDB/Utils/OnDemandFuture.swift +++ b/GRDB/Utils/OnDemandFuture.swift @@ -17,7 +17,7 @@ import Foundation /// /// OnDemandFuture also adds Sendable requirements that avoid /// compiler warnings. -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) struct OnDemandFuture: Publisher { typealias Promise = @Sendable (Result) -> Void typealias Output = Output @@ -36,7 +36,7 @@ struct OnDemandFuture: Publisher { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) private class OnDemandFutureSubscription: Subscription, @unchecked Sendable { // @unchecked because `state` is protected with `lock`. typealias Promise = @Sendable (Result) -> Void diff --git a/GRDB/Utils/ReceiveValuesOn.swift b/GRDB/Utils/ReceiveValuesOn.swift index 7cbbde7c12..95fb42fe0a 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, *) +@available(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, *) +@available(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, *) +@available(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 b3881a59cf..6f61750094 100644 --- a/GRDB/ValueObservation/SharedValueObservation.swift +++ b/GRDB/ValueObservation/SharedValueObservation.swift @@ -292,7 +292,7 @@ public final class SharedValueObservation: @unchecked Sendabl /// print("fresh players: \(players)") /// } /// ``` - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func publisher() -> DatabasePublishers.Value { DatabasePublishers.Value { onError, onChange in self.start(onError: onError, onChange: onChange) @@ -369,7 +369,7 @@ extension SharedValueObservation { /// print("Fresh players: \(players)") /// } /// ``` - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(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 3b0de8ef9e..b4236838b6 100644 --- a/GRDB/ValueObservation/ValueObservation.swift +++ b/GRDB/ValueObservation/ValueObservation.swift @@ -179,7 +179,7 @@ extension ValueObservation: Refinable { /// - parameter onChange: The closure to execute on receipt of a /// fresh value. /// - returns: A DatabaseCancellable that can stop the observation. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) @preconcurrency @MainActor public func start( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationMainActorScheduler = .mainActor, @@ -350,7 +350,7 @@ extension ValueObservation { /// fresh values are dispatched on the cooperative thread pool. /// - parameter bufferingPolicy: see the documntation /// of `AsyncThrowingStream`. - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) public func values( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler = .task, @@ -386,7 +386,7 @@ extension ValueObservation { /// /// You build an `AsyncValueObservation` from ``ValueObservation`` or /// ``SharedValueObservation``. -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) public struct AsyncValueObservation: AsyncSequence { public typealias BufferingPolicy = AsyncThrowingStream.Continuation.BufferingPolicy public typealias AsyncIterator = Iterator @@ -488,7 +488,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, *) + @available(macOS 10.15, tvOS 13, *) public func publisher( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler = .async(onQueue: .main)) @@ -505,7 +505,7 @@ extension ValueObservation { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension DatabasePublishers { /// A publisher that publishes the values of a ``ValueObservation``. /// diff --git a/GRDB/ValueObservation/ValueObservationScheduler.swift b/GRDB/ValueObservation/ValueObservationScheduler.swift index b4080efb32..5188d3452c 100644 --- a/GRDB/ValueObservation/ValueObservationScheduler.swift +++ b/GRDB/ValueObservation/ValueObservationScheduler.swift @@ -182,7 +182,7 @@ extension ValueObservationMainActorScheduler where Self == ImmediateValueObserva // MARK: - TaskValueObservationScheduler /// A scheduler that notifies all values on the cooperative thread pool. -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) public final class TaskValueObservationScheduler: ValueObservationScheduler { typealias Action = @Sendable () -> Void let continuation: AsyncStream.Continuation @@ -212,7 +212,7 @@ public final class TaskValueObservationScheduler: ValueObservationScheduler { } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension ValueObservationScheduler where Self == TaskValueObservationScheduler { /// A scheduler that notifies all values from a new `Task`. public static var task: TaskValueObservationScheduler { @@ -229,7 +229,7 @@ extension ValueObservationScheduler where Self == TaskValueObservationScheduler // MARK: - DelayedMainActorValueObservationScheduler /// A scheduler that notifies all values on the cooperative thread pool. -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) public final class DelayedMainActorValueObservationScheduler: ValueObservationMainActorScheduler { public func immediateInitialValue() -> Bool { false @@ -240,7 +240,7 @@ public final class DelayedMainActorValueObservationScheduler: ValueObservationMa } } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension ValueObservationScheduler where Self == DelayedMainActorValueObservationScheduler { /// A scheduler that notifies all values on the main actor. public static var mainActor: DelayedMainActorValueObservationScheduler { diff --git a/Package.swift b/Package.swift index fa9e19b323..af1aace2fc 100644 --- a/Package.swift +++ b/Package.swift @@ -36,7 +36,7 @@ let package = Package( name: "GRDB", defaultLocalization: "en", // for tests platforms: [ - .iOS(.v12), + .iOS(.v13), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v7), diff --git a/README.md b/README.md index cdc95bbee0..be3bff834f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ **Latest release**: September 7, 2024 • [version 6.29.3](https://github.com/groue/GRDB.swift/tree/v6.29.3) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md) -**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / watchOS 7.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+ +**Requirements**: iOS 13.0+ / macOS 10.13+ / tvOS 12.0+ / watchOS 7.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+ **Contact**: diff --git a/SQLiteCustom/GRDBDeploymentTarget.xcconfig b/SQLiteCustom/GRDBDeploymentTarget.xcconfig index c4f1fe1970..8f02cc8937 100644 --- a/SQLiteCustom/GRDBDeploymentTarget.xcconfig +++ b/SQLiteCustom/GRDBDeploymentTarget.xcconfig @@ -1,4 +1,4 @@ -IPHONEOS_DEPLOYMENT_TARGET = 12.0 +IPHONEOS_DEPLOYMENT_TARGET = 13.0 MACOSX_DEPLOYMENT_TARGET = 10.13 TVOS_DEPLOYMENT_TARGET = 12.0 WATCHOS_DEPLOYMENT_TARGET = 7.0 diff --git a/Support/GRDBDeploymentTarget.xcconfig b/Support/GRDBDeploymentTarget.xcconfig index f08af6102e..d20702f0c6 100644 --- a/Support/GRDBDeploymentTarget.xcconfig +++ b/Support/GRDBDeploymentTarget.xcconfig @@ -1,4 +1,4 @@ -IPHONEOS_DEPLOYMENT_TARGET = 12.0 +IPHONEOS_DEPLOYMENT_TARGET = 13.0 MACOSX_DEPLOYMENT_TARGET = 10.13 TVOS_DEPLOYMENT_TARGET = 12.0 WATCHOS_DEPLOYMENT_TARGET = 7.0 diff --git a/Tests/CocoaPods/GRDBiOS-framework/Podfile b/Tests/CocoaPods/GRDBiOS-framework/Podfile index 2c4299502a..82bf451d20 100644 --- a/Tests/CocoaPods/GRDBiOS-framework/Podfile +++ b/Tests/CocoaPods/GRDBiOS-framework/Podfile @@ -1,6 +1,6 @@ use_frameworks! target 'iOS' -platform :ios, '12.0' +platform :ios, '13.0' pod 'GRDB.swift', :path => '../../..' post_install do |installer| diff --git a/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj b/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj index 7a961bd71c..b04521c007 100644 --- a/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj +++ b/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj @@ -251,7 +251,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -301,7 +301,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -318,7 +318,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBTest; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -335,7 +335,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBTest; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Tests/CocoaPods/GRDBiOS-static/Podfile b/Tests/CocoaPods/GRDBiOS-static/Podfile index 3746f208fc..f4137605f3 100644 --- a/Tests/CocoaPods/GRDBiOS-static/Podfile +++ b/Tests/CocoaPods/GRDBiOS-static/Podfile @@ -1,5 +1,5 @@ target 'iOS' -platform :ios, '12.0' +platform :ios, '13.0' pod 'GRDB.swift', :path => '../../..' post_install do |installer| diff --git a/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj b/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj index 3ee741cb0d..acfaddb1ce 100644 --- a/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj +++ b/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj @@ -232,7 +232,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -282,7 +282,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift b/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift index 5b78e39ed4..51198282b5 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, *) +@available(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 5f866e7c9e..c9d1c8a6be 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, *) +@available(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 6900f834ed..ceb59955ea 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, *) +@available(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 0c6a22c4cf..e15e6607ec 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, *) +@available(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, *) +@available(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 70e73836fe..3fd8010dd6 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, *) +@available(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 6bc8ff10ed..492c2ba3b8 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, *) +@available(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 f3fcd20538..3f055e1286 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, *) +@available(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 2327188f69..0b88ae2731 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, *) +@available(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 3d5be6f7b7..569066dbb2 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, *) +@available(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, *) +@available(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, *) +@available(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, *) +@available(macOS 10.15, tvOS 13, *) extension Publisher { /// Returns a subscribed Recorder. /// diff --git a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift index 56cb6d1e15..b45baff0e8 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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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 8c5e870f1c..1a91d0c933 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, *) else { + guard #available(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, *) else { + guard #available(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 cc3903dabf..585359af26 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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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 0805d0bc07..3759c94fa4 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, *) +@available(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, *) +@available(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, *) +@available(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 fff31440fa..86c98fa669 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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) + @available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(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, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBTests/AsyncSemaphore.swift b/Tests/GRDBTests/AsyncSemaphore.swift index 6e8d474b30..3ac88d4959 100644 --- a/Tests/GRDBTests/AsyncSemaphore.swift +++ b/Tests/GRDBTests/AsyncSemaphore.swift @@ -43,7 +43,7 @@ import Foundation /// /// - ``wait()`` /// - ``waitUnlessCancelled()`` -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) public final class AsyncSemaphore: @unchecked Sendable { /// `Suspension` is the state of a task waiting for a signal. /// diff --git a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift index 567affede7..20061cebed 100644 --- a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift @@ -25,7 +25,7 @@ private struct RecordWithData: EncodableRecord, Enco var data: Data } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension RecordWithData: Identifiable { var id: Data { data } } @@ -37,7 +37,7 @@ private struct RecordWithOptionalData: EncodableReco var data: Data? } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension RecordWithOptionalData: Identifiable { var id: Data? { data } } @@ -154,7 +154,7 @@ extension DatabaseDataEncodingStrategyTests { } func testFilterID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } @@ -234,7 +234,7 @@ extension DatabaseDataEncodingStrategyTests { } func testDeleteID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift index 4d32142727..a071a7ddbf 100644 --- a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift @@ -52,7 +52,7 @@ private struct RecordWithDate: EncodableRecord, Enco var date: Date } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension RecordWithDate: Identifiable { var id: Date { date } } @@ -64,7 +64,7 @@ private struct RecordWithOptionalDate: EncodableReco var date: Date? } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension RecordWithOptionalDate: Identifiable { var id: Date? { date } } @@ -264,7 +264,7 @@ extension DatabaseDateEncodingStrategyTests { } func testFilterID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } @@ -344,7 +344,7 @@ extension DatabaseDateEncodingStrategyTests { } func testDeleteID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseDumpTests.swift b/Tests/GRDBTests/DatabaseDumpTests.swift index 432177ed9d..425f1f4e62 100644 --- a/Tests/GRDBTests/DatabaseDumpTests.swift +++ b/Tests/GRDBTests/DatabaseDumpTests.swift @@ -238,7 +238,7 @@ final class DatabaseDumpTests: GRDBTestCase { // MARK: - JSON func test_json_value_formatting() throws { - guard #available(iOS 13.0, macOS 10.15, tvOS 13.0, *) else { + guard #available(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 a9efa088d0..114e9743c2 100644 --- a/Tests/GRDBTests/DatabaseMigratorTests.swift +++ b/Tests/GRDBTests/DatabaseMigratorTests.swift @@ -41,7 +41,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -153,7 +153,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -209,7 +209,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -235,7 +235,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -262,7 +262,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherDefaultScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -291,7 +291,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherCustomScheduler() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(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 4381016351..5428c22709 100644 --- a/Tests/GRDBTests/DatabaseReaderTests.swift +++ b/Tests/GRDBTests/DatabaseReaderTests.swift @@ -49,7 +49,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_ReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -91,7 +91,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_ReadPreventsDatabaseModification() async throws { func test(_ dbReader: some DatabaseReader) async throws { do { @@ -135,7 +135,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_UnsafeReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -347,7 +347,7 @@ class DatabaseReaderTests : GRDBTestCase { // MARK: - Task Cancellation - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_read_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -383,7 +383,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_read_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -420,7 +420,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_statement_execution_from_read_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -459,7 +459,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_cursor_iteration_from_read_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -502,7 +502,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_unsafeRead_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -538,7 +538,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_unsafeRead_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -575,7 +575,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_statement_execution_from_unsafeRead_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -614,7 +614,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_cursor_iteration_from_unsafeRead_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) diff --git a/Tests/GRDBTests/DatabaseRegionObservationTests.swift b/Tests/GRDBTests/DatabaseRegionObservationTests.swift index 341616b37f..3f91a54fcb 100644 --- a/Tests/GRDBTests/DatabaseRegionObservationTests.swift +++ b/Tests/GRDBTests/DatabaseRegionObservationTests.swift @@ -9,7 +9,7 @@ class DatabaseRegionObservationTests: GRDBTestCase { _ = observation.start(in: writer, onError: { _ in }, onChange: { _ in }) - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { _ = observation.publisher(in: writer) } } diff --git a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift index 0caf342139..c839451c05 100644 --- a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift +++ b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift @@ -229,7 +229,7 @@ final class DatabaseSnapshotPoolTests: GRDBTestCase { try XCTAssertEqual(dbPool.read(counter.value), 2) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(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 c5c652ac28..7fb74781b8 100644 --- a/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift @@ -26,7 +26,7 @@ private struct RecordWithUUID: EncodableRecord, Enco var uuid: UUID } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension RecordWithUUID: Identifiable { var id: UUID { uuid } } @@ -39,7 +39,7 @@ private struct RecordWithOptionalUUID: EncodableReco var uuid: UUID? } -@available(iOS 13, macOS 10.15, tvOS 13, *) +@available(macOS 10.15, tvOS 13, *) extension RecordWithOptionalUUID: Identifiable { var id: UUID? { uuid } } @@ -190,7 +190,7 @@ extension DatabaseUUIDEncodingStrategyTests { } func testFilterID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } @@ -309,7 +309,7 @@ extension DatabaseUUIDEncodingStrategyTests { } func testDeleteID() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseWriterTests.swift b/Tests/GRDBTests/DatabaseWriterTests.swift index 478cab6c5b..62b5c3e6f6 100644 --- a/Tests/GRDBTests/DatabaseWriterTests.swift +++ b/Tests/GRDBTests/DatabaseWriterTests.swift @@ -275,7 +275,7 @@ class DatabaseWriterTests : GRDBTestCase { try DatabaseQueue().backup(to: dbQueue) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(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, *) + @available(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, *) + @available(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, *) + @available(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, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_vacuum() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -406,7 +406,7 @@ class DatabaseWriterTests : GRDBTestCase { } /// A test related to - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(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 { @@ -430,7 +430,7 @@ class DatabaseWriterTests : GRDBTestCase { // MARK: - Task Cancellation - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -461,7 +461,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -493,7 +493,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_statement_execution_from_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -527,7 +527,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_cursor_iteration_from_writeWithoutTransaction_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -565,7 +565,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_write_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -596,7 +596,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_write_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -628,7 +628,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_statement_execution_from_write_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -662,7 +662,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_cursor_iteration_from_write_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -700,7 +700,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -731,7 +731,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -763,7 +763,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_statement_execution_from_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -797,7 +797,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_cursor_iteration_from_barrierWriteWithoutTransaction_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) diff --git a/Tests/GRDBTests/JoinSupportTests.swift b/Tests/GRDBTests/JoinSupportTests.swift index 4b703bd71a..a3a5c9974c 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, *) + @available(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, *) + @available(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, *) + @available(macOS 10.15, tvOS 13, *) static func modernAll() -> some FetchRequest { all() } diff --git a/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift b/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift index a77404913f..64762126b0 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, *) +@available(macOS 10.15, tvOS 13, *) extension MinimalNonOptionalPrimaryKeySingle: Identifiable { } class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { @@ -473,7 +473,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids) @@ -512,7 +512,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids) @@ -550,7 +550,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids) @@ -585,7 +585,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.fetchOne(db, id: record.id)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -613,7 +613,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { _ = try MinimalNonOptionalPrimaryKeySingle.find(db, key: "missing") XCTFail("Expected RecordError") @@ -653,7 +653,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db) @@ -692,7 +692,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db) @@ -730,7 +730,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db) @@ -765,7 +765,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(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 ff462cb6ae..31c1d684fc 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, *) +@available(macOS 10.15, tvOS 13, *) extension MinimalRowID: Identifiable { } class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { @@ -507,7 +507,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try MinimalRowID.fetchCursor(db, ids: ids) @@ -546,7 +546,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids) @@ -584,7 +584,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids) @@ -619,7 +619,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalRowID.fetchOne(db, id: record.id!)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -650,7 +650,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { _ = try MinimalRowID.find(db, id: -1) XCTFail("Expected RecordError") @@ -693,7 +693,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db) @@ -732,7 +732,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db) @@ -770,7 +770,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db) @@ -805,7 +805,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(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 9139d0cfc4..0e3eb7fd41 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, *) +@available(macOS 10.15, tvOS 13, *) extension MinimalSingle: Identifiable { /// Test non-optional ID type var id: String { UUID! } @@ -531,7 +531,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs) @@ -572,7 +572,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs) @@ -612,7 +612,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs) @@ -648,7 +648,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try MinimalSingle.fetchOne(db, id: record.UUID!)! XCTAssertTrue(fetchedRecord.UUID == record.UUID) @@ -677,7 +677,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { _ = try MinimalSingle.find(db, id: "missing") XCTFail("Expected RecordError") @@ -719,7 +719,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db) @@ -760,7 +760,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db) @@ -800,7 +800,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db) @@ -836,7 +836,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(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 cc4de060e1..398f2d9909 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, *) +@available(macOS 10.15, tvOS 13, *) extension Person: Identifiable { } class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { @@ -599,7 +599,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try Person.fetchCursor(db, ids: ids) @@ -638,7 +638,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.fetchAll(db, ids: ids) @@ -676,7 +676,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.fetchSet(db, ids: ids) @@ -714,7 +714,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let fetchedRecord = try Person.fetchOne(db, id: record.id!)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -751,7 +751,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { _ = try Person.find(db, id: -1) XCTFail("Expected RecordError") @@ -797,7 +797,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let cursor = try Person.filter(ids: ids).fetchCursor(db) @@ -836,7 +836,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.filter(ids: ids).fetchAll(db) @@ -874,7 +874,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, tvOS 13, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.filter(ids: ids).fetchSet(db) @@ -912,7 +912,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(iOS 13, macOS 10.15, tvOS 13, *) { + if #available(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 2b4ff72163..4a61b1bb10 100644 --- a/Tests/GRDBTests/SharedValueObservationTests.swift +++ b/Tests/GRDBTests/SharedValueObservationTests.swift @@ -120,7 +120,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_immediate_publisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -397,7 +397,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_async_publisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -525,7 +525,7 @@ class SharedValueObservationTests: GRDBTestCase { XCTAssertEqual(log.flush(), []) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_task_observationLifetime() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -622,7 +622,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_task_publisher() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -656,7 +656,7 @@ class SharedValueObservationTests: GRDBTestCase { } #endif - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func test_task_whileObserved() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -753,7 +753,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_observationLifetime() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -811,7 +811,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_whileObserved() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, tvOS 13, *) else { throw XCTSkip("Combine is not available") } @@ -867,7 +867,7 @@ class SharedValueObservationTests: GRDBTestCase { } #endif - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_mainQueue() async throws { let dbQueue = try makeDatabaseQueue() try await dbQueue.write { db in @@ -887,7 +887,7 @@ class SharedValueObservationTests: GRDBTestCase { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_task() 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 3c138d6e59..26b7ba31b1 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, *) else { + guard #available(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, *) else { + guard #available(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 737220992c..0c28204e88 100644 --- a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift @@ -357,7 +357,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { } func testExistsIdentifiable() throws { - guard #available(iOS 13, macOS 10.15, tvOS 13, *) else { + guard #available(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 37a7249c1a..eb1b3f479a 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, *) +@available(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, *) +@available(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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(macOS 10.15, tvOS 13, *) { _ = try Person.filter(id: 1).deleteAndFetchCursor(db).next() XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *") @@ -364,7 +364,7 @@ class TableRecordDeleteTests: GRDBTestCase { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) // Identifiable + @available(macOS 10.15, tvOS 13, *) // Identifiable func testRequestDeleteAndFetchIds() throws { #if GRDBCUSTOMSQLITE || GRDBCIPHER guard sqlite3_libversion_number() >= 3035000 else { diff --git a/Tests/GRDBTests/TableRecordUpdateTests.swift b/Tests/GRDBTests/TableRecordUpdateTests.swift index ac7bf5f84b..b5a249eb84 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, *) +@available(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, *) { + if #available(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 fa7325771c..7576902fdc 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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(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, *) { + if #available(macOS 10.15, tvOS 13, *) { // Optional ID struct Country: Identifiable { var id: String? } diff --git a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift index 54d90f9f43..dff05d4c5e 100644 --- a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift +++ b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift @@ -105,7 +105,7 @@ class ValueObservationRegionRecordingTests: GRDBTestCase { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testTupleObservation() throws { // Here we just test that user can destructure an observed tuple. // I'm completely paranoid about tuple destructuring - I can't wrap my @@ -120,7 +120,7 @@ class ValueObservationRegionRecordingTests: GRDBTestCase { onChange: { (int: Int, string: String) in }) // <- destructure } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testVaryingRegionTrackingImmediateScheduling() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index 20e0626c70..142ce7249e 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -5,7 +5,7 @@ import Dispatch class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testStartFromAnyDatabaseReader(reader: any DatabaseReader) { _ = ValueObservation .trackingConstantRegion { _ in } @@ -14,7 +14,7 @@ class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testStartFromAnyDatabaseWriter(writer: any DatabaseWriter) { _ = ValueObservation .trackingConstantRegion { _ in } @@ -23,7 +23,7 @@ class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testValuesFromAnyDatabaseWriter(writer: any DatabaseWriter) { func observe( fetch: @escaping @Sendable (Database) throws -> T @@ -55,7 +55,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testErrorCompletesTheObservation() throws { struct TestError: Error { } @@ -105,7 +105,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testViewOptimization() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { @@ -143,7 +143,7 @@ class ValueObservationTests: GRDBTestCase { } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testPragmaTableOptimization() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { @@ -179,7 +179,7 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Constant Explicit Region - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testTrackingExplicitRegion() throws { class TestStream: TextOutputStream { private var stringsMutex: Mutex<[String]> = Mutex([]) @@ -620,7 +620,7 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Cancellation - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testCancellableLifetime() throws { // We need something to change let dbQueue = try makeDatabaseQueue() @@ -666,7 +666,7 @@ class ValueObservationTests: GRDBTestCase { XCTAssertEqual(changesCountMutex.load(), 2) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testCancellableExplicitCancellation() throws { // We need something to change let dbQueue = try makeDatabaseQueue() @@ -804,7 +804,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testIssue1550() throws { func test(_ writer: some DatabaseWriter) throws { try writer.write { try $0.execute(sql: "CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } @@ -852,7 +852,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testIssue1209() throws { func test(_ dbWriter: some DatabaseWriter) throws { try dbWriter.write { @@ -903,7 +903,7 @@ class ValueObservationTests: GRDBTestCase { } // MARK: - Main Actor - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) @MainActor func test_mainActor_observation() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -939,7 +939,7 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Async Await - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_values_prefix() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -977,7 +977,7 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_values_break() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -1019,7 +1019,7 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testAsyncAwait_values_cancelled() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -1201,7 +1201,7 @@ class ValueObservationTests: GRDBTestCase { } // Regression test for - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testIssue1362() throws { func test(_ writer: some DatabaseWriter) throws { try writer.write { try $0.execute(sql: "CREATE TABLE s(id INTEGER PRIMARY KEY AUTOINCREMENT)") } @@ -1292,7 +1292,7 @@ class ValueObservationTests: GRDBTestCase { } // Regression test for - @available(iOS 13, macOS 10.15, tvOS 13, *) + @available(macOS 10.15, tvOS 13, *) func testIssue1383_async() throws { do { let dbPool = try makeDatabasePool(filename: "test") From e4a473549499ecd2cd9cdda44f9057af3da356ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 21 Sep 2024 13:21:27 +0200 Subject: [PATCH 2/3] [BREAKING] tvOS 13+ --- GRDB.swift.podspec | 2 +- GRDB/Core/Database+Statements.swift | 2 +- GRDB/Core/Database.swift | 6 ++-- GRDB/Core/DatabasePool.swift | 8 ++--- GRDB/Core/DatabasePublishers.swift | 2 +- GRDB/Core/DatabaseQueue.swift | 8 ++--- GRDB/Core/DatabaseReader.swift | 14 ++++---- GRDB/Core/DatabaseRegionObservation.swift | 6 ++-- GRDB/Core/DatabaseSnapshot.swift | 4 +-- GRDB/Core/DatabaseSnapshotPool.swift | 4 +-- GRDB/Core/DatabaseWriter.swift | 30 ++++++++-------- GRDB/Core/SerializedDatabase.swift | 8 ++--- GRDB/Dump/DumpFormats/JSONDumpFormat.swift | 2 +- GRDB/Fixits.swift | 6 ++-- GRDB/Migration/DatabaseMigrator.swift | 4 +-- .../Request/QueryInterfaceRequest.swift | 2 +- .../Request/RequestProtocols.swift | 2 +- GRDB/QueryInterface/SQL/Table.swift | 6 ++-- .../Schema/TableAlteration.swift | 1 - .../TableRecord+QueryInterfaceRequest.swift | 2 +- GRDB/Record/FetchableRecord+TableRecord.swift | 4 +-- GRDB/Record/TableRecord.swift | 6 ++-- GRDB/Utils/OnDemandFuture.swift | 4 +-- GRDB/Utils/ReceiveValuesOn.swift | 6 ++-- .../SharedValueObservation.swift | 4 +-- GRDB/ValueObservation/ValueObservation.swift | 10 +++--- .../ValueObservationScheduler.swift | 8 ++--- Package.swift | 2 +- README.md | 2 +- SQLiteCustom/GRDBDeploymentTarget.xcconfig | 2 +- Support/GRDBDeploymentTarget.xcconfig | 2 +- .../AvailableElements.swift | 2 +- .../PublisherExpectations/Finished.swift | 2 +- .../PublisherExpectations/Inverted.swift | 2 +- .../PublisherExpectations/Map.swift | 4 +-- .../PublisherExpectations/Next.swift | 2 +- .../PublisherExpectations/NextOne.swift | 2 +- .../PublisherExpectations/Prefix.swift | 2 +- .../PublisherExpectations/Recording.swift | 2 +- Tests/CombineExpectations/Recorder.swift | 8 ++--- .../DatabaseReaderReadPublisherTests.swift | 12 +++---- ...abaseRegionObservationPublisherTests.swift | 4 +-- .../DatabaseWriterWritePublisherTests.swift | 26 +++++++------- Tests/GRDBCombineTests/Support.swift | 6 ++-- .../ValueObservationPublisherTests.swift | 24 ++++++------- Tests/GRDBTests/AsyncSemaphore.swift | 2 +- .../DatabaseDataEncodingStrategyTests.swift | 8 ++--- .../DatabaseDateEncodingStrategyTests.swift | 8 ++--- Tests/GRDBTests/DatabaseDumpTests.swift | 2 +- Tests/GRDBTests/DatabaseMigratorTests.swift | 12 +++---- Tests/GRDBTests/DatabaseReaderTests.swift | 22 ++++++------ .../DatabaseRegionObservationTests.swift | 2 +- .../GRDBTests/DatabaseSnapshotPoolTests.swift | 2 +- .../DatabaseUUIDEncodingStrategyTests.swift | 8 ++--- Tests/GRDBTests/DatabaseWriterTests.swift | 36 +++++++++---------- Tests/GRDBTests/JoinSupportTests.swift | 6 ++-- ...imalNonOptionalPrimaryKeySingleTests.swift | 20 +++++------ .../RecordMinimalPrimaryKeyRowIDTests.swift | 20 +++++------ .../RecordMinimalPrimaryKeySingleTests.swift | 20 +++++------ .../RecordPrimaryKeyHiddenRowIDTests.swift | 20 +++++------ .../SharedValueObservationTests.swift | 18 +++++----- Tests/GRDBTests/TableDefinitionTests.swift | 10 ------ ...bleRecord+QueryInterfaceRequestTests.swift | 2 +- Tests/GRDBTests/TableRecordDeleteTests.swift | 18 +++++----- Tests/GRDBTests/TableRecordUpdateTests.swift | 4 +-- Tests/GRDBTests/TableTests.swift | 12 +++---- ...ValueObservationRegionRecordingTests.swift | 4 +-- Tests/GRDBTests/ValueObservationTests.swift | 34 +++++++++--------- 68 files changed, 273 insertions(+), 284 deletions(-) diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index 48182864df..de695d4afa 100644 --- a/GRDB.swift.podspec +++ b/GRDB.swift.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = '13.0' s.osx.deployment_target = '10.13' s.watchos.deployment_target = '7.0' - s.tvos.deployment_target = '12.0' + s.tvos.deployment_target = '13.0' s.default_subspec = 'standard' s.subspec 'standard' do |ss| diff --git a/GRDB/Core/Database+Statements.swift b/GRDB/Core/Database+Statements.swift index f252a6bff4..1b2806b3ba 100644 --- a/GRDB/Core/Database+Statements.swift +++ b/GRDB/Core/Database+Statements.swift @@ -492,7 +492,7 @@ extension Database { // and throws the user-provided cancelled commit error. try observationBroker?.statementDidFail(statement) - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { switch ResultCode(rawValue: resultCode) { case .SQLITE_INTERRUPT, .SQLITE_ABORT: if suspensionMutex.load().isCancelled { diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index 1d19d0302c..f6574eeabb 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -1199,7 +1199,7 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib /// will throw `CancellationError`, until `uncancel()` is called. /// /// This method can be called from any thread. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func cancel() { let needsInterrupt = suspensionMutex.withLock { suspension in if suspension.isCancelled { @@ -1216,7 +1216,7 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib } /// Undo `cancel()`. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func uncancel() { suspensionMutex.withLock { $0.isCancelled = false @@ -1320,7 +1320,7 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib break case .cancel: - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { throw CancellationError() } else { // GRDB bug: cancellation is a Swift concurrency feature diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index de5c5f6297..74a67b6c47 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -351,7 +351,7 @@ extension DatabasePool: DatabaseReader { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -436,7 +436,7 @@ extension DatabasePool: DatabaseReader { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -803,7 +803,7 @@ extension DatabasePool: DatabaseWriter { try writer.sync(updates) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -820,7 +820,7 @@ extension DatabasePool: DatabaseWriter { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabasePublishers.swift b/GRDB/Core/DatabasePublishers.swift index a21777814b..04ca12e84b 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public enum DatabasePublishers { } #endif diff --git a/GRDB/Core/DatabaseQueue.swift b/GRDB/Core/DatabaseQueue.swift index 90f7c6fc10..ebf822667b 100644 --- a/GRDB/Core/DatabaseQueue.swift +++ b/GRDB/Core/DatabaseQueue.swift @@ -233,7 +233,7 @@ extension DatabaseQueue: DatabaseReader { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -272,7 +272,7 @@ extension DatabaseQueue: DatabaseReader { try writer.sync(value) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -386,7 +386,7 @@ extension DatabaseQueue: DatabaseWriter { try writer.sync(updates) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -398,7 +398,7 @@ extension DatabaseQueue: DatabaseWriter { try writer.sync(updates) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index d36fb3fd72..ed7736c6f6 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -216,7 +216,7 @@ public protocol DatabaseReader: AnyObject, Sendable { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `value`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -323,7 +323,7 @@ public protocol DatabaseReader: AnyObject, Sendable { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `value`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -535,7 +535,7 @@ extension DatabaseReader { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter value: A closure which accesses the database. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func readPublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, value: @escaping @Sendable (Database) throws -> Output @@ -550,7 +550,7 @@ extension DatabaseReader { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that reads from the database. /// @@ -569,7 +569,7 @@ extension DatabasePublishers { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Publisher where Failure == Error { fileprivate func eraseToReadPublisher() -> DatabasePublishers.Read { .init(upstream: eraseToAnyPublisher()) @@ -660,7 +660,7 @@ extension AnyDatabaseReader: DatabaseReader { try base.read(value) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -678,7 +678,7 @@ extension AnyDatabaseReader: DatabaseReader { try base.unsafeRead(value) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseRegionObservation.swift b/GRDB/Core/DatabaseRegionObservation.swift index 15d9ba92c6..4d5ab11938 100644 --- a/GRDB/Core/DatabaseRegionObservation.swift +++ b/GRDB/Core/DatabaseRegionObservation.swift @@ -128,7 +128,7 @@ extension DatabaseRegionObservation { } #if canImport(Combine) -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that tracks transactions that modify a database region. /// diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 9b8e9236d6..36b131cea8 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -151,7 +151,7 @@ extension DatabaseSnapshot: DatabaseSnapshotReader { try reader.sync(block) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -173,7 +173,7 @@ extension DatabaseSnapshot: DatabaseSnapshotReader { // We can't provide this as a default implementation in // `DatabaseSnapshotReader`, because of // . - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseSnapshotPool.swift b/GRDB/Core/DatabaseSnapshotPool.swift index fb66e79107..826c7d0f68 100644 --- a/GRDB/Core/DatabaseSnapshotPool.swift +++ b/GRDB/Core/DatabaseSnapshotPool.swift @@ -293,7 +293,7 @@ extension DatabaseSnapshotPool: DatabaseSnapshotReader { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -353,7 +353,7 @@ extension DatabaseSnapshotPool: DatabaseSnapshotReader { // We can't provide this as a default implementation in // `DatabaseSnapshotReader`, because of // . - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index f717f0c56a..b1928b14ae 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -131,7 +131,7 @@ public protocol DatabaseWriter: DatabaseReader { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -217,7 +217,7 @@ public protocol DatabaseWriter: DatabaseReader { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -649,7 +649,7 @@ extension DatabaseWriter { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func write( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -666,7 +666,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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func erase() async throws { try await writeWithoutTransaction { try $0.erase() } } @@ -677,7 +677,7 @@ extension DatabaseWriter { /// - note: [**🔥 EXPERIMENTAL**](https://github.com/groue/GRDB.swift/blob/master/README.md#what-are-experimental-features) /// /// Related SQLite documentation: - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func vacuum() async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM") } } @@ -694,7 +694,7 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -709,7 +709,7 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -754,7 +754,7 @@ extension DatabaseWriter { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter updates: A closure which accesses the database. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func writePublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, updates: @escaping @Sendable (Database) throws -> Output @@ -818,7 +818,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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func writePublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, updates: @escaping @Sendable (Database) throws -> T, @@ -848,7 +848,7 @@ extension DatabaseWriter { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that writes into the database. /// @@ -867,7 +867,7 @@ extension DatabasePublishers { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Publisher where Failure == Error { fileprivate func eraseToWritePublisher() -> DatabasePublishers.Write { .init(upstream: self.eraseToAnyPublisher()) @@ -911,7 +911,7 @@ extension AnyDatabaseWriter: DatabaseReader { try base.read(value) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -929,7 +929,7 @@ extension AnyDatabaseWriter: DatabaseReader { try base.unsafeRead(value) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -964,7 +964,7 @@ extension AnyDatabaseWriter: DatabaseWriter { try base.writeWithoutTransaction(updates) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -976,7 +976,7 @@ extension AnyDatabaseWriter: DatabaseWriter { try base.barrierWriteWithoutTransaction(updates) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/SerializedDatabase.swift b/GRDB/Core/SerializedDatabase.swift index 6a64e40121..6668360116 100644 --- a/GRDB/Core/SerializedDatabase.swift +++ b/GRDB/Core/SerializedDatabase.swift @@ -244,7 +244,7 @@ final class SerializedDatabase { } /// Asynchrously executes the block. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func execute( _ block: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -309,7 +309,7 @@ extension SerializedDatabase: @unchecked Sendable { } // MARK: - Task Cancellation Support -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) enum DatabaseAccessCancellationState: @unchecked Sendable { // @unchecked Sendable because database is only accessed from its // dispatch queue. @@ -319,7 +319,7 @@ enum DatabaseAccessCancellationState: @unchecked Sendable { case expired } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) typealias CancellableDatabaseAccess = Mutex /// Supports Task cancellation in async database accesses. @@ -341,7 +341,7 @@ typealias CancellableDatabaseAccess = Mutex /// } /// } /// ``` -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension CancellableDatabaseAccess: DatabaseCancellable { convenience init() { self.init(.notConnected) diff --git a/GRDB/Dump/DumpFormats/JSONDumpFormat.swift b/GRDB/Dump/DumpFormats/JSONDumpFormat.swift index a3a036e5ba..f24eaa1216 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(macOS 10.15, tvOS 13.0, *) { + if #available(macOS 10.15.0, *) { encoder.outputFormatting = .withoutEscapingSlashes } encoder.nonConformingFloatEncodingStrategy = .convertToString( diff --git a/GRDB/Fixits.swift b/GRDB/Fixits.swift index 42b768ce86..453741c455 100644 --- a/GRDB/Fixits.swift +++ b/GRDB/Fixits.swift @@ -119,7 +119,7 @@ extension PersistableRecord { public func performSave(_ db: Database) throws { preconditionFailure() } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 1e8b6ce2f9..11c2ae92e4 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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func migratePublisher( _ writer: some DatabaseWriter, receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main) @@ -514,7 +514,7 @@ extension DatabaseMigrator { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that migrates a database. /// diff --git a/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift b/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift index 8f747ff3be..ab6a1047ae 100644 --- a/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift @@ -646,7 +646,7 @@ extension QueryInterfaceRequest { /// - parameter db: A database connection. /// - returns: A set of deleted ids. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. - @available(macOS 10.15, tvOS 13, *) // Identifiable + @available(macOS 10.15, *) // Identifiable public func deleteAndFetchIds(_ db: Database) throws -> Set where RowDecoder: TableRecord & Identifiable, diff --git a/GRDB/QueryInterface/Request/RequestProtocols.swift b/GRDB/QueryInterface/Request/RequestProtocols.swift index 9a51e8701c..c265069f95 100644 --- a/GRDB/QueryInterface/Request/RequestProtocols.swift +++ b/GRDB/QueryInterface/Request/RequestProtocols.swift @@ -631,7 +631,7 @@ extension TableRequest where Self: FilteredRequest, Self: TypedRequest { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension TableRequest where Self: FilteredRequest, Self: TypedRequest, diff --git a/GRDB/QueryInterface/SQL/Table.swift b/GRDB/QueryInterface/SQL/Table.swift index 3e7dd8180a..cdaf32b85c 100644 --- a/GRDB/QueryInterface/SQL/Table.swift +++ b/GRDB/QueryInterface/SQL/Table.swift @@ -722,7 +722,7 @@ extension Table { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible { /// Returns a request filtered by primary key. /// @@ -1545,7 +1545,7 @@ extension Table { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible @@ -1686,7 +1686,7 @@ extension Table { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible diff --git a/GRDB/QueryInterface/Schema/TableAlteration.swift b/GRDB/QueryInterface/Schema/TableAlteration.swift index f10919b231..9b40a2d62b 100644 --- a/GRDB/QueryInterface/Schema/TableAlteration.swift +++ b/GRDB/QueryInterface/Schema/TableAlteration.swift @@ -129,7 +129,6 @@ public final class TableAlteration { /// /// - parameter name: the old name of the column. /// - parameter newName: the new name of the column. - @available(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 ce98f1772a..fa9acff667 100644 --- a/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift @@ -604,7 +604,7 @@ extension TableRecord { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 ed006713ee..18ea1eeb23 100644 --- a/GRDB/Record/FetchableRecord+TableRecord.swift +++ b/GRDB/Record/FetchableRecord+TableRecord.swift @@ -216,7 +216,7 @@ extension FetchableRecord where Self: TableRecord { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension FetchableRecord where Self: TableRecord & Identifiable, ID: DatabaseValueConvertible { // MARK: Fetching by Single-Column Primary Key @@ -358,7 +358,7 @@ extension FetchableRecord where Self: TableRecord & Hashable { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 cf53d3462f..46794444f1 100644 --- a/GRDB/Record/TableRecord.swift +++ b/GRDB/Record/TableRecord.swift @@ -319,7 +319,7 @@ extension TableRecord { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Returns whether a record exists for this primary key. /// @@ -454,7 +454,7 @@ extension TableRecord { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 03b2ad08c6..e91d8af447 100644 --- a/GRDB/Utils/OnDemandFuture.swift +++ b/GRDB/Utils/OnDemandFuture.swift @@ -17,7 +17,7 @@ import Foundation /// /// OnDemandFuture also adds Sendable requirements that avoid /// compiler warnings. -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) struct OnDemandFuture: Publisher { typealias Promise = @Sendable (Result) -> Void typealias Output = Output @@ -36,7 +36,7 @@ struct OnDemandFuture: Publisher { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) private class OnDemandFutureSubscription: Subscription, @unchecked Sendable { // @unchecked because `state` is protected with `lock`. typealias Promise = @Sendable (Result) -> Void diff --git a/GRDB/Utils/ReceiveValuesOn.swift b/GRDB/Utils/ReceiveValuesOn.swift index 95fb42fe0a..5a309e1f50 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) struct ReceiveValuesOn: Publisher { typealias Output = Upstream.Output typealias Failure = Upstream.Failure @@ -30,7 +30,7 @@ struct ReceiveValuesOn: Publisher { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) private class ReceiveValuesOnSubscription: Subscription, Subscriber where Upstream: Publisher, @@ -211,7 +211,7 @@ where } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 6f61750094..925a67a2c3 100644 --- a/GRDB/ValueObservation/SharedValueObservation.swift +++ b/GRDB/ValueObservation/SharedValueObservation.swift @@ -292,7 +292,7 @@ public final class SharedValueObservation: @unchecked Sendabl /// print("fresh players: \(players)") /// } /// ``` - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func publisher() -> DatabasePublishers.Value { DatabasePublishers.Value { onError, onChange in self.start(onError: onError, onChange: onChange) @@ -369,7 +369,7 @@ extension SharedValueObservation { /// print("Fresh players: \(players)") /// } /// ``` - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func values(bufferingPolicy: AsyncValueObservation.BufferingPolicy = .unbounded) -> AsyncValueObservation { diff --git a/GRDB/ValueObservation/ValueObservation.swift b/GRDB/ValueObservation/ValueObservation.swift index b4236838b6..84d9eda005 100644 --- a/GRDB/ValueObservation/ValueObservation.swift +++ b/GRDB/ValueObservation/ValueObservation.swift @@ -179,7 +179,7 @@ extension ValueObservation: Refinable { /// - parameter onChange: The closure to execute on receipt of a /// fresh value. /// - returns: A DatabaseCancellable that can stop the observation. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) @preconcurrency @MainActor public func start( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationMainActorScheduler = .mainActor, @@ -350,7 +350,7 @@ extension ValueObservation { /// fresh values are dispatched on the cooperative thread pool. /// - parameter bufferingPolicy: see the documntation /// of `AsyncThrowingStream`. - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func values( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler = .task, @@ -386,7 +386,7 @@ extension ValueObservation { /// /// You build an `AsyncValueObservation` from ``ValueObservation`` or /// ``SharedValueObservation``. -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public struct AsyncValueObservation: AsyncSequence { public typealias BufferingPolicy = AsyncThrowingStream.Continuation.BufferingPolicy public typealias AsyncIterator = Iterator @@ -488,7 +488,7 @@ extension ValueObservation { /// - parameter scheduler: A ValueObservationScheduler. By default, fresh /// values are dispatched asynchronously on the main dispatch queue. /// - returns: A Combine publisher - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) public func publisher( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler = .async(onQueue: .main)) @@ -505,7 +505,7 @@ extension ValueObservation { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that publishes the values of a ``ValueObservation``. /// diff --git a/GRDB/ValueObservation/ValueObservationScheduler.swift b/GRDB/ValueObservation/ValueObservationScheduler.swift index 5188d3452c..887ce09cf1 100644 --- a/GRDB/ValueObservation/ValueObservationScheduler.swift +++ b/GRDB/ValueObservation/ValueObservationScheduler.swift @@ -182,7 +182,7 @@ extension ValueObservationMainActorScheduler where Self == ImmediateValueObserva // MARK: - TaskValueObservationScheduler /// A scheduler that notifies all values on the cooperative thread pool. -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public final class TaskValueObservationScheduler: ValueObservationScheduler { typealias Action = @Sendable () -> Void let continuation: AsyncStream.Continuation @@ -212,7 +212,7 @@ public final class TaskValueObservationScheduler: ValueObservationScheduler { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension ValueObservationScheduler where Self == TaskValueObservationScheduler { /// A scheduler that notifies all values from a new `Task`. public static var task: TaskValueObservationScheduler { @@ -229,7 +229,7 @@ extension ValueObservationScheduler where Self == TaskValueObservationScheduler // MARK: - DelayedMainActorValueObservationScheduler /// A scheduler that notifies all values on the cooperative thread pool. -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public final class DelayedMainActorValueObservationScheduler: ValueObservationMainActorScheduler { public func immediateInitialValue() -> Bool { false @@ -240,7 +240,7 @@ public final class DelayedMainActorValueObservationScheduler: ValueObservationMa } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension ValueObservationScheduler where Self == DelayedMainActorValueObservationScheduler { /// A scheduler that notifies all values on the main actor. public static var mainActor: DelayedMainActorValueObservationScheduler { diff --git a/Package.swift b/Package.swift index af1aace2fc..6b53e53ff4 100644 --- a/Package.swift +++ b/Package.swift @@ -38,7 +38,7 @@ let package = Package( platforms: [ .iOS(.v13), .macOS(.v10_13), - .tvOS(.v12), + .tvOS(.v13), .watchOS(.v7), ], products: [ diff --git a/README.md b/README.md index be3bff834f..530e3d309c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ **Latest release**: September 7, 2024 • [version 6.29.3](https://github.com/groue/GRDB.swift/tree/v6.29.3) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md) -**Requirements**: iOS 13.0+ / macOS 10.13+ / tvOS 12.0+ / watchOS 7.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+ +**Requirements**: iOS 13.0+ / macOS 10.13+ / tvOS 13.0+ / watchOS 7.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+ **Contact**: diff --git a/SQLiteCustom/GRDBDeploymentTarget.xcconfig b/SQLiteCustom/GRDBDeploymentTarget.xcconfig index 8f02cc8937..369f90a510 100644 --- a/SQLiteCustom/GRDBDeploymentTarget.xcconfig +++ b/SQLiteCustom/GRDBDeploymentTarget.xcconfig @@ -1,6 +1,6 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0 MACOSX_DEPLOYMENT_TARGET = 10.13 -TVOS_DEPLOYMENT_TARGET = 12.0 +TVOS_DEPLOYMENT_TARGET = 13.0 WATCHOS_DEPLOYMENT_TARGET = 7.0 SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES OTHER_SWIFT_FLAGS = $(inherited) -enable-upcoming-feature GlobalActorIsolatedTypesUsability diff --git a/Support/GRDBDeploymentTarget.xcconfig b/Support/GRDBDeploymentTarget.xcconfig index d20702f0c6..a457235eed 100644 --- a/Support/GRDBDeploymentTarget.xcconfig +++ b/Support/GRDBDeploymentTarget.xcconfig @@ -1,6 +1,6 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0 MACOSX_DEPLOYMENT_TARGET = 10.13 -TVOS_DEPLOYMENT_TARGET = 12.0 +TVOS_DEPLOYMENT_TARGET = 13.0 WATCHOS_DEPLOYMENT_TARGET = 7.0 OTHER_SWIFT_FLAGS = $(inherited) -D SQLITE_ENABLE_FTS5 SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES diff --git a/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift b/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift index 51198282b5..7c8656f354 100644 --- a/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift +++ b/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 c9d1c8a6be..6c773f4f3d 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 ceb59955ea..218402af60 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Inverted.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Inverted.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 e15e6607ec..2f55cc60ec 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Map.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Map.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension PublisherExpectations { /// A publisher expectation that transforms the value of a base expectation. /// @@ -20,7 +20,7 @@ extension PublisherExpectations { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 3fd8010dd6..8d511ccd8e 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Next.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Next.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 492c2ba3b8..6d4869a5c9 100644 --- a/Tests/CombineExpectations/PublisherExpectations/NextOne.swift +++ b/Tests/CombineExpectations/PublisherExpectations/NextOne.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 3f055e1286..3089272c9b 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Prefix.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Prefix.swift @@ -1,7 +1,7 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 0b88ae2731..59bd76c1bf 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Recording.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Recording.swift @@ -2,7 +2,7 @@ import Combine import XCTest -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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 569066dbb2..153f328a57 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public class Recorder: Subscriber { public typealias Input = Input public typealias Failure = Failure @@ -287,7 +287,7 @@ public class Recorder: Subscriber { // MARK: - Publisher Expectations -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Publisher { /// Returns a subscribed Recorder. /// diff --git a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift index b45baff0e8..79defbd8ca 100644 --- a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift @@ -22,7 +22,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisher() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -157,7 +157,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherIsAsynchronous() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -197,7 +197,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherDefaultScheduler() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -237,7 +237,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherCustomScheduler() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -278,7 +278,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherIsReadonly() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift index 1a91d0c933..10a3568b89 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift b/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift index 585359af26..d9534238cb 100644 --- a/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift @@ -22,7 +22,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisher() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -49,7 +49,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherValue() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -76,7 +76,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherError() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -99,7 +99,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { } func testWritePublisherErrorRollbacksTransaction() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -132,7 +132,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherIsAsynchronous() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -168,7 +168,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherDefaultScheduler() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -206,7 +206,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherCustomScheduler() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -274,7 +274,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWriteThenReadPublisherIsReadonly() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -299,7 +299,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWriteThenReadPublisherWriteError() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -322,7 +322,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase { } func testWriteThenReadPublisherWriteErrorRollbacksTransaction() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBCombineTests/Support.swift b/Tests/GRDBCombineTests/Support.swift index 3759c94fa4..678195909d 100644 --- a/Tests/GRDBCombineTests/Support.swift +++ b/Tests/GRDBCombineTests/Support.swift @@ -51,7 +51,7 @@ final class Test { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public func assertNoFailure( _ completion: Subscribers.Completion, file: StaticString = #file, @@ -111,7 +111,7 @@ public func assertNoFailure( } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public func assertFailure( _ completion: Subscribers.Completion, file: StaticString = #file, diff --git a/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift b/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift index 86c98fa669..ae89d3f27b 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -64,7 +64,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDefaultSchedulerFirstValueIsEmittedAsynchronously() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -97,7 +97,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDefaultSchedulerError() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -123,7 +123,7 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Immediate Scheduler func testImmediateSchedulerChangesNotifications() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -165,7 +165,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testImmediateSchedulerEmitsFirstValueSynchronously() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -201,7 +201,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testImmediateSchedulerError() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -226,7 +226,7 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Demand - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) private class DemandSubscriber: Subscriber { private var subscription: Subscription? let subject = PassthroughSubject() @@ -257,7 +257,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandNoneReceivesNoElement() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -292,7 +292,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandOneReceivesOneElement() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -330,7 +330,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandOneDoesNotReceiveTwoElements() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -372,7 +372,7 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandTwoReceivesTwoElements() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBTests/AsyncSemaphore.swift b/Tests/GRDBTests/AsyncSemaphore.swift index 3ac88d4959..cc6dd61097 100644 --- a/Tests/GRDBTests/AsyncSemaphore.swift +++ b/Tests/GRDBTests/AsyncSemaphore.swift @@ -43,7 +43,7 @@ import Foundation /// /// - ``wait()`` /// - ``waitUnlessCancelled()`` -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) public final class AsyncSemaphore: @unchecked Sendable { /// `Suspension` is the state of a task waiting for a signal. /// diff --git a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift index 20061cebed..58d33c7584 100644 --- a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift @@ -25,7 +25,7 @@ private struct RecordWithData: EncodableRecord, Enco var data: Data } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension RecordWithData: Identifiable { var id: Data { data } } @@ -37,7 +37,7 @@ private struct RecordWithOptionalData: EncodableReco var data: Data? } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension RecordWithOptionalData: Identifiable { var id: Data? { data } } @@ -154,7 +154,7 @@ extension DatabaseDataEncodingStrategyTests { } func testFilterID() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Identifiable not available") } @@ -234,7 +234,7 @@ extension DatabaseDataEncodingStrategyTests { } func testDeleteID() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift index a071a7ddbf..0f8b7629e1 100644 --- a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift @@ -52,7 +52,7 @@ private struct RecordWithDate: EncodableRecord, Enco var date: Date } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension RecordWithDate: Identifiable { var id: Date { date } } @@ -64,7 +64,7 @@ private struct RecordWithOptionalDate: EncodableReco var date: Date? } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension RecordWithOptionalDate: Identifiable { var id: Date? { date } } @@ -264,7 +264,7 @@ extension DatabaseDateEncodingStrategyTests { } func testFilterID() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Identifiable not available") } @@ -344,7 +344,7 @@ extension DatabaseDateEncodingStrategyTests { } func testDeleteID() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseDumpTests.swift b/Tests/GRDBTests/DatabaseDumpTests.swift index 425f1f4e62..f05da9916e 100644 --- a/Tests/GRDBTests/DatabaseDumpTests.swift +++ b/Tests/GRDBTests/DatabaseDumpTests.swift @@ -238,7 +238,7 @@ final class DatabaseDumpTests: GRDBTestCase { // MARK: - JSON func test_json_value_formatting() throws { - guard #available(macOS 10.15, tvOS 13.0, *) else { + guard #available(macOS 10.15.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 114e9743c2..700ad3381e 100644 --- a/Tests/GRDBTests/DatabaseMigratorTests.swift +++ b/Tests/GRDBTests/DatabaseMigratorTests.swift @@ -41,7 +41,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisher() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -153,7 +153,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisher() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -209,7 +209,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -235,7 +235,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -262,7 +262,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherDefaultScheduler() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -291,7 +291,7 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherCustomScheduler() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } diff --git a/Tests/GRDBTests/DatabaseReaderTests.swift b/Tests/GRDBTests/DatabaseReaderTests.swift index 5428c22709..d7ebdb9e1c 100644 --- a/Tests/GRDBTests/DatabaseReaderTests.swift +++ b/Tests/GRDBTests/DatabaseReaderTests.swift @@ -49,7 +49,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_ReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -91,7 +91,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_ReadPreventsDatabaseModification() async throws { func test(_ dbReader: some DatabaseReader) async throws { do { @@ -135,7 +135,7 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_UnsafeReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -347,7 +347,7 @@ class DatabaseReaderTests : GRDBTestCase { // MARK: - Task Cancellation - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_read_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -383,7 +383,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_read_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -420,7 +420,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_statement_execution_from_read_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -459,7 +459,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_cursor_iteration_from_read_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -502,7 +502,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_unsafeRead_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -538,7 +538,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_unsafeRead_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -575,7 +575,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_statement_execution_from_unsafeRead_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -614,7 +614,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_cursor_iteration_from_unsafeRead_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) diff --git a/Tests/GRDBTests/DatabaseRegionObservationTests.swift b/Tests/GRDBTests/DatabaseRegionObservationTests.swift index 3f91a54fcb..49d76f9eba 100644 --- a/Tests/GRDBTests/DatabaseRegionObservationTests.swift +++ b/Tests/GRDBTests/DatabaseRegionObservationTests.swift @@ -9,7 +9,7 @@ class DatabaseRegionObservationTests: GRDBTestCase { _ = observation.start(in: writer, onError: { _ in }, onChange: { _ in }) - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { _ = observation.publisher(in: writer) } } diff --git a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift index c839451c05..3a3e26c2cd 100644 --- a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift +++ b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift @@ -229,7 +229,7 @@ final class DatabaseSnapshotPoolTests: GRDBTestCase { try XCTAssertEqual(dbPool.read(counter.value), 2) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) 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 7fb74781b8..119953a1b6 100644 --- a/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift @@ -26,7 +26,7 @@ private struct RecordWithUUID: EncodableRecord, Enco var uuid: UUID } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension RecordWithUUID: Identifiable { var id: UUID { uuid } } @@ -39,7 +39,7 @@ private struct RecordWithOptionalUUID: EncodableReco var uuid: UUID? } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension RecordWithOptionalUUID: Identifiable { var id: UUID? { uuid } } @@ -190,7 +190,7 @@ extension DatabaseUUIDEncodingStrategyTests { } func testFilterID() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Identifiable not available") } @@ -309,7 +309,7 @@ extension DatabaseUUIDEncodingStrategyTests { } func testDeleteID() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Identifiable not available") } diff --git a/Tests/GRDBTests/DatabaseWriterTests.swift b/Tests/GRDBTests/DatabaseWriterTests.swift index 62b5c3e6f6..5d4f9e9652 100644 --- a/Tests/GRDBTests/DatabaseWriterTests.swift +++ b/Tests/GRDBTests/DatabaseWriterTests.swift @@ -275,7 +275,7 @@ class DatabaseWriterTests : GRDBTestCase { try DatabaseQueue().backup(to: dbQueue) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_vacuum() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -406,7 +406,7 @@ class DatabaseWriterTests : GRDBTestCase { } /// A test related to - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncWriteThenRead() async throws { /// An async read performed after an async write should see the write. func test(_ dbWriter: some DatabaseWriter) async throws { @@ -430,7 +430,7 @@ class DatabaseWriterTests : GRDBTestCase { // MARK: - Task Cancellation - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -461,7 +461,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -493,7 +493,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_statement_execution_from_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -527,7 +527,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_cursor_iteration_from_writeWithoutTransaction_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -565,7 +565,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_write_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -596,7 +596,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_write_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -628,7 +628,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_statement_execution_from_write_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -662,7 +662,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_cursor_iteration_from_write_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -700,7 +700,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -731,7 +731,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -763,7 +763,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_statement_execution_from_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -797,7 +797,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_cursor_iteration_from_barrierWriteWithoutTransaction_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) diff --git a/Tests/GRDBTests/JoinSupportTests.swift b/Tests/GRDBTests/JoinSupportTests.swift index a3a5c9974c..e67523fbf7 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(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) static func modernAll() -> some FetchRequest { all() } @@ -138,7 +138,7 @@ private struct CodableFlatModel: FetchableRecord, Codable { var t3: T3? var t5count: Int - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) static func modernAll() -> some FetchRequest { all() } @@ -186,7 +186,7 @@ private struct CodableNestedModel: FetchableRecord, Codable { var t3: T3? var t5count: Int - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) static func modernAll() -> some FetchRequest { all() } diff --git a/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift b/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift index 64762126b0..d3c598488c 100644 --- a/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift +++ b/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift @@ -41,7 +41,7 @@ private class MinimalNonOptionalPrimaryKeySingle: Record, Hashable { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension MinimalNonOptionalPrimaryKeySingle: Identifiable { } class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { @@ -473,7 +473,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [String] = [] let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids) @@ -512,7 +512,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids) @@ -550,7 +550,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids) @@ -585,7 +585,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.fetchOne(db, id: record.id)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -613,7 +613,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { _ = try MinimalNonOptionalPrimaryKeySingle.find(db, key: "missing") XCTFail("Expected RecordError") @@ -653,7 +653,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [String] = [] let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db) @@ -692,7 +692,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db) @@ -730,7 +730,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [String] = [] let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db) @@ -765,7 +765,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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 31c1d684fc..9b4dc91874 100644 --- a/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift +++ b/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift @@ -45,7 +45,7 @@ class MinimalRowID : Record, Hashable { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension MinimalRowID: Identifiable { } class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { @@ -507,7 +507,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let cursor = try MinimalRowID.fetchCursor(db, ids: ids) @@ -546,7 +546,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids) @@ -584,7 +584,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids) @@ -619,7 +619,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let fetchedRecord = try MinimalRowID.fetchOne(db, id: record.id!)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -650,7 +650,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { _ = try MinimalRowID.find(db, id: -1) XCTFail("Expected RecordError") @@ -693,7 +693,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db) @@ -732,7 +732,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db) @@ -770,7 +770,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db) @@ -805,7 +805,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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 0e3eb7fd41..28e0a59131 100644 --- a/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift +++ b/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift @@ -39,7 +39,7 @@ class MinimalSingle: Record, Hashable { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension MinimalSingle: Identifiable { /// Test non-optional ID type var id: String { UUID! } @@ -531,7 +531,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let UUIDs: [String] = [] let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs) @@ -572,7 +572,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs) @@ -612,7 +612,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs) @@ -648,7 +648,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let fetchedRecord = try MinimalSingle.fetchOne(db, id: record.UUID!)! XCTAssertTrue(fetchedRecord.UUID == record.UUID) @@ -677,7 +677,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { _ = try MinimalSingle.find(db, id: "missing") XCTFail("Expected RecordError") @@ -719,7 +719,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let UUIDs: [String] = [] let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db) @@ -760,7 +760,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db) @@ -800,7 +800,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let UUIDs: [String] = [] let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db) @@ -836,7 +836,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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 398f2d9909..b16e2fc3f4 100644 --- a/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift +++ b/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift @@ -77,7 +77,7 @@ private class Person : Record, Hashable { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Person: Identifiable { } class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { @@ -599,7 +599,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let cursor = try Person.fetchCursor(db, ids: ids) @@ -638,7 +638,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.fetchAll(db, ids: ids) @@ -676,7 +676,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.fetchSet(db, ids: ids) @@ -714,7 +714,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let fetchedRecord = try Person.fetchOne(db, id: record.id!)! XCTAssertTrue(fetchedRecord.id == record.id) @@ -751,7 +751,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { _ = try Person.find(db, id: -1) XCTFail("Expected RecordError") @@ -797,7 +797,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let cursor = try Person.filter(ids: ids).fetchCursor(db) @@ -836,7 +836,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.filter(ids: ids).fetchAll(db) @@ -874,7 +874,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { do { let ids: [Int64] = [] let fetchedRecords = try Person.filter(ids: ids).fetchSet(db) @@ -912,7 +912,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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 4a61b1bb10..f794c5906e 100644 --- a/Tests/GRDBTests/SharedValueObservationTests.swift +++ b/Tests/GRDBTests/SharedValueObservationTests.swift @@ -120,7 +120,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_immediate_publisher() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -397,7 +397,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_async_publisher() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -525,7 +525,7 @@ class SharedValueObservationTests: GRDBTestCase { XCTAssertEqual(log.flush(), []) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_task_observationLifetime() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -622,7 +622,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_task_publisher() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -656,7 +656,7 @@ class SharedValueObservationTests: GRDBTestCase { } #endif - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func test_task_whileObserved() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -753,7 +753,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_observationLifetime() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -811,7 +811,7 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_whileObserved() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Combine is not available") } @@ -867,7 +867,7 @@ class SharedValueObservationTests: GRDBTestCase { } #endif - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_mainQueue() async throws { let dbQueue = try makeDatabaseQueue() try await dbQueue.write { db in @@ -887,7 +887,7 @@ class SharedValueObservationTests: GRDBTestCase { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_task() 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 26b7ba31b1..12b666ca1a 100644 --- a/Tests/GRDBTests/TableDefinitionTests.swift +++ b/Tests/GRDBTests/TableDefinitionTests.swift @@ -805,11 +805,6 @@ class TableDefinitionTests: GRDBTestCase { guard sqlite3_libversion_number() >= 3025000 else { throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") } - #if !GRDBCUSTOMSQLITE && !GRDBCIPHER - guard #available(tvOS 13, *) else { - throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") - } - #endif let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in try db.create(table: "test") { t in @@ -833,11 +828,6 @@ class TableDefinitionTests: GRDBTestCase { guard sqlite3_libversion_number() >= 3025000 else { throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") } - #if !GRDBCUSTOMSQLITE && !GRDBCIPHER - guard #available(tvOS 13, *) else { - throw XCTSkip("ALTER TABLE RENAME COLUMN is not available") - } - #endif let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in try db.create(table: "test") { t in diff --git a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift index 0c28204e88..4021373d54 100644 --- a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift @@ -357,7 +357,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { } func testExistsIdentifiable() throws { - guard #available(macOS 10.15, tvOS 13, *) else { + guard #available(macOS 10.15, *) else { throw XCTSkip("Identifiable is not available") } diff --git a/Tests/GRDBTests/TableRecordDeleteTests.swift b/Tests/GRDBTests/TableRecordDeleteTests.swift index eb1b3f479a..7dedbab24a 100644 --- a/Tests/GRDBTests/TableRecordDeleteTests.swift +++ b/Tests/GRDBTests/TableRecordDeleteTests.swift @@ -6,7 +6,7 @@ private struct Hacker : TableRecord { var id: Int64? // Optional } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) extension Person: Identifiable { } private struct Citizenship : TableRecord { @@ -46,7 +46,7 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertTrue(deleted) XCTAssertEqual(try Hacker.fetchCount(db), 0) - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { _ = try Person.filter(id: 1).deleteAndFetchCursor(db).next() XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *") @@ -364,7 +364,7 @@ class TableRecordDeleteTests: GRDBTestCase { } } - @available(macOS 10.15, tvOS 13, *) // Identifiable + @available(macOS 10.15, *) // Identifiable func testRequestDeleteAndFetchIds() throws { #if GRDBCUSTOMSQLITE || GRDBCIPHER guard sqlite3_libversion_number() >= 3035000 else { diff --git a/Tests/GRDBTests/TableRecordUpdateTests.swift b/Tests/GRDBTests/TableRecordUpdateTests.swift index b5a249eb84..787c1fb47f 100644 --- a/Tests/GRDBTests/TableRecordUpdateTests.swift +++ b/Tests/GRDBTests/TableRecordUpdateTests.swift @@ -17,7 +17,7 @@ private struct Player: Codable, PersistableRecord, FetchableRecord, Hashable { } } -@available(macOS 10.15, tvOS 13, *) +@available(macOS 10.15, *) 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(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { 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 7576902fdc..34f732b5f7 100644 --- a/Tests/GRDBTests/TableTests.swift +++ b/Tests/GRDBTests/TableTests.swift @@ -117,7 +117,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { struct Player: Identifiable { var id: Int64 } let t = Table("player") @@ -129,7 +129,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { struct Player: Identifiable { var id: Int64? } let t = Table("player") @@ -806,7 +806,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { // Non-optional ID struct Country: Identifiable { var id: String } @@ -821,7 +821,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { // Optional ID struct Country: Identifiable { var id: String? } @@ -920,7 +920,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { // Non-optional ID struct Country: Identifiable { var id: String } @@ -930,7 +930,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, tvOS 13, *) { + if #available(macOS 10.15, *) { // Optional ID struct Country: Identifiable { var id: String? } diff --git a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift index dff05d4c5e..0e3ae4432f 100644 --- a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift +++ b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift @@ -105,7 +105,7 @@ class ValueObservationRegionRecordingTests: GRDBTestCase { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testTupleObservation() throws { // Here we just test that user can destructure an observed tuple. // I'm completely paranoid about tuple destructuring - I can't wrap my @@ -120,7 +120,7 @@ class ValueObservationRegionRecordingTests: GRDBTestCase { onChange: { (int: Int, string: String) in }) // <- destructure } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testVaryingRegionTrackingImmediateScheduling() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index 142ce7249e..c72b90c5ea 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -5,7 +5,7 @@ import Dispatch class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testStartFromAnyDatabaseReader(reader: any DatabaseReader) { _ = ValueObservation .trackingConstantRegion { _ in } @@ -14,7 +14,7 @@ class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testStartFromAnyDatabaseWriter(writer: any DatabaseWriter) { _ = ValueObservation .trackingConstantRegion { _ in } @@ -23,7 +23,7 @@ class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testValuesFromAnyDatabaseWriter(writer: any DatabaseWriter) { func observe( fetch: @escaping @Sendable (Database) throws -> T @@ -55,7 +55,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testErrorCompletesTheObservation() throws { struct TestError: Error { } @@ -105,7 +105,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testViewOptimization() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { @@ -143,7 +143,7 @@ class ValueObservationTests: GRDBTestCase { } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testPragmaTableOptimization() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { @@ -179,7 +179,7 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Constant Explicit Region - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testTrackingExplicitRegion() throws { class TestStream: TextOutputStream { private var stringsMutex: Mutex<[String]> = Mutex([]) @@ -620,7 +620,7 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Cancellation - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testCancellableLifetime() throws { // We need something to change let dbQueue = try makeDatabaseQueue() @@ -666,7 +666,7 @@ class ValueObservationTests: GRDBTestCase { XCTAssertEqual(changesCountMutex.load(), 2) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testCancellableExplicitCancellation() throws { // We need something to change let dbQueue = try makeDatabaseQueue() @@ -804,7 +804,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testIssue1550() throws { func test(_ writer: some DatabaseWriter) throws { try writer.write { try $0.execute(sql: "CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } @@ -852,7 +852,7 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testIssue1209() throws { func test(_ dbWriter: some DatabaseWriter) throws { try dbWriter.write { @@ -903,7 +903,7 @@ class ValueObservationTests: GRDBTestCase { } // MARK: - Main Actor - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) @MainActor func test_mainActor_observation() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -939,7 +939,7 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Async Await - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_values_prefix() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -977,7 +977,7 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_values_break() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -1019,7 +1019,7 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testAsyncAwait_values_cancelled() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -1201,7 +1201,7 @@ class ValueObservationTests: GRDBTestCase { } // Regression test for - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testIssue1362() throws { func test(_ writer: some DatabaseWriter) throws { try writer.write { try $0.execute(sql: "CREATE TABLE s(id INTEGER PRIMARY KEY AUTOINCREMENT)") } @@ -1292,7 +1292,7 @@ class ValueObservationTests: GRDBTestCase { } // Regression test for - @available(macOS 10.15, tvOS 13, *) + @available(macOS 10.15, *) func testIssue1383_async() throws { do { let dbPool = try makeDatabasePool(filename: "test") From 46e15616a7d1f7efeb9e3c317ad91b21a637286c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 21 Sep 2024 13:54:04 +0200 Subject: [PATCH 3/3] [BREAKING] macOS 10.15+ --- GRDB.swift.podspec | 2 +- GRDB/Core/Database+Statements.swift | 30 +-- GRDB/Core/Database.swift | 9 +- GRDB/Core/DatabasePool.swift | 4 - GRDB/Core/DatabasePublishers.swift | 1 - GRDB/Core/DatabaseQueue.swift | 4 - GRDB/Core/DatabaseReader.swift | 7 - GRDB/Core/DatabaseRegionObservation.swift | 3 - GRDB/Core/DatabaseSnapshot.swift | 2 - GRDB/Core/DatabaseSnapshotPool.swift | 2 - GRDB/Core/DatabaseWriter.swift | 15 -- GRDB/Core/SerializedDatabase.swift | 4 - GRDB/Core/Statement.swift | 14 +- GRDB/Dump/DumpFormats/JSONDumpFormat.swift | 4 +- GRDB/FTS/FTS5.swift | 40 ---- GRDB/Fixits.swift | 3 - GRDB/JSON/SQLJSONExpressible.swift | 10 +- GRDB/JSON/SQLJSONFunctions.swift | 40 ++-- GRDB/Migration/DatabaseMigrator.swift | 2 - .../Request/QueryInterfaceRequest.swift | 1 - .../Request/RequestProtocols.swift | 1 - GRDB/QueryInterface/SQL/SQLExpression.swift | 2 +- GRDB/QueryInterface/SQL/Table.swift | 3 - .../TableRecord+QueryInterfaceRequest.swift | 1 - GRDB/Record/FetchableRecord+TableRecord.swift | 2 - GRDB/Record/TableRecord.swift | 3 - GRDB/Utils/OnDemandFuture.swift | 2 - GRDB/Utils/ReceiveValuesOn.swift | 3 - .../SharedValueObservation.swift | 2 - GRDB/ValueObservation/ValueObservation.swift | 5 - .../ValueObservationScheduler.swift | 4 - Package.swift | 2 +- README.md | 2 +- SQLiteCustom/GRDBDeploymentTarget.xcconfig | 2 +- Support/GRDBDeploymentTarget.xcconfig | 2 +- .../GRDBTests.xcodeproj/project.pbxproj | 4 +- Tests/CocoaPods/SQLCipher3/Podfile | 4 +- .../GRDBTests.xcodeproj/project.pbxproj | 4 +- Tests/CocoaPods/SQLCipher4/Podfile | 4 +- .../AvailableElements.swift | 1 - .../PublisherExpectations/Finished.swift | 1 - .../PublisherExpectations/Inverted.swift | 1 - .../PublisherExpectations/Map.swift | 2 - .../PublisherExpectations/Next.swift | 1 - .../PublisherExpectations/NextOne.swift | 1 - .../PublisherExpectations/Prefix.swift | 1 - .../PublisherExpectations/Recording.swift | 1 - Tests/CombineExpectations/Recorder.swift | 4 - .../CustomSQLite.xcodeproj/project.pbxproj | 4 +- .../DatabaseReaderReadPublisherTests.swift | 24 -- ...abaseRegionObservationPublisherTests.swift | 8 - .../DatabaseWriterWritePublisherTests.swift | 52 ---- Tests/GRDBCombineTests/Support.swift | 3 - .../ValueObservationPublisherTests.swift | 45 ---- Tests/GRDBTests/AsyncSemaphore.swift | 1 - Tests/GRDBTests/DatabaseCursorTests.swift | 62 +++-- .../DatabaseDataEncodingStrategyTests.swift | 10 - .../DatabaseDateEncodingStrategyTests.swift | 10 - Tests/GRDBTests/DatabaseDumpTests.swift | 4 - Tests/GRDBTests/DatabaseMigratorTests.swift | 24 -- Tests/GRDBTests/DatabaseReaderTests.swift | 11 - .../DatabaseRegionObservationTests.swift | 5 +- .../GRDBTests/DatabaseSnapshotPoolTests.swift | 1 - .../DatabaseUUIDEncodingStrategyTests.swift | 10 - Tests/GRDBTests/DatabaseWriterTests.swift | 18 -- Tests/GRDBTests/JSONColumnTests.swift | 4 +- Tests/GRDBTests/JSONExpressionsTests.swift | 50 ++-- Tests/GRDBTests/JoinSupportTests.swift | 3 - ...imalNonOptionalPrimaryKeySingleTests.swift | 189 +++++++-------- .../RecordMinimalPrimaryKeyRowIDTests.swift | 207 ++++++++-------- .../RecordMinimalPrimaryKeySingleTests.swift | 189 +++++++-------- .../RecordPrimaryKeyHiddenRowIDTests.swift | 225 ++++++++---------- .../SharedValueObservationTests.swift | 24 -- ...bleRecord+QueryInterfaceRequestTests.swift | 4 - Tests/GRDBTests/TableRecordDeleteTests.swift | 85 +++---- Tests/GRDBTests/TableRecordUpdateTests.swift | 15 +- Tests/GRDBTests/TableTests.swift | 12 +- ...ValueObservationRegionRecordingTests.swift | 2 - Tests/GRDBTests/ValueObservationTests.swift | 17 -- .../GRDBProfiling.xcodeproj/project.pbxproj | 4 +- Tests/SPM/PlainPackage/Package.swift | 6 + .../Plain.xcodeproj/project.pbxproj | 4 +- 82 files changed, 538 insertions(+), 1056 deletions(-) diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index de695d4afa..dcfc881e78 100644 --- a/GRDB.swift.podspec +++ b/GRDB.swift.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.swift_versions = ['5.10'] s.ios.deployment_target = '13.0' - s.osx.deployment_target = '10.13' + s.osx.deployment_target = '10.15' s.watchos.deployment_target = '7.0' s.tvos.deployment_target = '13.0' s.default_subspec = 'standard' diff --git a/GRDB/Core/Database+Statements.swift b/GRDB/Core/Database+Statements.swift index 1b2806b3ba..46038a83b5 100644 --- a/GRDB/Core/Database+Statements.swift +++ b/GRDB/Core/Database+Statements.swift @@ -492,17 +492,15 @@ extension Database { // and throws the user-provided cancelled commit error. try observationBroker?.statementDidFail(statement) - if #available(macOS 10.15, *) { - switch ResultCode(rawValue: resultCode) { - case .SQLITE_INTERRUPT, .SQLITE_ABORT: - if suspensionMutex.load().isCancelled { - // The only error that a user sees when a Task is cancelled - // is CancellationError. - throw CancellationError() - } - default: - break + switch ResultCode(rawValue: resultCode) { + case .SQLITE_INTERRUPT, .SQLITE_ABORT: + if suspensionMutex.load().isCancelled { + // The only error that a user sees when a Task is cancelled + // is CancellationError. + throw CancellationError() } + default: + break } // Throw statement failure @@ -554,19 +552,7 @@ struct StatementCache { // > time and probably reused many times. // // This looks like a perfect match for cached statements. - // - // However SQLITE_PREPARE_PERSISTENT was only introduced in - // SQLite 3.20.0 http://www.sqlite.org/changes.html#version_3_20 - #if GRDBCUSTOMSQLITE || GRDBCIPHER let statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT)) - #else - let statement: Statement - 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) - } - #endif statements[sql] = statement return statement } diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index f6574eeabb..61354847b1 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -1199,7 +1199,6 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib /// will throw `CancellationError`, until `uncancel()` is called. /// /// This method can be called from any thread. - @available(macOS 10.15, *) func cancel() { let needsInterrupt = suspensionMutex.withLock { suspension in if suspension.isCancelled { @@ -1216,7 +1215,6 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib } /// Undo `cancel()`. - @available(macOS 10.15, *) func uncancel() { suspensionMutex.withLock { $0.isCancelled = false @@ -1320,12 +1318,7 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib break case .cancel: - if #available(macOS 10.15, *) { - throw CancellationError() - } else { - // GRDB bug: cancellation is a Swift concurrency feature - fatalError("Can't cancel without support for Swift concurrency") - } + throw CancellationError() case .abort: // Attempt at releasing an eventual lock with ROLLBACk, diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index 74a67b6c47..ce1bae833e 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -351,7 +351,6 @@ extension DatabasePool: DatabaseReader { } } - @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -436,7 +435,6 @@ extension DatabasePool: DatabaseReader { } } - @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -803,7 +801,6 @@ extension DatabasePool: DatabaseWriter { try writer.sync(updates) } - @available(macOS 10.15, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -820,7 +817,6 @@ extension DatabasePool: DatabaseWriter { } } - @available(macOS 10.15, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabasePublishers.swift b/GRDB/Core/DatabasePublishers.swift index 04ca12e84b..c7e7a603f1 100644 --- a/GRDB/Core/DatabasePublishers.swift +++ b/GRDB/Core/DatabasePublishers.swift @@ -1,5 +1,4 @@ #if canImport(Combine) /// A namespace for database Combine publishers. -@available(macOS 10.15, *) public enum DatabasePublishers { } #endif diff --git a/GRDB/Core/DatabaseQueue.swift b/GRDB/Core/DatabaseQueue.swift index ebf822667b..37b62fde5b 100644 --- a/GRDB/Core/DatabaseQueue.swift +++ b/GRDB/Core/DatabaseQueue.swift @@ -233,7 +233,6 @@ extension DatabaseQueue: DatabaseReader { } } - @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -272,7 +271,6 @@ extension DatabaseQueue: DatabaseReader { try writer.sync(value) } - @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -386,7 +384,6 @@ extension DatabaseQueue: DatabaseWriter { try writer.sync(updates) } - @available(macOS 10.15, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -398,7 +395,6 @@ extension DatabaseQueue: DatabaseWriter { try writer.sync(updates) } - @available(macOS 10.15, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index ed7736c6f6..61c8d59e0b 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -216,7 +216,6 @@ public protocol DatabaseReader: AnyObject, Sendable { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `value`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, *) func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -323,7 +322,6 @@ public protocol DatabaseReader: AnyObject, Sendable { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `value`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, *) func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -535,7 +533,6 @@ extension DatabaseReader { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter value: A closure which accesses the database. - @available(macOS 10.15, *) public func readPublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, value: @escaping @Sendable (Database) throws -> Output @@ -550,7 +547,6 @@ extension DatabaseReader { } } -@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that reads from the database. /// @@ -569,7 +565,6 @@ extension DatabasePublishers { } } -@available(macOS 10.15, *) extension Publisher where Failure == Error { fileprivate func eraseToReadPublisher() -> DatabasePublishers.Read { .init(upstream: eraseToAnyPublisher()) @@ -660,7 +655,6 @@ extension AnyDatabaseReader: DatabaseReader { try base.read(value) } - @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -678,7 +672,6 @@ extension AnyDatabaseReader: DatabaseReader { try base.unsafeRead(value) } - @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseRegionObservation.swift b/GRDB/Core/DatabaseRegionObservation.swift index 4d5ab11938..c0e89e4b38 100644 --- a/GRDB/Core/DatabaseRegionObservation.swift +++ b/GRDB/Core/DatabaseRegionObservation.swift @@ -128,7 +128,6 @@ extension DatabaseRegionObservation { } #if canImport(Combine) -@available(macOS 10.15, *) extension DatabaseRegionObservation { // MARK: - Publishing Impactful Transactions @@ -140,7 +139,6 @@ extension DatabaseRegionObservation { /// /// Do not reschedule the publisher with `receive(on:options:)` or any /// `Publisher` method that schedules publisher elements. - @available(macOS 10.15, *) public func publisher(in writer: some DatabaseWriter) -> DatabasePublishers.DatabaseRegion { DatabasePublishers.DatabaseRegion(self, in: writer) } @@ -186,7 +184,6 @@ private class DatabaseRegionObserver: TransactionObserver { } #if canImport(Combine) -@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that tracks transactions that modify a database region. /// diff --git a/GRDB/Core/DatabaseSnapshot.swift b/GRDB/Core/DatabaseSnapshot.swift index 36b131cea8..7609a3433f 100644 --- a/GRDB/Core/DatabaseSnapshot.swift +++ b/GRDB/Core/DatabaseSnapshot.swift @@ -151,7 +151,6 @@ extension DatabaseSnapshot: DatabaseSnapshotReader { try reader.sync(block) } - @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -173,7 +172,6 @@ extension DatabaseSnapshot: DatabaseSnapshotReader { // We can't provide this as a default implementation in // `DatabaseSnapshotReader`, because of // . - @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseSnapshotPool.swift b/GRDB/Core/DatabaseSnapshotPool.swift index 826c7d0f68..20398c5562 100644 --- a/GRDB/Core/DatabaseSnapshotPool.swift +++ b/GRDB/Core/DatabaseSnapshotPool.swift @@ -293,7 +293,6 @@ extension DatabaseSnapshotPool: DatabaseSnapshotReader { } } - @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -353,7 +352,6 @@ extension DatabaseSnapshotPool: DatabaseSnapshotReader { // We can't provide this as a default implementation in // `DatabaseSnapshotReader`, because of // . - @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index b1928b14ae..29d39d2ac3 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -131,7 +131,6 @@ public protocol DatabaseWriter: DatabaseReader { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, *) func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -217,7 +216,6 @@ public protocol DatabaseWriter: DatabaseReader { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, *) func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T @@ -649,7 +647,6 @@ extension DatabaseWriter { /// - throws: Any ``DatabaseError`` that happens while establishing the /// database access, or the error thrown by `updates`, or /// `CancellationError` if the task is cancelled. - @available(macOS 10.15, *) public func write( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -666,7 +663,6 @@ 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(macOS 10.15, *) public func erase() async throws { try await writeWithoutTransaction { try $0.erase() } } @@ -677,7 +673,6 @@ extension DatabaseWriter { /// - note: [**🔥 EXPERIMENTAL**](https://github.com/groue/GRDB.swift/blob/master/README.md#what-are-experimental-features) /// /// Related SQLite documentation: - @available(macOS 10.15, *) public func vacuum() async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM") } } @@ -694,7 +689,6 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(macOS 10.15, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -709,7 +703,6 @@ extension DatabaseWriter { /// Related SQLite documentation: /// /// - Parameter filePath: file path for new database - @available(macOS 10.15, *) public func vacuum(into filePath: String) async throws { try await writeWithoutTransaction { try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath]) @@ -754,7 +747,6 @@ extension DatabaseWriter { /// /// - parameter scheduler: A Combine Scheduler. /// - parameter updates: A closure which accesses the database. - @available(macOS 10.15, *) public func writePublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, updates: @escaping @Sendable (Database) throws -> Output @@ -818,7 +810,6 @@ 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(macOS 10.15, *) public func writePublisher( receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main, updates: @escaping @Sendable (Database) throws -> T, @@ -848,7 +839,6 @@ extension DatabaseWriter { } } -@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that writes into the database. /// @@ -867,7 +857,6 @@ extension DatabasePublishers { } } -@available(macOS 10.15, *) extension Publisher where Failure == Error { fileprivate func eraseToWritePublisher() -> DatabasePublishers.Write { .init(upstream: self.eraseToAnyPublisher()) @@ -911,7 +900,6 @@ extension AnyDatabaseWriter: DatabaseReader { try base.read(value) } - @available(macOS 10.15, *) public func read( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -929,7 +917,6 @@ extension AnyDatabaseWriter: DatabaseReader { try base.unsafeRead(value) } - @available(macOS 10.15, *) public func unsafeRead( _ value: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -964,7 +951,6 @@ extension AnyDatabaseWriter: DatabaseWriter { try base.writeWithoutTransaction(updates) } - @available(macOS 10.15, *) public func writeWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -976,7 +962,6 @@ extension AnyDatabaseWriter: DatabaseWriter { try base.barrierWriteWithoutTransaction(updates) } - @available(macOS 10.15, *) public func barrierWriteWithoutTransaction( _ updates: @escaping @Sendable (Database) throws -> T ) async throws -> T { diff --git a/GRDB/Core/SerializedDatabase.swift b/GRDB/Core/SerializedDatabase.swift index 6668360116..b794fa63ea 100644 --- a/GRDB/Core/SerializedDatabase.swift +++ b/GRDB/Core/SerializedDatabase.swift @@ -244,7 +244,6 @@ final class SerializedDatabase { } /// Asynchrously executes the block. - @available(macOS 10.15, *) func execute( _ block: @escaping @Sendable (Database) throws -> T ) async throws -> T { @@ -309,7 +308,6 @@ extension SerializedDatabase: @unchecked Sendable { } // MARK: - Task Cancellation Support -@available(macOS 10.15, *) enum DatabaseAccessCancellationState: @unchecked Sendable { // @unchecked Sendable because database is only accessed from its // dispatch queue. @@ -319,7 +317,6 @@ enum DatabaseAccessCancellationState: @unchecked Sendable { case expired } -@available(macOS 10.15, *) typealias CancellableDatabaseAccess = Mutex /// Supports Task cancellation in async database accesses. @@ -341,7 +338,6 @@ typealias CancellableDatabaseAccess = Mutex /// } /// } /// ``` -@available(macOS 10.15, *) extension CancellableDatabaseAccess: DatabaseCancellable { convenience init() { self.init(.notConnected) diff --git a/GRDB/Core/Statement.swift b/GRDB/Core/Statement.swift index f2b85776d6..f2792af315 100644 --- a/GRDB/Core/Statement.swift +++ b/GRDB/Core/Statement.swift @@ -139,21 +139,9 @@ public final class Statement { authorizer.reset() var sqliteStatement: SQLiteStatement? = nil - let code: CInt - // sqlite3_prepare_v3 was introduced in SQLite 3.20.0 http://www.sqlite.org/changes.html#version_3_20 -#if GRDBCUSTOMSQLITE || GRDBCIPHER - code = sqlite3_prepare_v3( + let code = sqlite3_prepare_v3( database.sqliteConnection, statementStart, -1, prepFlags, &sqliteStatement, statementEnd) -#else - if #available(macOS 10.14, tvOS 12, *) { // SQLite 3.20+ - code = sqlite3_prepare_v3( - database.sqliteConnection, statementStart, -1, prepFlags, - &sqliteStatement, statementEnd) - } else { - code = sqlite3_prepare_v2(database.sqliteConnection, statementStart, -1, &sqliteStatement, statementEnd) - } -#endif guard code == SQLITE_OK else { throw DatabaseError( diff --git a/GRDB/Dump/DumpFormats/JSONDumpFormat.swift b/GRDB/Dump/DumpFormats/JSONDumpFormat.swift index f24eaa1216..d2c2525a10 100644 --- a/GRDB/Dump/DumpFormats/JSONDumpFormat.swift +++ b/GRDB/Dump/DumpFormats/JSONDumpFormat.swift @@ -52,9 +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(macOS 10.15.0, *) { - encoder.outputFormatting = .withoutEscapingSlashes - } + encoder.outputFormatting = .withoutEscapingSlashes encoder.nonConformingFloatEncodingStrategy = .convertToString( positiveInfinity: "inf", negativeInfinity: "-inf", diff --git a/GRDB/FTS/FTS5.swift b/GRDB/FTS/FTS5.swift index e6dce2abbe..a87b184b1d 100644 --- a/GRDB/FTS/FTS5.swift +++ b/GRDB/FTS/FTS5.swift @@ -117,46 +117,6 @@ public struct FTS5 { /// /// Related SQLite documentation: public static func api(_ db: Database) -> UnsafePointer { - // Access to FTS5 is one of the rare SQLite api which was broken in - // SQLite 3.20.0+, for security reasons: - // - // Starting SQLite 3.20.0+, we need to use the new sqlite3_bind_pointer api. - // The previous way to access FTS5 does not work any longer. - // - // So let's see which SQLite version we are linked against: - - #if GRDBCUSTOMSQLITE || GRDBCIPHER - // GRDB is linked against SQLCipher or a custom SQLite build: SQLite 3.20.0 or more. - return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer) - #else - // GRDB is linked against the system SQLite. - if #available(macOS 10.14, tvOS 12, *) { // SQLite 3.20+ - return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer) - } else { - return api_v1(db) - } - #endif - } - - private static func api_v1(_ db: Database) -> UnsafePointer { - guard let data = try! Data.fetchOne(db, sql: "SELECT fts5()") else { - fatalError("FTS5 is not available") - } - return data.withUnsafeBytes { - $0.bindMemory(to: UnsafePointer.self).first! - } - } - - // Technique given by Jordan Rose: - // https://forums.swift.org/t/c-interoperability-combinations-of-library-and-os-versions/14029/4 - private static func api_v2( - _ db: Database, - // swiftlint:disable:next line_length - _ sqlite3_prepare_v3: @convention(c) (OpaquePointer?, UnsafePointer?, CInt, CUnsignedInt, UnsafeMutablePointer?, UnsafeMutablePointer?>?) -> CInt, - // swiftlint:disable:next line_length - _ sqlite3_bind_pointer: @convention(c) (OpaquePointer?, CInt, UnsafeMutableRawPointer?, UnsafePointer?, (@convention(c) (UnsafeMutableRawPointer?) -> Void)?) -> CInt) - -> UnsafePointer - { var statement: SQLiteStatement? = nil var api: UnsafePointer? = nil let type: StaticString = "fts5_api_ptr" diff --git a/GRDB/Fixits.swift b/GRDB/Fixits.swift index 453741c455..4851095638 100644 --- a/GRDB/Fixits.swift +++ b/GRDB/Fixits.swift @@ -119,7 +119,6 @@ extension PersistableRecord { public func performSave(_ db: Database) throws { preconditionFailure() } } -@available(macOS 10.15, *) 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 +143,11 @@ extension SelectionRequest { @available(*, unavailable, renamed: "SQLExpression.AssociativeBinaryOperator") public typealias SQLAssociativeBinaryOperator = SQLExpression.AssociativeBinaryOperator -@available(macOS 10.15, *) 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(macOS 10.15, *) 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/JSON/SQLJSONExpressible.swift b/GRDB/JSON/SQLJSONExpressible.swift index 5bde4eefe7..e2c402283e 100644 --- a/GRDB/JSON/SQLJSONExpressible.swift +++ b/GRDB/JSON/SQLJSONExpressible.swift @@ -312,7 +312,7 @@ extension SQLJSONExpressible { /// Related SQL documentation: /// /// - parameter path: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public func jsonExtract(atPath path: some SQLExpressible) -> SQLExpression { Database.jsonExtract(self, atPath: path) } @@ -334,7 +334,7 @@ extension SQLJSONExpressible { /// Related SQL documentation: /// /// - parameter paths: A collection of [JSON paths](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public func jsonExtract( atPaths paths: some Collection ) -> SQLExpression { @@ -385,7 +385,7 @@ extension SQLJSONExpressible { // /// ``` // /// // /// Related SQLite documentation: -// @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS +// @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS // public func jsonPatch( // with patch: some SQLExpressible) // -> ColumnAssignment @@ -408,7 +408,7 @@ extension SQLJSONExpressible { // /// // /// - Parameters: // /// - paths: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). -// @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS +// @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS // public func jsonRemove(atPath path: some SQLExpressible) -> ColumnAssignment { // .init(columnName: name, value: Database.jsonRemove(self, atPath: path)) // } @@ -428,7 +428,7 @@ extension SQLJSONExpressible { // /// // /// - Parameters: // /// - paths: A collection of [JSON paths](https://www.sqlite.org/json1.html#path_arguments). -// @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS +// @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS // public func jsonRemove( // atPaths paths: some Collection // ) -> ColumnAssignment { diff --git a/GRDB/JSON/SQLJSONFunctions.swift b/GRDB/JSON/SQLJSONFunctions.swift index ee360aa6ef..7b3d3d16ef 100644 --- a/GRDB/JSON/SQLJSONFunctions.swift +++ b/GRDB/JSON/SQLJSONFunctions.swift @@ -431,7 +431,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func json(_ value: some SQLExpressible) -> SQLExpression { .function("JSON", [value.sqlExpression]) } @@ -446,7 +446,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonArray( _ values: some Collection ) -> SQLExpression { @@ -463,7 +463,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonArray( _ values: some Collection ) -> SQLExpression { @@ -481,7 +481,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonArrayLength(_ value: some SQLExpressible) -> SQLExpression { .function("JSON_ARRAY_LENGTH", [value.sqlExpression]) } @@ -501,7 +501,7 @@ extension Database { /// - Parameters: /// - value: A JSON array. /// - path: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonArrayLength( _ value: some SQLExpressible, atPath path: some SQLExpressible) @@ -524,7 +524,7 @@ extension Database { /// - Parameters: /// - value: A JSON value. /// - path: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonExtract(_ value: some SQLExpressible, atPath path: some SQLExpressible) -> SQLExpression { .function("JSON_EXTRACT", [value.sqlExpression, path.sqlExpression]) } @@ -543,7 +543,7 @@ extension Database { /// - Parameters: /// - value: A JSON value. /// - paths: A collection of [JSON paths](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonExtract( _ value: some SQLExpressible, atPaths paths: some Collection @@ -566,7 +566,7 @@ extension Database { /// - value: A JSON value. /// - assignments: A collection of key/value pairs, where keys are /// [JSON paths](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonInsert( _ value: some SQLExpressible, _ assignments: some Collection<(key: String, value: any SQLExpressible)> @@ -591,7 +591,7 @@ extension Database { /// - value: A JSON value. /// - assignments: A collection of key/value pairs, where keys are /// [JSON paths](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonReplace( _ value: some SQLExpressible, _ assignments: some Collection<(key: String, value: any SQLExpressible)> @@ -616,7 +616,7 @@ extension Database { /// - value: A JSON value. /// - assignments: A collection of key/value pairs, where keys are /// [JSON paths](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonSet( _ value: some SQLExpressible, _ assignments: some Collection<(key: String, value: any SQLExpressible)> @@ -649,7 +649,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonObject( _ elements: some Collection<(key: String, value: any SQLExpressible)> ) -> SQLExpression { @@ -668,7 +668,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonPatch( _ value: some SQLExpressible, with patch: some SQLExpressible) @@ -691,7 +691,7 @@ extension Database { /// - Parameters: /// - value: A JSON value. /// - path: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonRemove(_ value: some SQLExpressible, atPath path: some SQLExpressible) -> SQLExpression { .function("JSON_REMOVE", [value.sqlExpression, path.sqlExpression]) } @@ -710,7 +710,7 @@ extension Database { /// - Parameters: /// - value: A JSON value. /// - paths: A collection of [JSON paths](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonRemove( _ value: some SQLExpressible, atPaths paths: some Collection @@ -728,7 +728,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonType(_ value: some SQLExpressible) -> SQLExpression { .function("JSON_TYPE", [value.sqlExpression]) } @@ -747,7 +747,7 @@ extension Database { /// - Parameters: /// - value: A JSON value. /// - path: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonType(_ value: some SQLExpressible, atPath path: some SQLExpressible) -> SQLExpression { .function("JSON_TYPE", [value.sqlExpression, path.sqlExpression]) } @@ -762,7 +762,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonIsValid(_ value: some SQLExpressible) -> SQLExpression { .function("JSON_VALID", [value.sqlExpression]) } @@ -780,7 +780,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonQuote(_ value: some SQLExpressible) -> SQLExpression { .function("JSON_QUOTE", [value.sqlExpression.jsonBuilderExpression]) } @@ -798,7 +798,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonGroupArray( _ value: some SQLExpressible, filter: (any SQLSpecificExpressible)? = nil) @@ -828,7 +828,7 @@ extension Database { /// ``` /// /// Related SQLite documentation: - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonGroupObject( key: some SQLExpressible, value: some SQLExpressible, diff --git a/GRDB/Migration/DatabaseMigrator.swift b/GRDB/Migration/DatabaseMigrator.swift index 11c2ae92e4..d92635c294 100644 --- a/GRDB/Migration/DatabaseMigrator.swift +++ b/GRDB/Migration/DatabaseMigrator.swift @@ -496,7 +496,6 @@ extension DatabaseMigrator { /// - parameter writer: A DatabaseWriter. /// where migrations should apply. /// - parameter scheduler: A Combine Scheduler. - @available(macOS 10.15, *) public func migratePublisher( _ writer: some DatabaseWriter, receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main) @@ -514,7 +513,6 @@ extension DatabaseMigrator { } } -@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that migrates a database. /// diff --git a/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift b/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift index ab6a1047ae..56451b4384 100644 --- a/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/Request/QueryInterfaceRequest.swift @@ -646,7 +646,6 @@ extension QueryInterfaceRequest { /// - parameter db: A database connection. /// - returns: A set of deleted ids. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. - @available(macOS 10.15, *) // Identifiable public func deleteAndFetchIds(_ db: Database) throws -> Set where RowDecoder: TableRecord & Identifiable, diff --git a/GRDB/QueryInterface/Request/RequestProtocols.swift b/GRDB/QueryInterface/Request/RequestProtocols.swift index c265069f95..6059e56d38 100644 --- a/GRDB/QueryInterface/Request/RequestProtocols.swift +++ b/GRDB/QueryInterface/Request/RequestProtocols.swift @@ -631,7 +631,6 @@ extension TableRequest where Self: FilteredRequest, Self: TypedRequest { } } -@available(macOS 10.15, *) extension TableRequest where Self: FilteredRequest, Self: TypedRequest, diff --git a/GRDB/QueryInterface/SQL/SQLExpression.swift b/GRDB/QueryInterface/SQL/SQLExpression.swift index 6203aaef54..58acaf7c41 100644 --- a/GRDB/QueryInterface/SQL/SQLExpression.swift +++ b/GRDB/QueryInterface/SQL/SQLExpression.swift @@ -2106,7 +2106,7 @@ extension SQLExpression { } } #else - @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS + @available(iOS 16, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS /// Returns an expression suitable in JSON building contexts. var jsonBuilderExpression: SQLExpression { switch preferredJSONInterpretation { diff --git a/GRDB/QueryInterface/SQL/Table.swift b/GRDB/QueryInterface/SQL/Table.swift index cdaf32b85c..a96714bc15 100644 --- a/GRDB/QueryInterface/SQL/Table.swift +++ b/GRDB/QueryInterface/SQL/Table.swift @@ -722,7 +722,6 @@ extension Table { } } -@available(macOS 10.15, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible { /// Returns a request filtered by primary key. /// @@ -1545,7 +1544,6 @@ extension Table { } } -@available(macOS 10.15, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible @@ -1686,7 +1684,6 @@ extension Table { } } -@available(macOS 10.15, *) extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible diff --git a/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift b/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift index fa9acff667..e86156f24e 100644 --- a/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift +++ b/GRDB/QueryInterface/TableRecord+QueryInterfaceRequest.swift @@ -604,7 +604,6 @@ extension TableRecord { } } -@available(macOS 10.15, *) 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 18ea1eeb23..b755110640 100644 --- a/GRDB/Record/FetchableRecord+TableRecord.swift +++ b/GRDB/Record/FetchableRecord+TableRecord.swift @@ -216,7 +216,6 @@ extension FetchableRecord where Self: TableRecord { } } -@available(macOS 10.15, *) extension FetchableRecord where Self: TableRecord & Identifiable, ID: DatabaseValueConvertible { // MARK: Fetching by Single-Column Primary Key @@ -358,7 +357,6 @@ extension FetchableRecord where Self: TableRecord & Hashable { } } -@available(macOS 10.15, *) 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 46794444f1..295b13785f 100644 --- a/GRDB/Record/TableRecord.swift +++ b/GRDB/Record/TableRecord.swift @@ -319,7 +319,6 @@ extension TableRecord { } } -@available(macOS 10.15, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Returns whether a record exists for this primary key. /// @@ -454,7 +453,6 @@ extension TableRecord { } } -@available(macOS 10.15, *) extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible { /// Deletes records identified by their primary keys, and returns the number /// of deleted records. @@ -774,7 +772,6 @@ extension TableRecord where Self: EncodableRecord { } } -@available(macOS 10.15, *) 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 e91d8af447..938750d4ab 100644 --- a/GRDB/Utils/OnDemandFuture.swift +++ b/GRDB/Utils/OnDemandFuture.swift @@ -17,7 +17,6 @@ import Foundation /// /// OnDemandFuture also adds Sendable requirements that avoid /// compiler warnings. -@available(macOS 10.15, *) struct OnDemandFuture: Publisher { typealias Promise = @Sendable (Result) -> Void typealias Output = Output @@ -36,7 +35,6 @@ struct OnDemandFuture: Publisher { } } -@available(macOS 10.15, *) private class OnDemandFutureSubscription: Subscription, @unchecked Sendable { // @unchecked because `state` is protected with `lock`. typealias Promise = @Sendable (Result) -> Void diff --git a/GRDB/Utils/ReceiveValuesOn.swift b/GRDB/Utils/ReceiveValuesOn.swift index 5a309e1f50..2df87fc46a 100644 --- a/GRDB/Utils/ReceiveValuesOn.swift +++ b/GRDB/Utils/ReceiveValuesOn.swift @@ -11,7 +11,6 @@ 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(macOS 10.15, *) struct ReceiveValuesOn: Publisher { typealias Output = Upstream.Output typealias Failure = Upstream.Failure @@ -30,7 +29,6 @@ struct ReceiveValuesOn: Publisher { } } -@available(macOS 10.15, *) private class ReceiveValuesOnSubscription: Subscription, Subscriber where Upstream: Publisher, @@ -211,7 +209,6 @@ where } } -@available(macOS 10.15, *) 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 925a67a2c3..1550a619c3 100644 --- a/GRDB/ValueObservation/SharedValueObservation.swift +++ b/GRDB/ValueObservation/SharedValueObservation.swift @@ -292,7 +292,6 @@ public final class SharedValueObservation: @unchecked Sendabl /// print("fresh players: \(players)") /// } /// ``` - @available(macOS 10.15, *) public func publisher() -> DatabasePublishers.Value { DatabasePublishers.Value { onError, onChange in self.start(onError: onError, onChange: onChange) @@ -369,7 +368,6 @@ extension SharedValueObservation { /// print("Fresh players: \(players)") /// } /// ``` - @available(macOS 10.15, *) public func values(bufferingPolicy: AsyncValueObservation.BufferingPolicy = .unbounded) -> AsyncValueObservation { diff --git a/GRDB/ValueObservation/ValueObservation.swift b/GRDB/ValueObservation/ValueObservation.swift index 84d9eda005..8ce4b8abae 100644 --- a/GRDB/ValueObservation/ValueObservation.swift +++ b/GRDB/ValueObservation/ValueObservation.swift @@ -179,7 +179,6 @@ extension ValueObservation: Refinable { /// - parameter onChange: The closure to execute on receipt of a /// fresh value. /// - returns: A DatabaseCancellable that can stop the observation. - @available(macOS 10.15, *) @preconcurrency @MainActor public func start( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationMainActorScheduler = .mainActor, @@ -350,7 +349,6 @@ extension ValueObservation { /// fresh values are dispatched on the cooperative thread pool. /// - parameter bufferingPolicy: see the documntation /// of `AsyncThrowingStream`. - @available(macOS 10.15, *) public func values( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler = .task, @@ -386,7 +384,6 @@ extension ValueObservation { /// /// You build an `AsyncValueObservation` from ``ValueObservation`` or /// ``SharedValueObservation``. -@available(macOS 10.15, *) public struct AsyncValueObservation: AsyncSequence { public typealias BufferingPolicy = AsyncThrowingStream.Continuation.BufferingPolicy public typealias AsyncIterator = Iterator @@ -488,7 +485,6 @@ extension ValueObservation { /// - parameter scheduler: A ValueObservationScheduler. By default, fresh /// values are dispatched asynchronously on the main dispatch queue. /// - returns: A Combine publisher - @available(macOS 10.15, *) public func publisher( in reader: some DatabaseReader, scheduling scheduler: some ValueObservationScheduler = .async(onQueue: .main)) @@ -505,7 +501,6 @@ extension ValueObservation { } } -@available(macOS 10.15, *) extension DatabasePublishers { /// A publisher that publishes the values of a ``ValueObservation``. /// diff --git a/GRDB/ValueObservation/ValueObservationScheduler.swift b/GRDB/ValueObservation/ValueObservationScheduler.swift index 887ce09cf1..168c7c7062 100644 --- a/GRDB/ValueObservation/ValueObservationScheduler.swift +++ b/GRDB/ValueObservation/ValueObservationScheduler.swift @@ -182,7 +182,6 @@ extension ValueObservationMainActorScheduler where Self == ImmediateValueObserva // MARK: - TaskValueObservationScheduler /// A scheduler that notifies all values on the cooperative thread pool. -@available(macOS 10.15, *) public final class TaskValueObservationScheduler: ValueObservationScheduler { typealias Action = @Sendable () -> Void let continuation: AsyncStream.Continuation @@ -212,7 +211,6 @@ public final class TaskValueObservationScheduler: ValueObservationScheduler { } } -@available(macOS 10.15, *) extension ValueObservationScheduler where Self == TaskValueObservationScheduler { /// A scheduler that notifies all values from a new `Task`. public static var task: TaskValueObservationScheduler { @@ -229,7 +227,6 @@ extension ValueObservationScheduler where Self == TaskValueObservationScheduler // MARK: - DelayedMainActorValueObservationScheduler /// A scheduler that notifies all values on the cooperative thread pool. -@available(macOS 10.15, *) public final class DelayedMainActorValueObservationScheduler: ValueObservationMainActorScheduler { public func immediateInitialValue() -> Bool { false @@ -240,7 +237,6 @@ public final class DelayedMainActorValueObservationScheduler: ValueObservationMa } } -@available(macOS 10.15, *) extension ValueObservationScheduler where Self == DelayedMainActorValueObservationScheduler { /// A scheduler that notifies all values on the main actor. public static var mainActor: DelayedMainActorValueObservationScheduler { diff --git a/Package.swift b/Package.swift index 6b53e53ff4..8d645a1cdb 100644 --- a/Package.swift +++ b/Package.swift @@ -37,7 +37,7 @@ let package = Package( defaultLocalization: "en", // for tests platforms: [ .iOS(.v13), - .macOS(.v10_13), + .macOS(.v10_15), .tvOS(.v13), .watchOS(.v7), ], diff --git a/README.md b/README.md index 530e3d309c..4d5d4e24c4 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ **Latest release**: September 7, 2024 • [version 6.29.3](https://github.com/groue/GRDB.swift/tree/v6.29.3) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md) -**Requirements**: iOS 13.0+ / macOS 10.13+ / tvOS 13.0+ / watchOS 7.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+ +**Requirements**: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ • SQLite 3.20.0+ • Swift 6+ / Xcode 16+ **Contact**: diff --git a/SQLiteCustom/GRDBDeploymentTarget.xcconfig b/SQLiteCustom/GRDBDeploymentTarget.xcconfig index 369f90a510..b4c8e9ed72 100644 --- a/SQLiteCustom/GRDBDeploymentTarget.xcconfig +++ b/SQLiteCustom/GRDBDeploymentTarget.xcconfig @@ -1,5 +1,5 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0 -MACOSX_DEPLOYMENT_TARGET = 10.13 +MACOSX_DEPLOYMENT_TARGET = 10.15 TVOS_DEPLOYMENT_TARGET = 13.0 WATCHOS_DEPLOYMENT_TARGET = 7.0 SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES diff --git a/Support/GRDBDeploymentTarget.xcconfig b/Support/GRDBDeploymentTarget.xcconfig index a457235eed..76035ab53d 100644 --- a/Support/GRDBDeploymentTarget.xcconfig +++ b/Support/GRDBDeploymentTarget.xcconfig @@ -1,5 +1,5 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0 -MACOSX_DEPLOYMENT_TARGET = 10.13 +MACOSX_DEPLOYMENT_TARGET = 10.15 TVOS_DEPLOYMENT_TARGET = 13.0 WATCHOS_DEPLOYMENT_TARGET = 7.0 OTHER_SWIFT_FLAGS = $(inherited) -D SQLITE_ENABLE_FTS5 diff --git a/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/project.pbxproj b/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/project.pbxproj index d4e67092f7..a872849dd6 100644 --- a/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/project.pbxproj +++ b/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/project.pbxproj @@ -1822,7 +1822,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; ONLY_ACTIVE_ARCH = YES; SWIFT_VERSION = 5.0; }; @@ -1856,7 +1856,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; SWIFT_VERSION = 5.0; }; name = Release; diff --git a/Tests/CocoaPods/SQLCipher3/Podfile b/Tests/CocoaPods/SQLCipher3/Podfile index fbe38136b0..66346dd900 100644 --- a/Tests/CocoaPods/SQLCipher3/Podfile +++ b/Tests/CocoaPods/SQLCipher3/Podfile @@ -1,4 +1,4 @@ -platform :macos, '10.13' +platform :macos, '10.15' use_frameworks! def common @@ -19,7 +19,7 @@ post_install do |installer| target.build_configurations.each do |config| # Workaround for Xcode 14.3+ # https://github.com/CocoaPods/CocoaPods/issues/11839 - config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.13' + config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.15' config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '3' end end diff --git a/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/project.pbxproj b/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/project.pbxproj index 1359a5a85c..64c03419a8 100644 --- a/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/project.pbxproj +++ b/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/project.pbxproj @@ -1828,7 +1828,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; ONLY_ACTIVE_ARCH = YES; SWIFT_VERSION = 5.0; }; @@ -1862,7 +1862,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; SWIFT_VERSION = 5.0; }; name = Release; diff --git a/Tests/CocoaPods/SQLCipher4/Podfile b/Tests/CocoaPods/SQLCipher4/Podfile index 031d49b72e..d6e3762437 100644 --- a/Tests/CocoaPods/SQLCipher4/Podfile +++ b/Tests/CocoaPods/SQLCipher4/Podfile @@ -1,4 +1,4 @@ -platform :macos, '10.13' +platform :macos, '10.15' use_frameworks! def common @@ -19,7 +19,7 @@ post_install do |installer| target.build_configurations.each do |config| # Workaround for Xcode 14.3+ # https://github.com/CocoaPods/CocoaPods/issues/11839 - config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.13' + config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.15' config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '3' end end diff --git a/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift b/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift index 7c8656f354..f37f2eb1ec 100644 --- a/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift +++ b/Tests/CombineExpectations/PublisherExpectations/AvailableElements.swift @@ -1,7 +1,6 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, *) 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 6c773f4f3d..c7b7ecf3dc 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Finished.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Finished.swift @@ -17,7 +17,6 @@ import XCTest // try wait(for: recorder.finished.inverted, timeout: 1) // } -@available(macOS 10.15, *) 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 218402af60..755897823d 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Inverted.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Inverted.swift @@ -1,7 +1,6 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, *) 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 2f55cc60ec..87276c91de 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Map.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Map.swift @@ -1,7 +1,6 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, *) extension PublisherExpectations { /// A publisher expectation that transforms the value of a base expectation. /// @@ -20,7 +19,6 @@ extension PublisherExpectations { } } -@available(macOS 10.15, *) 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 8d511ccd8e..6a27fa7df7 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Next.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Next.swift @@ -1,7 +1,6 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, *) 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 6d4869a5c9..65ebe04b12 100644 --- a/Tests/CombineExpectations/PublisherExpectations/NextOne.swift +++ b/Tests/CombineExpectations/PublisherExpectations/NextOne.swift @@ -1,7 +1,6 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, *) 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 3089272c9b..c9bae6cf56 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Prefix.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Prefix.swift @@ -1,7 +1,6 @@ #if canImport(Combine) import XCTest -@available(macOS 10.15, *) 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 59bd76c1bf..1368f42252 100644 --- a/Tests/CombineExpectations/PublisherExpectations/Recording.swift +++ b/Tests/CombineExpectations/PublisherExpectations/Recording.swift @@ -2,7 +2,6 @@ import Combine import XCTest -@available(macOS 10.15, *) 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 153f328a57..bc61f110dd 100644 --- a/Tests/CombineExpectations/Recorder.swift +++ b/Tests/CombineExpectations/Recorder.swift @@ -13,7 +13,6 @@ import XCTest /// /// let elements = try wait(for: recorder.elements, timeout: 1) /// XCTAssertEqual(elements, ["foo", "bar", "baz"]) -@available(macOS 10.15, *) public class Recorder: Subscriber { public typealias Input = Input public typealias Failure = Failure @@ -287,7 +286,6 @@ public class Recorder: Subscriber { // MARK: - Publisher Expectations -@available(macOS 10.15, *) extension PublisherExpectations { /// The type of the publisher expectation returned by `Recorder.completion`. public typealias Completion = Map, Subscribers.Completion> @@ -302,7 +300,6 @@ extension PublisherExpectations { public typealias Single = Map, Input> } -@available(macOS 10.15, *) extension Recorder { /// Returns a publisher expectation which waits for the timeout to expire, /// or the recorded publisher to complete. @@ -584,7 +581,6 @@ extension Recorder { // MARK: - Publisher + Recorder -@available(macOS 10.15, *) extension Publisher { /// Returns a subscribed Recorder. /// diff --git a/Tests/CustomSQLite/CustomSQLite.xcodeproj/project.pbxproj b/Tests/CustomSQLite/CustomSQLite.xcodeproj/project.pbxproj index 4d0fd10cde..315344000f 100644 --- a/Tests/CustomSQLite/CustomSQLite.xcodeproj/project.pbxproj +++ b/Tests/CustomSQLite/CustomSQLite.xcodeproj/project.pbxproj @@ -342,7 +342,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -397,7 +397,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; diff --git a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift index 79defbd8ca..9d7f4a813f 100644 --- a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift @@ -22,10 +22,6 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -128,10 +124,6 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // frame #71: 0x00007fff72311cc9 libdyld.dylib`start + 1 // frame #72: 0x00007fff72311cc9 libdyld.dylib`start + 1 func testReadPublisherError() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(reader: some DatabaseReader) throws { let publisher = reader.readPublisher(value: { db in try Row.fetchAll(db, sql: "THIS IS NOT SQL") @@ -157,10 +149,6 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherIsAsynchronous() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -197,10 +185,6 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherDefaultScheduler() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -237,10 +221,6 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherCustomScheduler() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -278,10 +258,6 @@ class DatabaseReaderReadPublisherTests : XCTestCase { // MARK: - func testReadPublisherIsReadonly() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(reader: some DatabaseReader) throws { let publisher = reader.readPublisher(value: { db in try Player.createTable(db) diff --git a/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift index 10a3568b89..a83adfa02a 100644 --- a/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseRegionObservationPublisherTests.swift @@ -20,10 +20,6 @@ private struct Player: Codable, FetchableRecord, PersistableRecord { class DatabaseRegionObservationPublisherTests : XCTestCase { func testChangesNotifications() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -61,10 +57,6 @@ 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(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer diff --git a/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift b/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift index d9534238cb..7d1b2d0a57 100644 --- a/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift +++ b/Tests/GRDBCombineTests/DatabaseWriterWritePublisherTests.swift @@ -22,10 +22,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -49,10 +45,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherValue() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -76,10 +68,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherError() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let publisher = writer.writePublisher(updates: { db in try db.execute(sql: "THIS IS NOT SQL") @@ -99,10 +87,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { } func testWritePublisherErrorRollbacksTransaction() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -132,10 +116,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherIsAsynchronous() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -168,10 +148,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherDefaultScheduler() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -206,10 +182,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWritePublisherCustomScheduler() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -247,10 +219,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // TODO: Fix flaky test with both pool and on-disk queue: // - Expectation timeout func testWriteThenReadPublisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -274,10 +242,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWriteThenReadPublisherIsReadonly() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let publisher = writer .writePublisher( @@ -299,10 +263,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // MARK: - func testWriteThenReadPublisherWriteError() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let publisher = writer.writePublisher( updates: { db in try db.execute(sql: "THIS IS NOT SQL") }, @@ -322,10 +282,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { } func testWriteThenReadPublisherWriteErrorRollbacksTransaction() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -359,10 +315,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // TODO: Fix flaky test with both pool and on-disk queue: // - Expectation timeout func testWriteThenReadPublisherReadError() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let publisher = writer.writePublisher( updates: { _ in }, @@ -386,10 +338,6 @@ class DatabaseWriterWritePublisherTests : XCTestCase { // Regression test against deadlocks created by concurrent completion // and cancellations triggered by .switchToLatest().prefix(1) func testDeadlockPrevention() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer diff --git a/Tests/GRDBCombineTests/Support.swift b/Tests/GRDBCombineTests/Support.swift index 678195909d..6d35dd7718 100644 --- a/Tests/GRDBCombineTests/Support.swift +++ b/Tests/GRDBCombineTests/Support.swift @@ -51,7 +51,6 @@ final class Test { } } -@available(macOS 10.15, *) final class AsyncTest { // Raise the repeatCount in order to help spotting flaky tests. private let repeatCount: Int @@ -100,7 +99,6 @@ final class AsyncTest { } } -@available(macOS 10.15, *) public func assertNoFailure( _ completion: Subscribers.Completion, file: StaticString = #file, @@ -111,7 +109,6 @@ public func assertNoFailure( } } -@available(macOS 10.15, *) public func assertFailure( _ completion: Subscribers.Completion, file: StaticString = #file, diff --git a/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift b/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift index ae89d3f27b..0849a0085e 100644 --- a/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift +++ b/Tests/GRDBCombineTests/ValueObservationPublisherTests.swift @@ -22,10 +22,6 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Default Scheduler func testDefaultSchedulerChangesNotifications() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -64,10 +60,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testDefaultSchedulerFirstValueIsEmittedAsynchronously() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -97,10 +89,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testDefaultSchedulerError() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let publisher = ValueObservation .trackingConstantRegion { try $0.execute(sql: "THIS IS NOT SQL") } @@ -123,10 +111,6 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Immediate Scheduler func testImmediateSchedulerChangesNotifications() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -165,10 +149,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testImmediateSchedulerEmitsFirstValueSynchronously() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -201,10 +181,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testImmediateSchedulerError() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let publisher = ValueObservation .trackingConstantRegion { try $0.execute(sql: "THIS IS NOT SQL") } @@ -226,7 +202,6 @@ class ValueObservationPublisherTests : XCTestCase { // MARK: - Demand - @available(macOS 10.15, *) private class DemandSubscriber: Subscriber { private var subscription: Subscription? let subject = PassthroughSubject() @@ -257,10 +232,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandNoneReceivesNoElement() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -292,10 +263,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandOneReceivesOneElement() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -330,10 +297,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandOneDoesNotReceiveTwoElements() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -372,10 +335,6 @@ class ValueObservationPublisherTests : XCTestCase { } func testDemandTwoReceivesTwoElements() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func setUp(_ writer: Writer) throws -> Writer { try writer.write(Player.createTable) return writer @@ -418,10 +377,6 @@ class ValueObservationPublisherTests : XCTestCase { /// Regression test for https://github.com/groue/GRDB.swift/issues/1194 func testIssue1194() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - struct Record: Codable, FetchableRecord, PersistableRecord { var id: Int64 } diff --git a/Tests/GRDBTests/AsyncSemaphore.swift b/Tests/GRDBTests/AsyncSemaphore.swift index cc6dd61097..97691ab67c 100644 --- a/Tests/GRDBTests/AsyncSemaphore.swift +++ b/Tests/GRDBTests/AsyncSemaphore.swift @@ -43,7 +43,6 @@ import Foundation /// /// - ``wait()`` /// - ``waitUnlessCancelled()`` -@available(macOS 10.15, *) public final class AsyncSemaphore: @unchecked Sendable { /// `Suspension` is the state of a task waiting for a signal. /// diff --git a/Tests/GRDBTests/DatabaseCursorTests.swift b/Tests/GRDBTests/DatabaseCursorTests.swift index 19e53f3700..6b43570b48 100644 --- a/Tests/GRDBTests/DatabaseCursorTests.swift +++ b/Tests/GRDBTests/DatabaseCursorTests.swift @@ -175,42 +175,40 @@ class DatabaseCursorTests: GRDBTestCase { // with raw C SQLite3 apis. The faulty line is the call to // sqlite3_set_authorizer during the statement iteration. -// if #available(OSX 10.14, *) { -// var connection: SQLiteConnection? = nil -// sqlite3_open_v2(":memory:", &connection, SQLITE_OPEN_READWRITE | SQLITE_OPEN_NOMUTEX, nil) -// sqlite3_extended_result_codes(connection, 1) +// var connection: SQLiteConnection? = nil +// sqlite3_open_v2(":memory:", &connection, SQLITE_OPEN_READWRITE | SQLITE_OPEN_NOMUTEX, nil) +// sqlite3_extended_result_codes(connection, 1) // -// sqlite3_exec(connection, """ -// CREATE TABLE user (username TEXT NOT NULL); -// CREATE TABLE flagUser (username TEXT NOT NULL); -// INSERT INTO flagUser (username) VALUES ('User1'); -// INSERT INTO flagUser (username) VALUES ('User2'); -// """, nil, nil, nil) +// sqlite3_exec(connection, """ +// CREATE TABLE user (username TEXT NOT NULL); +// CREATE TABLE flagUser (username TEXT NOT NULL); +// INSERT INTO flagUser (username) VALUES ('User1'); +// INSERT INTO flagUser (username) VALUES ('User2'); +// """, nil, nil, nil) // -// var statement: SQLiteStatement? = nil -// sqlite3_set_authorizer(connection, { (_, _, _, _, _, _) in SQLITE_OK }, nil) -// sqlite3_prepare_v3(connection, """ -// SELECT * FROM flagUser WHERE (SELECT COUNT(*) FROM user WHERE username = flagUser.username) = 0 -// """, -1, 0, &statement, nil) -// sqlite3_set_authorizer(connection, nil, nil) -// while true { -// let code = sqlite3_step(statement) -// if code == SQLITE_DONE { -// break -// } else if code == SQLITE_ROW { -// // part of the compilation of another statement, here -// // reduced to the strict minimum that reproduces -// // the error. -// sqlite3_set_authorizer(connection, nil, nil) -// } else { -// print(String(cString: sqlite3_errmsg(connection))) -// XCTFail("Error \(code)") -// break -// } +// var statement: SQLiteStatement? = nil +// sqlite3_set_authorizer(connection, { (_, _, _, _, _, _) in SQLITE_OK }, nil) +// sqlite3_prepare_v3(connection, """ +// SELECT * FROM flagUser WHERE (SELECT COUNT(*) FROM user WHERE username = flagUser.username) = 0 +// """, -1, 0, &statement, nil) +// sqlite3_set_authorizer(connection, nil, nil) +// while true { +// let code = sqlite3_step(statement) +// if code == SQLITE_DONE { +// break +// } else if code == SQLITE_ROW { +// // part of the compilation of another statement, here +// // reduced to the strict minimum that reproduces +// // the error. +// sqlite3_set_authorizer(connection, nil, nil) +// } else { +// print(String(cString: sqlite3_errmsg(connection))) +// XCTFail("Error \(code)") +// break // } -// sqlite3_finalize(statement) -// sqlite3_close_v2(connection) // } +// sqlite3_finalize(statement) +// sqlite3_close_v2(connection) } // This test passes if it compiles diff --git a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift index 58d33c7584..61f42d7515 100644 --- a/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDataEncodingStrategyTests.swift @@ -25,7 +25,6 @@ private struct RecordWithData: EncodableRecord, Enco var data: Data } -@available(macOS 10.15, *) extension RecordWithData: Identifiable { var id: Data { data } } @@ -37,7 +36,6 @@ private struct RecordWithOptionalData: EncodableReco var data: Data? } -@available(macOS 10.15, *) extension RecordWithOptionalData: Identifiable { var id: Data? { data } } @@ -154,10 +152,6 @@ extension DatabaseDataEncodingStrategyTests { } func testFilterID() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Identifiable not available") - } - try makeDatabaseQueue().write { db in try db.create(table: "t") { $0.primaryKey("id", .blob) } @@ -234,10 +228,6 @@ extension DatabaseDataEncodingStrategyTests { } func testDeleteID() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Identifiable not available") - } - try makeDatabaseQueue().write { db in try db.create(table: "t") { $0.primaryKey("id", .blob) } diff --git a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift index 0f8b7629e1..90ab8c4102 100644 --- a/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift @@ -52,7 +52,6 @@ private struct RecordWithDate: EncodableRecord, Enco var date: Date } -@available(macOS 10.15, *) extension RecordWithDate: Identifiable { var id: Date { date } } @@ -64,7 +63,6 @@ private struct RecordWithOptionalDate: EncodableReco var date: Date? } -@available(macOS 10.15, *) extension RecordWithOptionalDate: Identifiable { var id: Date? { date } } @@ -264,10 +262,6 @@ extension DatabaseDateEncodingStrategyTests { } func testFilterID() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Identifiable not available") - } - try makeDatabaseQueue().write { db in try db.create(table: "t") { $0.primaryKey("id", .datetime) } @@ -344,10 +338,6 @@ extension DatabaseDateEncodingStrategyTests { } func testDeleteID() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Identifiable not available") - } - try makeDatabaseQueue().write { db in try db.create(table: "t") { $0.primaryKey("id", .datetime) } diff --git a/Tests/GRDBTests/DatabaseDumpTests.swift b/Tests/GRDBTests/DatabaseDumpTests.swift index f05da9916e..29d59caa72 100644 --- a/Tests/GRDBTests/DatabaseDumpTests.swift +++ b/Tests/GRDBTests/DatabaseDumpTests.swift @@ -238,10 +238,6 @@ final class DatabaseDumpTests: GRDBTestCase { // MARK: - JSON func test_json_value_formatting() throws { - guard #available(macOS 10.15.0, *) else { - throw XCTSkip("Skip because this test relies on JSONEncoder.OutputFormatting.withoutEscapingSlashes") - } - try makeValuesDatabase().read { db in let stream = TestStream() try db.dumpSQL("SELECT * FROM value ORDER BY name", format: .json(), to: stream) diff --git a/Tests/GRDBTests/DatabaseMigratorTests.swift b/Tests/GRDBTests/DatabaseMigratorTests.swift index 700ad3381e..d6b118923b 100644 --- a/Tests/GRDBTests/DatabaseMigratorTests.swift +++ b/Tests/GRDBTests/DatabaseMigratorTests.swift @@ -41,10 +41,6 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let migrator = DatabaseMigrator() let publisher = migrator.migratePublisher(writer) @@ -153,10 +149,6 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { var migrator = DatabaseMigrator() migrator.registerMigration("createPersons") { db in @@ -209,10 +201,6 @@ class DatabaseMigratorTests : GRDBTestCase { } func testEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { let migrator = DatabaseMigrator() let expectation = self.expectation(description: "") @@ -235,10 +223,6 @@ class DatabaseMigratorTests : GRDBTestCase { } func testNonEmptyMigratorPublisherIsAsynchronous() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: some DatabaseWriter) throws { var migrator = DatabaseMigrator() migrator.registerMigration("first", migrate: { _ in }) @@ -262,10 +246,6 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherDefaultScheduler() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: Writer) { var migrator = DatabaseMigrator() migrator.registerMigration("first", migrate: { _ in }) @@ -291,10 +271,6 @@ class DatabaseMigratorTests : GRDBTestCase { } func testMigratorPublisherCustomScheduler() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - func test(writer: Writer) { var migrator = DatabaseMigrator() migrator.registerMigration("first", migrate: { _ in }) diff --git a/Tests/GRDBTests/DatabaseReaderTests.swift b/Tests/GRDBTests/DatabaseReaderTests.swift index d7ebdb9e1c..ab64b6e7ad 100644 --- a/Tests/GRDBTests/DatabaseReaderTests.swift +++ b/Tests/GRDBTests/DatabaseReaderTests.swift @@ -49,7 +49,6 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(macOS 10.15, *) func testAsyncAwait_ReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -91,7 +90,6 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(macOS 10.15, *) func testAsyncAwait_ReadPreventsDatabaseModification() async throws { func test(_ dbReader: some DatabaseReader) async throws { do { @@ -135,7 +133,6 @@ class DatabaseReaderTests : GRDBTestCase { #endif } - @available(macOS 10.15, *) func testAsyncAwait_UnsafeReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -347,7 +344,6 @@ class DatabaseReaderTests : GRDBTestCase { // MARK: - Task Cancellation - @available(macOS 10.15, *) func test_read_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -383,7 +379,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_read_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -420,7 +415,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_statement_execution_from_read_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -459,7 +453,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_cursor_iteration_from_read_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -502,7 +495,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_unsafeRead_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -538,7 +530,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_unsafeRead_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -575,7 +566,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_statement_execution_from_unsafeRead_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -614,7 +604,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_cursor_iteration_from_unsafeRead_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbReader: some DatabaseReader) async throws { let semaphore = AsyncSemaphore(value: 0) diff --git a/Tests/GRDBTests/DatabaseRegionObservationTests.swift b/Tests/GRDBTests/DatabaseRegionObservationTests.swift index 49d76f9eba..3ffdfc39eb 100644 --- a/Tests/GRDBTests/DatabaseRegionObservationTests.swift +++ b/Tests/GRDBTests/DatabaseRegionObservationTests.swift @@ -8,10 +8,7 @@ class DatabaseRegionObservationTests: GRDBTestCase { let observation = DatabaseRegionObservation(tracking: .fullDatabase) _ = observation.start(in: writer, onError: { _ in }, onChange: { _ in }) - - if #available(macOS 10.15, *) { - _ = observation.publisher(in: writer) - } + _ = observation.publisher(in: writer) } func testDatabaseRegionObservation_FullDatabase() throws { diff --git a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift index 3a3e26c2cd..3235f5db9e 100644 --- a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift +++ b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift @@ -229,7 +229,6 @@ final class DatabaseSnapshotPoolTests: GRDBTestCase { try XCTAssertEqual(dbPool.read(counter.value), 2) } - @available(macOS 10.15, *) 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 119953a1b6..14dce9d843 100644 --- a/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift +++ b/Tests/GRDBTests/DatabaseUUIDEncodingStrategyTests.swift @@ -26,7 +26,6 @@ private struct RecordWithUUID: EncodableRecord, Enco var uuid: UUID } -@available(macOS 10.15, *) extension RecordWithUUID: Identifiable { var id: UUID { uuid } } @@ -39,7 +38,6 @@ private struct RecordWithOptionalUUID: EncodableReco var uuid: UUID? } -@available(macOS 10.15, *) extension RecordWithOptionalUUID: Identifiable { var id: UUID? { uuid } } @@ -190,10 +188,6 @@ extension DatabaseUUIDEncodingStrategyTests { } func testFilterID() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Identifiable not available") - } - try makeDatabaseQueue().write { db in try db.create(table: "t") { $0.primaryKey("id", .blob) } let uuids = [ @@ -309,10 +303,6 @@ extension DatabaseUUIDEncodingStrategyTests { } func testDeleteID() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Identifiable not available") - } - try makeDatabaseQueue().write { db in try db.create(table: "t") { $0.primaryKey("id", .blob) } let uuids = [ diff --git a/Tests/GRDBTests/DatabaseWriterTests.swift b/Tests/GRDBTests/DatabaseWriterTests.swift index 5d4f9e9652..221f01063e 100644 --- a/Tests/GRDBTests/DatabaseWriterTests.swift +++ b/Tests/GRDBTests/DatabaseWriterTests.swift @@ -275,7 +275,6 @@ class DatabaseWriterTests : GRDBTestCase { try DatabaseQueue().backup(to: dbQueue) } - @available(macOS 10.15, *) func testAsyncAwait_write() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -295,7 +294,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(macOS 10.15, *) func testAsyncAwait_writeWithoutTransaction() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -318,7 +316,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(macOS 10.15, *) func testAsyncAwait_barrierWriteWithoutTransaction() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -341,7 +338,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(macOS 10.15, *) func testAsyncAwait_erase() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -359,7 +355,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabasePool())) } - @available(macOS 10.15, *) func testAsyncAwait_vacuum() async throws { func setup(_ dbWriter: T) throws -> T { try dbWriter.write { db in @@ -406,7 +401,6 @@ class DatabaseWriterTests : GRDBTestCase { } /// A test related to - @available(macOS 10.15, *) func testAsyncWriteThenRead() async throws { /// An async read performed after an async write should see the write. func test(_ dbWriter: some DatabaseWriter) async throws { @@ -430,7 +424,6 @@ class DatabaseWriterTests : GRDBTestCase { // MARK: - Task Cancellation - @available(macOS 10.15, *) func test_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -461,7 +454,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -493,7 +485,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_statement_execution_from_writeWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -527,7 +518,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_cursor_iteration_from_writeWithoutTransaction_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -565,7 +555,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_write_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -596,7 +585,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_write_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -628,7 +616,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_statement_execution_from_write_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -662,7 +649,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_cursor_iteration_from_write_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -700,7 +686,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_before_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -731,7 +716,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -763,7 +747,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_statement_execution_from_barrierWriteWithoutTransaction_is_cancelled_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) @@ -797,7 +780,6 @@ class DatabaseWriterTests : GRDBTestCase { try await test(AnyDatabaseWriter(makeDatabaseQueue())) } - @available(macOS 10.15, *) func test_cursor_iteration_from_barrierWriteWithoutTransaction_is_interrupted_by_Task_cancellation_performed_after_database_access() async throws { func test(_ dbWriter: some DatabaseWriter) async throws { let semaphore = AsyncSemaphore(value: 0) diff --git a/Tests/GRDBTests/JSONColumnTests.swift b/Tests/GRDBTests/JSONColumnTests.swift index b73c21128d..da37da8fca 100644 --- a/Tests/GRDBTests/JSONColumnTests.swift +++ b/Tests/GRDBTests/JSONColumnTests.swift @@ -9,7 +9,7 @@ final class JSONColumnTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -51,7 +51,7 @@ final class JSONColumnTests: GRDBTestCase { throw XCTSkip("JSON_EXTRACT is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON_EXTRACT is not available") } #endif diff --git a/Tests/GRDBTests/JSONExpressionsTests.swift b/Tests/GRDBTests/JSONExpressionsTests.swift index f0b4390927..465fc06923 100644 --- a/Tests/GRDBTests/JSONExpressionsTests.swift +++ b/Tests/GRDBTests/JSONExpressionsTests.swift @@ -9,7 +9,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -44,7 +44,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -105,7 +105,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -281,7 +281,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -316,7 +316,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -392,7 +392,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -435,7 +435,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -470,7 +470,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -525,7 +525,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -580,7 +580,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -635,7 +635,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -738,7 +738,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -821,7 +821,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -904,7 +904,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -947,7 +947,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -990,7 +990,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1025,7 +1025,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1060,7 +1060,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1103,7 +1103,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1138,7 +1138,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1185,7 +1185,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1216,7 +1216,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1282,7 +1282,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1309,7 +1309,7 @@ final class JSONExpressionsTests: GRDBTestCase { throw XCTSkip("JSON support is not available") } #else - guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { + guard #available(iOS 16, tvOS 17, watchOS 9, *) else { throw XCTSkip("JSON support is not available") } #endif @@ -1397,7 +1397,7 @@ final class JSONExpressionsTests: GRDBTestCase { // throw XCTSkip("JSON support is not available") // } // #else -// guard #available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) else { +// guard #available(iOS 16, tvOS 17, watchOS 9, *) else { // throw XCTSkip("JSON support is not available") // } // #endif diff --git a/Tests/GRDBTests/JoinSupportTests.swift b/Tests/GRDBTests/JoinSupportTests.swift index e67523fbf7..fadd8bf3eb 100644 --- a/Tests/GRDBTests/JoinSupportTests.swift +++ b/Tests/GRDBTests/JoinSupportTests.swift @@ -92,7 +92,6 @@ private struct FlatModel: FetchableRecord { self.t5count = row.scopes[Scopes.suffix]!["t5count"] } - @available(macOS 10.15, *) static func modernAll() -> some FetchRequest { all() } @@ -138,7 +137,6 @@ private struct CodableFlatModel: FetchableRecord, Codable { var t3: T3? var t5count: Int - @available(macOS 10.15, *) static func modernAll() -> some FetchRequest { all() } @@ -186,7 +184,6 @@ private struct CodableNestedModel: FetchableRecord, Codable { var t3: T3? var t5count: Int - @available(macOS 10.15, *) static func modernAll() -> some FetchRequest { all() } diff --git a/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift b/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift index d3c598488c..11bd3e4288 100644 --- a/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift +++ b/Tests/GRDBTests/RecordMinimalNonOptionalPrimaryKeySingleTests.swift @@ -41,7 +41,6 @@ private class MinimalNonOptionalPrimaryKeySingle: Record, Hashable { } } -@available(macOS 10.15, *) extension MinimalNonOptionalPrimaryKeySingle: Identifiable { } class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { @@ -473,20 +472,18 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let ids: [String] = [] - let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids) - try XCTAssertNil(cursor.next()) - } - - do { - let ids = [record1.id, record2.id] - let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let ids: [String] = [] + let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids) + try XCTAssertNil(cursor.next()) + } + + do { + let ids = [record1.id, record2.id] + let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -512,19 +509,17 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [String] = [] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id, record2.id] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) - } + do { + let ids: [String] = [] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id, record2.id] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } } } @@ -550,19 +545,17 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [String] = [] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id, record2.id] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) - } + do { + let ids: [String] = [] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id, record2.id] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } } } @@ -585,12 +578,10 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.fetchOne(db, id: record.id)! - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") - } + do { + let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.fetchOne(db, id: record.id)! + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } } } @@ -613,17 +604,15 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(macOS 10.15, *) { - do { - _ = try MinimalNonOptionalPrimaryKeySingle.find(db, key: "missing") - XCTFail("Expected RecordError") - } catch RecordError.recordNotFound(databaseTableName: "minimalSingles", key: ["id": "missing".databaseValue]) { } - - do { - let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.find(db, id: record.id) - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") - } + do { + _ = try MinimalNonOptionalPrimaryKeySingle.find(db, key: "missing") + XCTFail("Expected RecordError") + } catch RecordError.recordNotFound(databaseTableName: "minimalSingles", key: ["id": "missing".databaseValue]) { } + + do { + let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.find(db, id: record.id) + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } } } @@ -653,20 +642,18 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let ids: [String] = [] - let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db) - try XCTAssertNil(cursor.next()) - } - - do { - let ids = [record1.id, record2.id] - let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let ids: [String] = [] + let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db) + try XCTAssertNil(cursor.next()) + } + + do { + let ids = [record1.id, record2.id] + let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -692,19 +679,17 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [String] = [] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id, record2.id] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) - } + do { + let ids: [String] = [] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id, record2.id] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } } } @@ -730,19 +715,17 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [String] = [] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id, record2.id] - let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) - } + do { + let ids: [String] = [] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id, record2.id] + let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids)) } } } @@ -765,12 +748,10 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.filter(id: record.id).fetchOne(db)! - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") - } + do { + let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.filter(id: record.id).fetchOne(db)! + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'") } } } diff --git a/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift b/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift index 9b4dc91874..91f38ad018 100644 --- a/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift +++ b/Tests/GRDBTests/RecordMinimalPrimaryKeyRowIDTests.swift @@ -45,7 +45,6 @@ class MinimalRowID : Record, Hashable { } } -@available(macOS 10.15, *) extension MinimalRowID: Identifiable { } class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { @@ -507,20 +506,18 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let cursor = try MinimalRowID.fetchCursor(db, ids: ids) - try XCTAssertNil(cursor.next()) - } - - do { - let ids = [record1.id!, record2.id!] - let cursor = try MinimalRowID.fetchCursor(db, ids: ids) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let ids: [Int64] = [] + let cursor = try MinimalRowID.fetchCursor(db, ids: ids) + try XCTAssertNil(cursor.next()) + } + + do { + let ids = [record1.id!, record2.id!] + let cursor = try MinimalRowID.fetchCursor(db, ids: ids) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -546,19 +543,17 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -584,19 +579,17 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -619,15 +612,13 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try MinimalRowID.fetchOne(db, id: record.id!)! - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") - } - do { - try XCTAssertNil(MinimalRowID.fetchOne(db, id: nil)) - } + do { + let fetchedRecord = try MinimalRowID.fetchOne(db, id: record.id!)! + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") + } + do { + try XCTAssertNil(MinimalRowID.fetchOne(db, id: nil)) } } } @@ -650,20 +641,18 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(macOS 10.15, *) { - do { - _ = try MinimalRowID.find(db, id: -1) - XCTFail("Expected RecordError") - } catch RecordError.recordNotFound(databaseTableName: "minimalRowIDs", key: ["id": (-1).databaseValue]) { } - - do { - let fetchedRecord = try MinimalRowID.find(db, id: record.id!) - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") - } - do { - try XCTAssertNil(MinimalRowID.fetchOne(db, id: nil)) - } + do { + _ = try MinimalRowID.find(db, id: -1) + XCTFail("Expected RecordError") + } catch RecordError.recordNotFound(databaseTableName: "minimalRowIDs", key: ["id": (-1).databaseValue]) { } + + do { + let fetchedRecord = try MinimalRowID.find(db, id: record.id!) + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") + } + do { + try XCTAssertNil(MinimalRowID.fetchOne(db, id: nil)) } } } @@ -693,20 +682,18 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db) - try XCTAssertNil(cursor.next()) - } - - do { - let ids = [record1.id!, record2.id!] - let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let ids: [Int64] = [] + let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db) + try XCTAssertNil(cursor.next()) + } + + do { + let ids = [record1.id!, record2.id!] + let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -732,19 +719,17 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -770,19 +755,17 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -805,15 +788,13 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try MinimalRowID.filter(id: record.id!).fetchOne(db)! - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") - } - do { - try XCTAssertNil(MinimalRowID.filter(id: nil).fetchOne(db)) - } + do { + let fetchedRecord = try MinimalRowID.filter(id: record.id!).fetchOne(db)! + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)") + } + do { + try XCTAssertNil(MinimalRowID.filter(id: nil).fetchOne(db)) } } } diff --git a/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift b/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift index 28e0a59131..cd2b838296 100644 --- a/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift +++ b/Tests/GRDBTests/RecordMinimalPrimaryKeySingleTests.swift @@ -39,7 +39,6 @@ class MinimalSingle: Record, Hashable { } } -@available(macOS 10.15, *) extension MinimalSingle: Identifiable { /// Test non-optional ID type var id: String { UUID! } @@ -531,20 +530,18 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let UUIDs: [String] = [] - let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs) - try XCTAssertNil(cursor.next()) - } - - do { - let UUIDs = [record1.UUID!, record2.UUID!] - let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let UUIDs: [String] = [] + let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs) + try XCTAssertNil(cursor.next()) + } + + do { + let UUIDs = [record1.UUID!, record2.UUID!] + let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -572,19 +569,17 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, *) { - do { - let UUIDs: [String] = [] - let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let UUIDs = [record1.UUID!, record2.UUID!] - let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) - } + do { + let UUIDs: [String] = [] + let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let UUIDs = [record1.UUID!, record2.UUID!] + let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } } } @@ -612,19 +607,17 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, *) { - do { - let UUIDs: [String] = [] - let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let UUIDs = [record1.UUID!, record2.UUID!] - let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) - } + do { + let UUIDs: [String] = [] + let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let UUIDs = [record1.UUID!, record2.UUID!] + let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } } } @@ -648,12 +641,10 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try MinimalSingle.fetchOne(db, id: record.UUID!)! - XCTAssertTrue(fetchedRecord.UUID == record.UUID) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") - } + do { + let fetchedRecord = try MinimalSingle.fetchOne(db, id: record.UUID!)! + XCTAssertTrue(fetchedRecord.UUID == record.UUID) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } } } @@ -677,17 +668,15 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(macOS 10.15, *) { - do { - _ = try MinimalSingle.find(db, id: "missing") - XCTFail("Expected RecordError") - } catch RecordError.recordNotFound(databaseTableName: "minimalSingles", key: ["UUID": "missing".databaseValue]) { } - - do { - let fetchedRecord = try MinimalSingle.find(db, id: record.UUID!) - XCTAssertTrue(fetchedRecord.UUID == record.UUID) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") - } + do { + _ = try MinimalSingle.find(db, id: "missing") + XCTFail("Expected RecordError") + } catch RecordError.recordNotFound(databaseTableName: "minimalSingles", key: ["UUID": "missing".databaseValue]) { } + + do { + let fetchedRecord = try MinimalSingle.find(db, id: record.UUID!) + XCTAssertTrue(fetchedRecord.UUID == record.UUID) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } } } @@ -719,20 +708,18 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let UUIDs: [String] = [] - let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db) - try XCTAssertNil(cursor.next()) - } - - do { - let UUIDs = [record1.UUID!, record2.UUID!] - let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let UUIDs: [String] = [] + let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db) + try XCTAssertNil(cursor.next()) + } + + do { + let UUIDs = [record1.UUID!, record2.UUID!] + let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -760,19 +747,17 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, *) { - do { - let UUIDs: [String] = [] - let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let UUIDs = [record1.UUID!, record2.UUID!] - let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) - } + do { + let UUIDs: [String] = [] + let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let UUIDs = [record1.UUID!, record2.UUID!] + let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } } } @@ -800,19 +785,17 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } - if #available(macOS 10.15, *) { - do { - let UUIDs: [String] = [] - let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let UUIDs = [record1.UUID!, record2.UUID!] - let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) - } + do { + let UUIDs: [String] = [] + let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let UUIDs = [record1.UUID!, record2.UUID!] + let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs)) } } } @@ -836,12 +819,10 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try MinimalSingle.filter(id: record.UUID!).fetchOne(db)! - XCTAssertTrue(fetchedRecord.UUID == record.UUID) - XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") - } + do { + let fetchedRecord = try MinimalSingle.filter(id: record.UUID!).fetchOne(db)! + XCTAssertTrue(fetchedRecord.UUID == record.UUID) + XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'") } } } diff --git a/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift b/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift index b16e2fc3f4..ca99bceb34 100644 --- a/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift +++ b/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift @@ -77,7 +77,6 @@ private class Person : Record, Hashable { } } -@available(macOS 10.15, *) extension Person: Identifiable { } class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { @@ -599,20 +598,18 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let cursor = try Person.fetchCursor(db, ids: ids) - try XCTAssertNil(cursor.next()) - } - - do { - let ids = [record1.id!, record2.id!] - let cursor = try Person.fetchCursor(db, ids: ids) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let ids: [Int64] = [] + let cursor = try Person.fetchCursor(db, ids: ids) + try XCTAssertNil(cursor.next()) + } + + do { + let ids = [record1.id!, record2.id!] + let cursor = try Person.fetchCursor(db, ids: ids) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -638,19 +635,17 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try Person.fetchAll(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try Person.fetchAll(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try Person.fetchAll(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try Person.fetchAll(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -676,19 +671,17 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try Person.fetchSet(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try Person.fetchSet(db, ids: ids) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try Person.fetchSet(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try Person.fetchSet(db, ids: ids) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -714,18 +707,16 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try Person.fetchOne(db, id: record.id!)! - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertTrue(fetchedRecord.name == record.name) - XCTAssertTrue(fetchedRecord.age == record.age) - XCTAssertTrue(abs(fetchedRecord.creationDate.timeIntervalSince(record.creationDate)) < 1e-3) // ISO-8601 is precise to the millisecond. - XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") - } - do { - try XCTAssertNil(Person.fetchOne(db, id: nil)) - } + do { + let fetchedRecord = try Person.fetchOne(db, id: record.id!)! + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertTrue(fetchedRecord.name == record.name) + XCTAssertTrue(fetchedRecord.age == record.age) + XCTAssertTrue(abs(fetchedRecord.creationDate.timeIntervalSince(record.creationDate)) < 1e-3) // ISO-8601 is precise to the millisecond. + XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") + } + do { + try XCTAssertNil(Person.fetchOne(db, id: nil)) } } } @@ -751,23 +742,21 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(macOS 10.15, *) { - do { - _ = try Person.find(db, id: -1) - XCTFail("Expected RecordError") - } catch RecordError.recordNotFound(databaseTableName: "persons", key: ["rowid": (-1).databaseValue]) { } - - do { - let fetchedRecord = try Person.find(db, id: record.id!) - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertTrue(fetchedRecord.name == record.name) - XCTAssertTrue(fetchedRecord.age == record.age) - XCTAssertTrue(abs(fetchedRecord.creationDate.timeIntervalSince(record.creationDate)) < 1e-3) // ISO-8601 is precise to the millisecond. - XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") - } - do { - try XCTAssertNil(Person.fetchOne(db, id: nil)) - } + do { + _ = try Person.find(db, id: -1) + XCTFail("Expected RecordError") + } catch RecordError.recordNotFound(databaseTableName: "persons", key: ["rowid": (-1).databaseValue]) { } + + do { + let fetchedRecord = try Person.find(db, id: record.id!) + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertTrue(fetchedRecord.name == record.name) + XCTAssertTrue(fetchedRecord.age == record.age) + XCTAssertTrue(abs(fetchedRecord.creationDate.timeIntervalSince(record.creationDate)) < 1e-3) // ISO-8601 is precise to the millisecond. + XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") + } + do { + try XCTAssertNil(Person.fetchOne(db, id: nil)) } } } @@ -797,20 +786,18 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertTrue(try cursor.next() == nil) // end } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let cursor = try Person.filter(ids: ids).fetchCursor(db) - try XCTAssertNil(cursor.next()) - } - - do { - let ids = [record1.id!, record2.id!] - let cursor = try Person.filter(ids: ids).fetchCursor(db) - let fetchedRecords = try [cursor.next()!, cursor.next()!] - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - XCTAssertTrue(try cursor.next() == nil) // end - } + do { + let ids: [Int64] = [] + let cursor = try Person.filter(ids: ids).fetchCursor(db) + try XCTAssertNil(cursor.next()) + } + + do { + let ids = [record1.id!, record2.id!] + let cursor = try Person.filter(ids: ids).fetchCursor(db) + let fetchedRecords = try [cursor.next()!, cursor.next()!] + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) + XCTAssertTrue(try cursor.next() == nil) // end } } } @@ -836,19 +823,17 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try Person.filter(ids: ids).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try Person.filter(ids: ids).fetchAll(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try Person.filter(ids: ids).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try Person.filter(ids: ids).fetchAll(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -874,19 +859,17 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } - if #available(macOS 10.15, *) { - do { - let ids: [Int64] = [] - let fetchedRecords = try Person.filter(ids: ids).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 0) - } - - do { - let ids = [record1.id!, record2.id!] - let fetchedRecords = try Person.filter(ids: ids).fetchSet(db) - XCTAssertEqual(fetchedRecords.count, 2) - XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) - } + do { + let ids: [Int64] = [] + let fetchedRecords = try Person.filter(ids: ids).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 0) + } + + do { + let ids = [record1.id!, record2.id!] + let fetchedRecords = try Person.filter(ids: ids).fetchSet(db) + XCTAssertEqual(fetchedRecords.count, 2) + XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids)) } } } @@ -912,18 +895,16 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase { XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") } - if #available(macOS 10.15, *) { - do { - let fetchedRecord = try Person.filter(id: record.id!).fetchOne(db)! - XCTAssertTrue(fetchedRecord.id == record.id) - XCTAssertTrue(fetchedRecord.name == record.name) - XCTAssertTrue(fetchedRecord.age == record.age) - XCTAssertTrue(abs(fetchedRecord.creationDate.timeIntervalSince(record.creationDate)) < 1e-3) // ISO-8601 is precise to the millisecond. - XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") - } - do { - try XCTAssertNil(Person.filter(id: nil).fetchOne(db)) - } + do { + let fetchedRecord = try Person.filter(id: record.id!).fetchOne(db)! + XCTAssertTrue(fetchedRecord.id == record.id) + XCTAssertTrue(fetchedRecord.name == record.name) + XCTAssertTrue(fetchedRecord.age == record.age) + XCTAssertTrue(abs(fetchedRecord.creationDate.timeIntervalSince(record.creationDate)) < 1e-3) // ISO-8601 is precise to the millisecond. + XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)") + } + do { + try XCTAssertNil(Person.filter(id: nil).fetchOne(db)) } } } diff --git a/Tests/GRDBTests/SharedValueObservationTests.swift b/Tests/GRDBTests/SharedValueObservationTests.swift index f794c5906e..4a8d629a56 100644 --- a/Tests/GRDBTests/SharedValueObservationTests.swift +++ b/Tests/GRDBTests/SharedValueObservationTests.swift @@ -120,10 +120,6 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_immediate_publisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in try db.create(table: "player") { t in @@ -397,10 +393,6 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_async_publisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in try db.create(table: "player") { t in @@ -525,7 +517,6 @@ class SharedValueObservationTests: GRDBTestCase { XCTAssertEqual(log.flush(), []) } - @available(macOS 10.15, *) func test_task_observationLifetime() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -622,10 +613,6 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_task_publisher() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in try db.create(table: "player") { t in @@ -656,7 +643,6 @@ class SharedValueObservationTests: GRDBTestCase { } #endif - @available(macOS 10.15, *) func test_task_whileObserved() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -753,10 +739,6 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_observationLifetime() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in try db.create(table: "player") { t in @@ -811,10 +793,6 @@ class SharedValueObservationTests: GRDBTestCase { #if canImport(Combine) func test_error_recovery_whileObserved() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Combine is not available") - } - let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in try db.create(table: "player") { t in @@ -867,7 +845,6 @@ class SharedValueObservationTests: GRDBTestCase { } #endif - @available(macOS 10.15, *) func testAsyncAwait_mainQueue() async throws { let dbQueue = try makeDatabaseQueue() try await dbQueue.write { db in @@ -887,7 +864,6 @@ class SharedValueObservationTests: GRDBTestCase { } } - @available(macOS 10.15, *) func testAsyncAwait_task() async throws { let dbQueue = try makeDatabaseQueue() try await dbQueue.write { db in diff --git a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift index 4021373d54..e803c37335 100644 --- a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift @@ -357,10 +357,6 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { } func testExistsIdentifiable() throws { - guard #available(macOS 10.15, *) else { - throw XCTSkip("Identifiable is not available") - } - let dbQueue = try makeDatabaseQueue() try dbQueue.inTransaction { db in struct Player: TableRecord, Identifiable { diff --git a/Tests/GRDBTests/TableRecordDeleteTests.swift b/Tests/GRDBTests/TableRecordDeleteTests.swift index 7dedbab24a..50dfb561fd 100644 --- a/Tests/GRDBTests/TableRecordDeleteTests.swift +++ b/Tests/GRDBTests/TableRecordDeleteTests.swift @@ -6,7 +6,6 @@ private struct Hacker : TableRecord { var id: Int64? // Optional } -@available(macOS 10.15, *) extension Hacker: Identifiable { } private struct Person : Codable, PersistableRecord, FetchableRecord, Hashable { @@ -16,7 +15,6 @@ private struct Person : Codable, PersistableRecord, FetchableRecord, Hashable { var email: String } -@available(macOS 10.15, *) extension Person: Identifiable { } private struct Citizenship : TableRecord { @@ -46,23 +44,23 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertTrue(deleted) XCTAssertEqual(try Hacker.fetchCount(db), 0) - if #available(macOS 10.15, *) { + 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) + XCTAssertTrue(deleted) + XCTAssertEqual(try Hacker.fetchCount(db), 0) + + do { 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) - XCTAssertTrue(deleted) - XCTAssertEqual(try Hacker.fetchCount(db), 0) + 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, keys: [2, 3, 4]) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"hackers\" WHERE \"rowid\" IN (2, 3, 4)") + XCTAssertEqual(deletedCount, 2) + XCTAssertEqual(try Hacker.fetchCount(db), 1) } - try db.execute(sql: "INSERT INTO hackers (rowid, name) VALUES (?, ?)", arguments: [1, "Arthur"]) - 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, keys: [2, 3, 4]) - XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"hackers\" WHERE \"rowid\" IN (2, 3, 4)") - XCTAssertEqual(deletedCount, 2) - XCTAssertEqual(try Hacker.fetchCount(db), 1) - - if #available(macOS 10.15, *) { + do { 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,22 +83,22 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertTrue(deleted) XCTAssertEqual(try Person.fetchCount(db), 0) - if #available(macOS 10.15, *) { + 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) + XCTAssertEqual(try Person.fetchCount(db), 0) + + do { 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) - XCTAssertEqual(try Person.fetchCount(db), 0) + 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, keys: [2, 3, 4]) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (2, 3, 4)") + XCTAssertEqual(deletedCount, 2) + XCTAssertEqual(try Person.fetchCount(db), 1) } - try db.execute(sql: "INSERT INTO persons (id, name, email) VALUES (?, ?, ?)", arguments: [1, "Arthur", "arthur@example.com"]) - 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, keys: [2, 3, 4]) - XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (2, 3, 4)") - XCTAssertEqual(deletedCount, 2) - XCTAssertEqual(try Person.fetchCount(db), 1) - - if #available(macOS 10.15, *) { + do { 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]) @@ -189,15 +187,13 @@ class TableRecordDeleteTests: GRDBTestCase { try Person.filter(keys: [1, 2]).deleteAll(db) XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2)") - - if #available(macOS 10.15, *) { - try Person.filter(id: 1).deleteAll(db) - XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1") - - try Person.filter(ids: [1, 2]).deleteAll(db) - XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2)") - } - + + try Person.filter(id: 1).deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1") + + try Person.filter(ids: [1, 2]).deleteAll(db) + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2)") + try Person.filter(sql: "id = 1").deleteAll(db) XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE id = 1") @@ -279,13 +275,11 @@ class TableRecordDeleteTests: GRDBTestCase { XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2) RETURNING *") #if GRDBCUSTOMSQLITE || GRDBCIPHER - if #available(macOS 10.15, *) { - _ = try Person.filter(id: 1).deleteAndFetchCursor(db).next() - XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *") - - _ = try Person.filter(ids: [1, 2]).deleteAndFetchCursor(db).next() - XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2) RETURNING *") - } + _ = try Person.filter(id: 1).deleteAndFetchCursor(db).next() + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *") + + _ = try Person.filter(ids: [1, 2]).deleteAndFetchCursor(db).next() + XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2) RETURNING *") #else _ = try Person.filter(id: 1).deleteAndFetchCursor(db).next() XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *") @@ -364,7 +358,6 @@ class TableRecordDeleteTests: GRDBTestCase { } } - @available(macOS 10.15, *) // Identifiable func testRequestDeleteAndFetchIds() throws { #if GRDBCUSTOMSQLITE || GRDBCIPHER guard sqlite3_libversion_number() >= 3035000 else { diff --git a/Tests/GRDBTests/TableRecordUpdateTests.swift b/Tests/GRDBTests/TableRecordUpdateTests.swift index 787c1fb47f..44982695a0 100644 --- a/Tests/GRDBTests/TableRecordUpdateTests.swift +++ b/Tests/GRDBTests/TableRecordUpdateTests.swift @@ -17,7 +17,6 @@ private struct Player: Codable, PersistableRecord, FetchableRecord, Hashable { } } -@available(macOS 10.15, *) extension Player: Identifiable { } private enum Columns: String, ColumnExpression { @@ -56,18 +55,16 @@ class TableRecordUpdateTests: GRDBTestCase { UPDATE "player" SET "score" = 0 WHERE "id" IN (1, 2) """) - if #available(macOS 10.15, *) { - try Player.filter(id: 1).updateAll(db, assignment) - XCTAssertEqual(self.lastSQLQuery, """ + try Player.filter(id: 1).updateAll(db, assignment) + XCTAssertEqual(self.lastSQLQuery, """ UPDATE "player" SET "score" = 0 WHERE "id" = 1 """) - - try Player.filter(ids: [1, 2]).updateAll(db, assignment) - XCTAssertEqual(self.lastSQLQuery, """ + + try Player.filter(ids: [1, 2]).updateAll(db, assignment) + XCTAssertEqual(self.lastSQLQuery, """ UPDATE "player" SET "score" = 0 WHERE "id" IN (1, 2) """) - } - + try Player.filter(sql: "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 34f732b5f7..780fab6eed 100644 --- a/Tests/GRDBTests/TableTests.swift +++ b/Tests/GRDBTests/TableTests.swift @@ -117,7 +117,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, *) { + do { struct Player: Identifiable { var id: Int64 } let t = Table("player") @@ -129,7 +129,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, *) { + do { struct Player: Identifiable { var id: Int64? } let t = Table("player") @@ -806,7 +806,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, *) { + do { // Non-optional ID struct Country: Identifiable { var id: String } @@ -821,7 +821,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, *) { + do { // Optional ID struct Country: Identifiable { var id: String? } @@ -920,7 +920,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, *) { + do { // Non-optional ID struct Country: Identifiable { var id: String } @@ -930,7 +930,7 @@ class TableTests: GRDBTestCase { """) } - if #available(macOS 10.15, *) { + do { // Optional ID struct Country: Identifiable { var id: String? } diff --git a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift index 0e3ae4432f..390df4af0a 100644 --- a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift +++ b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift @@ -105,7 +105,6 @@ class ValueObservationRegionRecordingTests: GRDBTestCase { } } - @available(macOS 10.15, *) func testTupleObservation() throws { // Here we just test that user can destructure an observed tuple. // I'm completely paranoid about tuple destructuring - I can't wrap my @@ -120,7 +119,6 @@ class ValueObservationRegionRecordingTests: GRDBTestCase { onChange: { (int: Int, string: String) in }) // <- destructure } - @available(macOS 10.15, *) func testVaryingRegionTrackingImmediateScheduling() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index c72b90c5ea..ba59108d1e 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -5,7 +5,6 @@ import Dispatch class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(macOS 10.15, *) func testStartFromAnyDatabaseReader(reader: any DatabaseReader) { _ = ValueObservation .trackingConstantRegion { _ in } @@ -14,7 +13,6 @@ class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(macOS 10.15, *) func testStartFromAnyDatabaseWriter(writer: any DatabaseWriter) { _ = ValueObservation .trackingConstantRegion { _ in } @@ -23,7 +21,6 @@ class ValueObservationTests: GRDBTestCase { // Test passes if it compiles. // See - @available(macOS 10.15, *) func testValuesFromAnyDatabaseWriter(writer: any DatabaseWriter) { func observe( fetch: @escaping @Sendable (Database) throws -> T @@ -55,7 +52,6 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, *) func testErrorCompletesTheObservation() throws { struct TestError: Error { } @@ -105,7 +101,6 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, *) func testViewOptimization() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { @@ -143,7 +138,6 @@ class ValueObservationTests: GRDBTestCase { } } - @available(macOS 10.15, *) func testPragmaTableOptimization() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { @@ -179,7 +173,6 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Constant Explicit Region - @available(macOS 10.15, *) func testTrackingExplicitRegion() throws { class TestStream: TextOutputStream { private var stringsMutex: Mutex<[String]> = Mutex([]) @@ -620,7 +613,6 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Cancellation - @available(macOS 10.15, *) func testCancellableLifetime() throws { // We need something to change let dbQueue = try makeDatabaseQueue() @@ -666,7 +658,6 @@ class ValueObservationTests: GRDBTestCase { XCTAssertEqual(changesCountMutex.load(), 2) } - @available(macOS 10.15, *) func testCancellableExplicitCancellation() throws { // We need something to change let dbQueue = try makeDatabaseQueue() @@ -804,7 +795,6 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, *) func testIssue1550() throws { func test(_ writer: some DatabaseWriter) throws { try writer.write { try $0.execute(sql: "CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") } @@ -852,7 +842,6 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } - @available(macOS 10.15, *) func testIssue1209() throws { func test(_ dbWriter: some DatabaseWriter) throws { try dbWriter.write { @@ -903,7 +892,6 @@ class ValueObservationTests: GRDBTestCase { } // MARK: - Main Actor - @available(macOS 10.15, *) @MainActor func test_mainActor_observation() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.write { db in @@ -939,7 +927,6 @@ class ValueObservationTests: GRDBTestCase { // MARK: - Async Await - @available(macOS 10.15, *) func testAsyncAwait_values_prefix() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -977,7 +964,6 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(macOS 10.15, *) func testAsyncAwait_values_break() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -1019,7 +1005,6 @@ class ValueObservationTests: GRDBTestCase { try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } - @available(macOS 10.15, *) func testAsyncAwait_values_cancelled() async throws { func test(_ writer: some DatabaseWriter) async throws { // We need something to change @@ -1201,7 +1186,6 @@ class ValueObservationTests: GRDBTestCase { } // Regression test for - @available(macOS 10.15, *) func testIssue1362() throws { func test(_ writer: some DatabaseWriter) throws { try writer.write { try $0.execute(sql: "CREATE TABLE s(id INTEGER PRIMARY KEY AUTOINCREMENT)") } @@ -1292,7 +1276,6 @@ class ValueObservationTests: GRDBTestCase { } // Regression test for - @available(macOS 10.15, *) func testIssue1383_async() throws { do { let dbPool = try makeDatabasePool(filename: "test") diff --git a/Tests/Performance/GRDBProfiling/GRDBProfiling.xcodeproj/project.pbxproj b/Tests/Performance/GRDBProfiling/GRDBProfiling.xcodeproj/project.pbxproj index 2851c7774d..73c21f9549 100644 --- a/Tests/Performance/GRDBProfiling/GRDBProfiling.xcodeproj/project.pbxproj +++ b/Tests/Performance/GRDBProfiling/GRDBProfiling.xcodeproj/project.pbxproj @@ -364,7 +364,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -416,7 +416,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_VERSION = 5.0; diff --git a/Tests/SPM/PlainPackage/Package.swift b/Tests/SPM/PlainPackage/Package.swift index 578a011bc3..6b69969994 100644 --- a/Tests/SPM/PlainPackage/Package.swift +++ b/Tests/SPM/PlainPackage/Package.swift @@ -5,6 +5,12 @@ import PackageDescription let package = Package( name: "SPM", + platforms: [ + .iOS(.v13), + .macOS(.v10_15), + .tvOS(.v13), + .watchOS(.v7), + ], dependencies: [ .package(name: "GRDB", path: "../../.."), ], diff --git a/Tests/SPM/PlainProject/Plain.xcodeproj/project.pbxproj b/Tests/SPM/PlainProject/Plain.xcodeproj/project.pbxproj index 00bcf692ef..46a8734ad3 100644 --- a/Tests/SPM/PlainProject/Plain.xcodeproj/project.pbxproj +++ b/Tests/SPM/PlainProject/Plain.xcodeproj/project.pbxproj @@ -187,7 +187,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -241,7 +241,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx;