Merge pull request #1320 from baekteun/refactor/availabilityMacOS

UPDATE :: OSX -> macOS in Availability Check
This commit is contained in:
Gwendal Roué authored and GitHub committed 2023-01-22 12:16:20 +01:00
commit c64e9f947b
51 files changed
+174 -174

No files matched your search

+1 -1
View File
@@ -510,7 +510,7 @@ struct StatementCache {
let statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
#else
let statement: Statement
if #available(iOS 12.0, OSX 10.14, watchOS 5.0, *) {
if #available(iOS 12.0, macOS 10.14, watchOS 5.0, *) {
statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
} else {
statement = try db.makeStatement(sql: sql)
+1 -1
View File
@@ -1,5 +1,5 @@
#if canImport(Combine)
/// A namespace for database Combine publishers.
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public enum DatabasePublishers { }
#endif
+3 -3
View File
@@ -532,7 +532,7 @@ extension DatabaseReader {
///
/// - parameter scheduler: A Combine Scheduler.
/// - parameter value: A closure which accesses the database.
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func readPublisher<Output>(
receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main,
value: @escaping (Database) throws -> Output)
@@ -550,7 +550,7 @@ extension DatabaseReader {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension DatabasePublishers {
/// A publisher that reads from the database.
///
@@ -569,7 +569,7 @@ extension DatabasePublishers {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Publisher where Failure == Error {
fileprivate func eraseToReadPublisher() -> DatabasePublishers.Read<Output> {
.init(upstream: eraseToAnyPublisher())
+3 -3
View File
@@ -231,7 +231,7 @@ extension DatabaseRegionObservation {
}
#if canImport(Combine)
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension DatabaseRegionObservation {
// MARK: - Publishing Impactful Transactions
@@ -243,7 +243,7 @@ extension DatabaseRegionObservation {
///
/// Do not reschedule the publisher with `receive(on:options:)` or any
/// `Publisher` method that schedules publisher elements.
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func publisher(in writer: some DatabaseWriter) -> DatabasePublishers.DatabaseRegion {
DatabasePublishers.DatabaseRegion(self, in: writer)
}
@@ -284,7 +284,7 @@ private class DatabaseRegionObserver: TransactionObserver {
}
#if canImport(Combine)
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension DatabasePublishers {
/// A publisher that tracks transactions that modify a database region.
///
+5 -5
View File
@@ -516,7 +516,7 @@ extension DatabaseWriter {
///
/// - Parameter filePath: file path for new database
@_disfavoredOverload // SR-15150 Async overloading in protocol implementation fails
@available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *)
@available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *)
public func vacuum(into filePath: String) throws {
try writeWithoutTransaction {
try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath])
@@ -775,7 +775,7 @@ extension DatabaseWriter {
///
/// - parameter scheduler: A Combine Scheduler.
/// - parameter updates: A closure which accesses the database.
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func writePublisher<Output>(
receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main,
updates: @escaping (Database) throws -> Output)
@@ -840,7 +840,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(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func writePublisher<S, T, Output>(
receiveOn scheduler: S = DispatchQueue.main,
updates: @escaping (Database) throws -> T,
@@ -872,7 +872,7 @@ extension DatabaseWriter {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension DatabasePublishers {
/// A publisher that writes into the database.
///
@@ -891,7 +891,7 @@ extension DatabasePublishers {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Publisher where Failure == Error {
fileprivate func eraseToWritePublisher() -> DatabasePublishers.Write<Output> {
.init(upstream: self.eraseToAnyPublisher())
+1 -1
View File
@@ -175,7 +175,7 @@ public final class Statement {
database.sqliteConnection, statementStart, -1, prepFlags,
&sqliteStatement, statementEnd)
#else
if #available(iOS 12.0, OSX 10.14, tvOS 12.0, watchOS 5.0, *) {
if #available(iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0, *) {
code = sqlite3_prepare_v3(
database.sqliteConnection, statementStart, -1, prepFlags,
&sqliteStatement, statementEnd)
+1 -1
View File
@@ -1125,7 +1125,7 @@ public protocol TransactionObserver: AnyObject {
///
/// Requires SQLite compiled with option SQLITE_ENABLE_PREUPDATE_HOOK.
///
/// As of OSX 10.11.5, and iOS 9.3.2, the built-in SQLite library
/// As of macOS 10.11.5, and iOS 9.3.2, the built-in SQLite library
/// does not have this enabled, so you'll need to compile your own
/// version of SQLite:
/// See <https://github.com/groue/GRDB.swift/blob/master/Documentation/CustomSQLiteBuilds.md>
+1 -1
View File
@@ -42,7 +42,7 @@ public struct FTS3 {
/// Remove diacritics from Latin script characters.
///
/// This option matches the `remove_diacritics=2` tokenizer argument.
@available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) // SQLite 3.27+
@available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) // SQLite 3.27+
case remove
#endif
}
+2 -2
View File
@@ -30,7 +30,7 @@ public struct FTS5: VirtualTableModule {
/// Remove diacritics from Latin script characters. This
/// option matches the raw "remove_diacritics=2" tokenizer argument,
/// available from SQLite 3.27.0
@available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *)
@available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *)
case remove
#endif
}
@@ -220,7 +220,7 @@ public struct FTS5: VirtualTableModule {
// GRDB is linked against the system SQLite.
//
// Do we use SQLite 3.19.3 (iOS 11.4), or SQLite 3.24.0 (iOS 12.0)?
if #available(iOS 12.0, OSX 10.14, tvOS 12.0, watchOS 5.0, *) {
if #available(iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0, *) {
// SQLite 3.24.0 or more
return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer)
} else {
+3 -3
View File
@@ -119,7 +119,7 @@ extension PersistableRecord {
public func performSave(_ db: Database) throws { preconditionFailure() }
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
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<RowDecoder.ID> { preconditionFailure() }
@@ -144,13 +144,13 @@ extension SelectionRequest {
@available(*, unavailable, renamed: "SQLExpression.AssociativeBinaryOperator")
public typealias SQLAssociativeBinaryOperator = SQLExpression.AssociativeBinaryOperator
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
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<RowDecoder.ID> { preconditionFailure() }
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
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<ID> { preconditionFailure() }
+2 -2
View File
@@ -490,7 +490,7 @@ extension DatabaseMigrator {
/// - parameter writer: A DatabaseWriter.
/// where migrations should apply.
/// - parameter scheduler: A Combine Scheduler.
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func migratePublisher(
_ writer: some DatabaseWriter,
receiveOn scheduler: some Scheduler = DispatchQueue.main)
@@ -508,7 +508,7 @@ extension DatabaseMigrator {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension DatabasePublishers {
/// A publisher that migrates a database.
///
@@ -570,7 +570,7 @@ extension TableRequest where Self: FilteredRequest, Self: TypedRequest {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension TableRequest
where Self: FilteredRequest,
Self: TypedRequest,
+2 -2
View File
@@ -1893,13 +1893,13 @@ extension SQLSpecificExpressible {
}
#elseif !GRDBCIPHER
/// An ordering term for ascending order (nulls last).
@available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *)
@available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *)
public var ascNullsLast: SQLOrdering {
.ascNullsLast(sqlExpression)
}
/// An ordering term for descending order (nulls first).
@available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *)
@available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *)
public var descNullsFirst: SQLOrdering {
.descNullsFirst(sqlExpression)
}
+3 -3
View File
@@ -723,7 +723,7 @@ extension Table {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible {
/// Returns a request filtered by primary key.
///
@@ -1546,7 +1546,7 @@ extension Table {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension Table
where RowDecoder: Identifiable,
RowDecoder.ID: DatabaseValueConvertible
@@ -1688,7 +1688,7 @@ extension Table {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension Table
where RowDecoder: Identifiable,
RowDecoder.ID: DatabaseValueConvertible
@@ -605,7 +605,7 @@ extension TableRecord {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
/// Returns a request filtered by primary key.
///
@@ -217,7 +217,7 @@ extension FetchableRecord where Self: TableRecord {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension FetchableRecord where Self: TableRecord & Identifiable, ID: DatabaseValueConvertible {
// MARK: Fetching by Single-Column Primary Key
@@ -359,7 +359,7 @@ extension FetchableRecord where Self: TableRecord & Hashable {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension FetchableRecord where Self: TableRecord & Hashable & Identifiable, ID: DatabaseValueConvertible {
/// Returns a set of records identified by their primary keys.
///
+3 -3
View File
@@ -309,7 +309,7 @@ extension TableRecord {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
/// Returns whether a record exists for this primary key.
///
@@ -445,7 +445,7 @@ extension TableRecord {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
/// Deletes records identified by their primary keys, and returns the number
/// of deleted records.
@@ -706,7 +706,7 @@ extension TableRecord {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
/// Returns an error for a record that does not exist in the database.
///
+2 -2
View File
@@ -14,7 +14,7 @@ import Foundation
/// Both two extra scheduling guarantees are used by GRDB in order to be
/// able to spawn concurrent database reads right from the database writer
/// queue, and fulfill GRDB preconditions.
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
struct OnDemandFuture<Output, Failure: Error>: Publisher {
typealias Promise = (Result<Output, Failure>) -> Void
typealias Output = Output
@@ -33,7 +33,7 @@ struct OnDemandFuture<Output, Failure: Error>: Publisher {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
private class OnDemandFutureSubscription<Downstream: Subscriber>: Subscription {
typealias Promise = (Result<Downstream.Input, Downstream.Failure>) -> Void
+3 -3
View File
@@ -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 <https://forums.swift.org/t/28631>.
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
struct ReceiveValuesOn<Upstream: Publisher, Context: Scheduler>: Publisher {
typealias Output = Upstream.Output
typealias Failure = Upstream.Failure
@@ -30,7 +30,7 @@ struct ReceiveValuesOn<Upstream: Publisher, Context: Scheduler>: Publisher {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
private class ReceiveValuesOnSubscription<Upstream, Context, Downstream>: Subscription, Subscriber
where
Upstream: Publisher,
@@ -211,7 +211,7 @@ where
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Publisher {
/// Specifies the scheduler on which to receive values from the publisher
///
@@ -291,7 +291,7 @@ public final class SharedValueObservation<Element> {
/// print("fresh players: \(players)")
/// }
/// ```
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func publisher() -> DatabasePublishers.Value<Element> {
DatabasePublishers.Value { onError, onChange in
self.start(onError: onError, onChange: onChange)
+2 -2
View File
@@ -771,7 +771,7 @@ extension ValueObservation {
/// - parameter scheduler: A ValueObservationScheduler. By default, fresh
/// values are dispatched asynchronously on the main dispatch queue.
/// - returns: A Combine publisher
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func publisher(
in reader: some DatabaseReader,
scheduling scheduler: some ValueObservationScheduler = .async(onQueue: .main))
@@ -788,7 +788,7 @@ extension ValueObservation {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension DatabasePublishers {
/// A publisher that publishes the values of a ``ValueObservation``.
///
@@ -1,7 +1,7 @@
#if canImport(Combine)
import XCTest
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation which waits for the timeout to expire, or
/// the recorded publisher to complete.
@@ -17,7 +17,7 @@ import XCTest
// try wait(for: recorder.finished.inverted, timeout: 1)
// }
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation which waits for the recorded publisher
/// to complete.
@@ -1,7 +1,7 @@
#if canImport(Combine)
import XCTest
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation that fails if the base expectation is fulfilled.
///
@@ -1,7 +1,7 @@
#if canImport(Combine)
import XCTest
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation that transforms the value of a base expectation.
///
@@ -20,7 +20,7 @@ extension PublisherExpectations {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectation {
/// Returns a publisher expectation that transforms the value of the
/// base expectation.
@@ -1,7 +1,7 @@
#if canImport(Combine)
import XCTest
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation which waits for the recorded publisher to emit
/// `count` elements, or to complete.
@@ -1,7 +1,7 @@
#if canImport(Combine)
import XCTest
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation which waits for the recorded publisher to emit
/// one element, or to complete.
@@ -1,7 +1,7 @@
#if canImport(Combine)
import XCTest
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation which waits for the recorded publisher to emit
/// `maxLength` elements, or to complete.
@@ -2,7 +2,7 @@
import Combine
import XCTest
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// A publisher expectation which waits for the recorded publisher
/// to complete.
+4 -4
View File
@@ -13,7 +13,7 @@ import XCTest
///
/// let elements = try wait(for: recorder.elements, timeout: 1)
/// XCTAssertEqual(elements, ["foo", "bar", "baz"])
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public class Recorder<Input, Failure: Error>: Subscriber {
public typealias Input = Input
public typealias Failure = Failure
@@ -275,7 +275,7 @@ public class Recorder<Input, Failure: Error>: Subscriber {
// MARK: - Publisher Expectations
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension PublisherExpectations {
/// The type of the publisher expectation returned by `Recorder.completion`.
public typealias Completion<Input, Failure: Error> = Map<Recording<Input, Failure>, Subscribers.Completion<Failure>>
@@ -290,7 +290,7 @@ extension PublisherExpectations {
public typealias Single<Input, Failure: Error> = Map<Elements<Input, Failure>, Input>
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Recorder {
/// Returns a publisher expectation which waits for the timeout to expire,
/// or the recorded publisher to complete.
@@ -572,7 +572,7 @@ extension Recorder {
// MARK: - Publisher + Recorder
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Publisher {
/// Returns a subscribed Recorder.
///
@@ -22,7 +22,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
// MARK: -
func testReadPublisher() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) 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(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -157,7 +157,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
// MARK: -
func testReadPublisherIsAsynchronous() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -197,7 +197,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
// MARK: -
func testReadPublisherDefaultScheduler() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -237,7 +237,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
// MARK: -
func testReadPublisherCustomScheduler() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -278,7 +278,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
// MARK: -
func testReadPublisherIsReadonly() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -20,7 +20,7 @@ private struct Player: Codable, FetchableRecord, PersistableRecord {
class DatabaseRegionObservationPublisherTests : XCTestCase {
func testChangesNotifications() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) 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(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -22,7 +22,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWritePublisher() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -49,7 +49,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWritePublisherValue() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -76,7 +76,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWritePublisherError() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -99,7 +99,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
}
func testWritePublisherErrorRollbacksTransaction() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -132,7 +132,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWritePublisherIsAsynchronous() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -168,7 +168,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWritePublisherDefaultScheduler() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -206,7 +206,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWritePublisherCustomScheduler() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) 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(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -274,7 +274,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWriteThenReadPublisherIsReadonly() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -299,7 +299,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
// MARK: -
func testWriteThenReadPublisherWriteError() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -322,7 +322,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
}
func testWriteThenReadPublisherWriteErrorRollbacksTransaction() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) 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(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) 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(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
+2 -2
View File
@@ -100,7 +100,7 @@ final class AsyncTest<Context> {
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func assertNoFailure<Failure>(
_ completion: Subscribers.Completion<Failure>,
file: StaticString = #file,
@@ -111,7 +111,7 @@ public func assertNoFailure<Failure>(
}
}
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func assertFailure<Failure, ExpectedFailure>(
_ completion: Subscribers.Completion<Failure>,
file: StaticString = #file,
@@ -22,7 +22,7 @@ class ValueObservationPublisherTests : XCTestCase {
// MARK: - Default Scheduler
func testDefaultSchedulerChangesNotifications() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -64,7 +64,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testDefaultSchedulerFirstValueIsEmittedAsynchronously() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -97,7 +97,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testDefaultSchedulerError() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -123,7 +123,7 @@ class ValueObservationPublisherTests : XCTestCase {
// MARK: - Immediate Scheduler
func testImmediateSchedulerChangesNotifications() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -165,7 +165,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testImmediateSchedulerEmitsFirstValueSynchronously() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -201,7 +201,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testImmediateSchedulerError() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -226,7 +226,7 @@ class ValueObservationPublisherTests : XCTestCase {
// MARK: - Demand
@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
private class DemandSubscriber<Input, Failure: Error>: Subscriber {
private var subscription: Subscription?
let subject = PassthroughSubject<Input, Failure>()
@@ -257,7 +257,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testDemandNoneReceivesNoElement() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -292,7 +292,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testDemandOneReceivesOneElement() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -330,7 +330,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testDemandOneDoesNotReceiveTwoElements() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -372,7 +372,7 @@ class ValueObservationPublisherTests : XCTestCase {
}
func testDemandTwoReceivesTwoElements() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) 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(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -50,7 +50,7 @@ private struct RecordWithDate<Strategy: StrategyProvider>: EncodableRecord, Enco
var date: Date
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension RecordWithDate: Identifiable {
var id: Date { date }
}
@@ -60,7 +60,7 @@ private struct RecordWithOptionalDate<Strategy: StrategyProvider>: EncodableReco
var date: Date?
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension RecordWithOptionalDate: Identifiable {
var id: Date? { date }
}
@@ -255,7 +255,7 @@ extension DatabaseDateEncodingStrategyTests {
}
func testFilterID() throws {
guard #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
throw XCTSkip("Identifiable not available")
}
@@ -335,7 +335,7 @@ extension DatabaseDateEncodingStrategyTests {
}
func testDeleteID() throws {
guard #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
throw XCTSkip("Identifiable not available")
}
+6 -6
View File
@@ -35,7 +35,7 @@ class DatabaseMigratorTests : GRDBTestCase {
}
func testEmptyMigratorPublisher() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -147,7 +147,7 @@ class DatabaseMigratorTests : GRDBTestCase {
}
func testNonEmptyMigratorPublisher() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -203,7 +203,7 @@ class DatabaseMigratorTests : GRDBTestCase {
}
func testEmptyMigratorPublisherIsAsynchronous() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -229,7 +229,7 @@ class DatabaseMigratorTests : GRDBTestCase {
}
func testNonEmptyMigratorPublisherIsAsynchronous() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -256,7 +256,7 @@ class DatabaseMigratorTests : GRDBTestCase {
}
func testMigratorPublisherDefaultScheduler() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -285,7 +285,7 @@ class DatabaseMigratorTests : GRDBTestCase {
}
func testMigratorPublisherCustomScheduler() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -23,7 +23,7 @@ private struct RecordWithUUID<Strategy: StrategyProvider>: EncodableRecord, Enco
var uuid: UUID
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension RecordWithUUID: Identifiable {
var id: UUID { uuid }
}
@@ -33,7 +33,7 @@ private struct RecordWithOptionalUUID<Strategy: StrategyProvider>: EncodableReco
var uuid: UUID?
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension RecordWithOptionalUUID: Identifiable {
var id: UUID? { uuid }
}
@@ -180,7 +180,7 @@ extension DatabaseUUIDEncodingStrategyTests {
}
func testFilterID() throws {
guard #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
throw XCTSkip("Identifiable not available")
}
@@ -299,7 +299,7 @@ extension DatabaseUUIDEncodingStrategyTests {
}
func testDeleteID() throws {
guard #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
throw XCTSkip("Identifiable not available")
}
+1 -1
View File
@@ -195,7 +195,7 @@ class DatabaseWriterTests : GRDBTestCase {
}
func testVacuumInto() throws {
guard #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) else {
guard #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) else {
throw XCTSkip("VACUUM INTO is not available")
}
// Prevent SQLCipher failures
+1 -1
View File
@@ -76,7 +76,7 @@ class FTS3TableBuilderTests: GRDBTestCase {
}
#elseif !GRDBCIPHER
func testUnicode61TokenizerDiacriticsRemove() throws {
guard #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) else {
guard #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) else {
throw XCTSkip()
}
let dbQueue = try makeDatabaseQueue()
+1 -1
View File
@@ -130,7 +130,7 @@ class FTS5TableBuilderTests: GRDBTestCase {
}
#elseif !GRDBCIPHER
func testUnicode61TokenizerDiacriticsRemove() throws {
guard #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) else {
guard #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) else {
throw XCTSkip()
}
@@ -764,7 +764,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
sql(dbQueue, tableRequest.order(Col.age.descNullsFirst)),
"SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST")
#elseif !GRDBCIPHER
if #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) {
if #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) {
XCTAssertEqual(
sql(dbQueue, tableRequest.order(Col.age.ascNullsLast)),
"SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST")
@@ -794,7 +794,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).descNullsFirst)),
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE DESC NULLS FIRST")
#elseif !GRDBCIPHER
if #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) {
if #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) {
XCTAssertEqual(
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).ascNullsLast)),
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE ASC NULLS LAST")
@@ -843,7 +843,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
sql(dbQueue, tableRequest.order(Col.age.ascNullsLast).reversed()),
"SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST")
#elseif !GRDBCIPHER
if #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) {
if #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) {
XCTAssertEqual(
sql(dbQueue, tableRequest.order(Col.age.descNullsFirst).reversed()),
"SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST")
@@ -873,7 +873,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).descNullsFirst).reversed()),
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE ASC NULLS LAST")
#elseif !GRDBCIPHER
if #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) {
if #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) {
XCTAssertEqual(
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).ascNullsLast).reversed()),
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE DESC NULLS FIRST")
@@ -41,7 +41,7 @@ private class MinimalNonOptionalPrimaryKeySingle: Record, Hashable {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension MinimalNonOptionalPrimaryKeySingle: Identifiable { }
class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
@@ -460,7 +460,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [String] = []
let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids)
@@ -499,7 +499,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [String] = []
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids)
@@ -537,7 +537,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [String] = []
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids)
@@ -572,7 +572,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.fetchOne(db, id: record.id)!
XCTAssertTrue(fetchedRecord.id == record.id)
@@ -600,7 +600,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
_ = try MinimalNonOptionalPrimaryKeySingle.find(db, key: "missing")
XCTFail("Expected RecordError")
@@ -640,7 +640,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [String] = []
let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db)
@@ -679,7 +679,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [String] = []
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db)
@@ -717,7 +717,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [String] = []
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db)
@@ -752,7 +752,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.filter(id: record.id).fetchOne(db)!
XCTAssertTrue(fetchedRecord.id == record.id)
@@ -45,7 +45,7 @@ class MinimalRowID : Record, Hashable {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension MinimalRowID: Identifiable { }
class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
@@ -494,7 +494,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let cursor = try MinimalRowID.fetchCursor(db, ids: ids)
@@ -533,7 +533,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids)
@@ -571,7 +571,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids)
@@ -606,7 +606,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try MinimalRowID.fetchOne(db, id: record.id!)!
XCTAssertTrue(fetchedRecord.id == record.id)
@@ -637,7 +637,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
_ = try MinimalRowID.find(db, id: -1)
XCTFail("Expected RecordError")
@@ -680,7 +680,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db)
@@ -719,7 +719,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db)
@@ -757,7 +757,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db)
@@ -792,7 +792,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try MinimalRowID.filter(id: record.id!).fetchOne(db)!
XCTAssertTrue(fetchedRecord.id == record.id)
@@ -39,7 +39,7 @@ class MinimalSingle: Record, Hashable {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension MinimalSingle: Identifiable {
/// Test non-optional ID type
var id: String { UUID! }
@@ -518,7 +518,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let UUIDs: [String] = []
let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs)
@@ -559,7 +559,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let UUIDs: [String] = []
let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs)
@@ -599,7 +599,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let UUIDs: [String] = []
let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs)
@@ -635,7 +635,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try MinimalSingle.fetchOne(db, id: record.UUID!)!
XCTAssertTrue(fetchedRecord.UUID == record.UUID)
@@ -664,7 +664,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
_ = try MinimalSingle.find(db, id: "missing")
XCTFail("Expected RecordError")
@@ -706,7 +706,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let UUIDs: [String] = []
let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db)
@@ -747,7 +747,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let UUIDs: [String] = []
let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db)
@@ -787,7 +787,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let UUIDs: [String] = []
let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db)
@@ -823,7 +823,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try MinimalSingle.filter(id: record.UUID!).fetchOne(db)!
XCTAssertTrue(fetchedRecord.UUID == record.UUID)
@@ -77,7 +77,7 @@ private class Person : Record, Hashable {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension Person: Identifiable { }
class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
@@ -586,7 +586,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let cursor = try Person.fetchCursor(db, ids: ids)
@@ -625,7 +625,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try Person.fetchAll(db, ids: ids)
@@ -663,7 +663,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try Person.fetchSet(db, ids: ids)
@@ -701,7 +701,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try Person.fetchOne(db, id: record.id!)!
XCTAssertTrue(fetchedRecord.id == record.id)
@@ -738,7 +738,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
_ = try Person.find(db, id: -1)
XCTFail("Expected RecordError")
@@ -784,7 +784,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertTrue(try cursor.next() == nil) // end
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let cursor = try Person.filter(ids: ids).fetchCursor(db)
@@ -823,7 +823,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try Person.filter(ids: ids).fetchAll(db)
@@ -861,7 +861,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let ids: [Int64] = []
let fetchedRecords = try Person.filter(ids: ids).fetchSet(db)
@@ -899,7 +899,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
do {
let fetchedRecord = try Person.filter(id: record.id!).fetchOne(db)!
XCTAssertTrue(fetchedRecord.id == record.id)
@@ -104,7 +104,7 @@ class SharedValueObservationTests: GRDBTestCase {
#if canImport(Combine)
func test_immediate_publisher() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -381,7 +381,7 @@ class SharedValueObservationTests: GRDBTestCase {
#if canImport(Combine)
func test_async_publisher() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -511,7 +511,7 @@ class SharedValueObservationTests: GRDBTestCase {
#if canImport(Combine)
func test_error_recovery_observationLifetime() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -567,7 +567,7 @@ class SharedValueObservationTests: GRDBTestCase {
#if canImport(Combine)
func test_error_recovery_whileObserved() throws {
guard #available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) else {
throw XCTSkip("Combine is not available")
}
@@ -259,7 +259,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase {
sql(dbQueue, Reader.order(Col.age.descNullsFirst)),
"SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST")
#elseif !GRDBCIPHER
if #available(OSX 10.16, iOS 14, tvOS 14, watchOS 7, *) {
if #available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) {
XCTAssertEqual(
sql(dbQueue, Reader.order(Col.age.ascNullsLast)),
"SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST")
@@ -357,7 +357,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase {
}
func testExistsIdentifiable() throws {
guard #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
guard #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) else {
throw XCTSkip("Identifiable is not available")
}
+8 -8
View File
@@ -6,7 +6,7 @@ private struct Hacker : TableRecord {
var id: Int64? // Optional
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
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(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
extension Person: Identifiable { }
private struct Citizenship : TableRecord {
@@ -46,7 +46,7 @@ class TableRecordDeleteTests: GRDBTestCase {
XCTAssertTrue(deleted)
XCTAssertEqual(try Hacker.fetchCount(db), 0)
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
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(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
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(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
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(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
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(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
try Person.filter(id: 1).deleteAll(db)
XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1")
@@ -278,7 +278,7 @@ class TableRecordDeleteTests: GRDBTestCase {
_ = try Person.filter(keys: [1, 2]).deleteAndFetchCursor(db).next()
XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2) RETURNING *")
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
_ = try Person.filter(id: 1).deleteAndFetchCursor(db).next()
XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *")
+2 -2
View File
@@ -17,7 +17,7 @@ private struct Player: Codable, PersistableRecord, FetchableRecord, Hashable {
}
}
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *)
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(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
try Player.filter(id: 1).updateAll(db, assignment)
XCTAssertEqual(self.lastSQLQuery, """
UPDATE "player" SET "score" = 0 WHERE "id" = 1
+6 -6
View File
@@ -117,7 +117,7 @@ class TableTests: GRDBTestCase {
""")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
struct Player: Identifiable { var id: Int64 }
let t = Table<Player>("player")
@@ -129,7 +129,7 @@ class TableTests: GRDBTestCase {
""")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
struct Player: Identifiable { var id: Int64? }
let t = Table<Player>("player")
@@ -806,7 +806,7 @@ class TableTests: GRDBTestCase {
""")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
// Non-optional ID
struct Country: Identifiable { var id: String }
@@ -821,7 +821,7 @@ class TableTests: GRDBTestCase {
""")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
// Optional ID
struct Country: Identifiable { var id: String? }
@@ -920,7 +920,7 @@ class TableTests: GRDBTestCase {
""")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
// Non-optional ID
struct Country: Identifiable { var id: String }
@@ -930,7 +930,7 @@ class TableTests: GRDBTestCase {
""")
}
if #available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6, *) {
// Optional ID
struct Country: Identifiable { var id: String? }