mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
[BREAKING] Bump requirements: watchOS 7
Rationale: https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836
This commit is contained in:
1 parent
f6ce2e82f9
commit
5289f5d93d
65 files changed
+228
-228
No files matched your search
@@ -547,7 +547,7 @@ struct StatementCache {
|
||||
let statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
|
||||
#else
|
||||
let statement: Statement
|
||||
if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+
|
||||
if #available(macOS 10.14, *) { // SQLite 3.20+
|
||||
statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
|
||||
} else {
|
||||
statement = try db.makeStatement(sql: sql)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#if canImport(Combine)
|
||||
/// A namespace for database Combine publishers.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public enum DatabasePublishers { }
|
||||
#endif
|
||||
@@ -458,7 +458,7 @@ extension DatabaseReader {
|
||||
/// - parameter value: A closure which accesses the database.
|
||||
/// - throws: The error thrown by `value`, or any ``DatabaseError`` that
|
||||
/// would happen while establishing the database access.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func read<T>(_ value: @Sendable @escaping (Database) throws -> T) async throws -> T {
|
||||
try await withUnsafeThrowingContinuation { continuation in
|
||||
asyncRead { result in
|
||||
@@ -504,7 +504,7 @@ extension DatabaseReader {
|
||||
/// - parameter value: A closure which accesses the database.
|
||||
/// - throws: The error thrown by `value`, or any ``DatabaseError`` that
|
||||
/// would happen while establishing the database access.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func unsafeRead<T>(_ value: @Sendable @escaping (Database) throws -> T) async throws -> T {
|
||||
try await withUnsafeThrowingContinuation { continuation in
|
||||
asyncUnsafeRead { result in
|
||||
@@ -549,7 +549,7 @@ extension DatabaseReader {
|
||||
///
|
||||
/// - parameter scheduler: A Combine Scheduler.
|
||||
/// - parameter value: A closure which accesses the database.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func readPublisher<Output>(
|
||||
receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main,
|
||||
value: @escaping (Database) throws -> Output)
|
||||
@@ -567,7 +567,7 @@ extension DatabaseReader {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension DatabasePublishers {
|
||||
/// A publisher that reads from the database.
|
||||
///
|
||||
@@ -586,7 +586,7 @@ extension DatabasePublishers {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Publisher where Failure == Error {
|
||||
fileprivate func eraseToReadPublisher() -> DatabasePublishers.Read<Output> {
|
||||
.init(upstream: eraseToAnyPublisher())
|
||||
|
||||
@@ -128,7 +128,7 @@ extension DatabaseRegionObservation {
|
||||
}
|
||||
|
||||
#if canImport(Combine)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension DatabaseRegionObservation {
|
||||
// MARK: - Publishing Impactful Transactions
|
||||
|
||||
@@ -140,7 +140,7 @@ extension DatabaseRegionObservation {
|
||||
///
|
||||
/// Do not reschedule the publisher with `receive(on:options:)` or any
|
||||
/// `Publisher` method that schedules publisher elements.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func publisher(in writer: some DatabaseWriter) -> DatabasePublishers.DatabaseRegion {
|
||||
DatabasePublishers.DatabaseRegion(self, in: writer)
|
||||
}
|
||||
@@ -186,7 +186,7 @@ private class DatabaseRegionObserver: TransactionObserver {
|
||||
}
|
||||
|
||||
#if canImport(Combine)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension DatabasePublishers {
|
||||
/// A publisher that tracks transactions that modify a database region.
|
||||
///
|
||||
|
||||
@@ -541,7 +541,7 @@ extension DatabaseWriter {
|
||||
///
|
||||
/// - Parameter filePath: file path for new database
|
||||
@_disfavoredOverload // SR-15150 Async overloading in protocol implementation fails
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *)
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *)
|
||||
public func vacuum(into filePath: String) throws {
|
||||
try writeWithoutTransaction {
|
||||
try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath])
|
||||
@@ -607,7 +607,7 @@ extension DatabaseWriter {
|
||||
/// - throws: The error thrown by `updates`, or any ``DatabaseError`` that
|
||||
/// would happen while establishing the database access or committing
|
||||
/// the transaction.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func write<T>(_ updates: @Sendable @escaping (Database) throws -> T) async throws -> T {
|
||||
try await withUnsafeThrowingContinuation { continuation in
|
||||
asyncWrite(updates, completion: { _, result in
|
||||
@@ -645,7 +645,7 @@ extension DatabaseWriter {
|
||||
///
|
||||
/// - parameter updates: A closure which accesses the database.
|
||||
/// - throws: The error thrown by `updates`.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func writeWithoutTransaction<T>(_ updates: @Sendable @escaping (Database) throws -> T) async throws -> T {
|
||||
try await withUnsafeThrowingContinuation { continuation in
|
||||
asyncWriteWithoutTransaction { db in
|
||||
@@ -697,7 +697,7 @@ extension DatabaseWriter {
|
||||
///
|
||||
/// - parameter updates: A closure which accesses the database.
|
||||
/// - throws: The error thrown by `updates`.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func barrierWriteWithoutTransaction<T>(
|
||||
_ updates: @Sendable @escaping (Database) throws -> T)
|
||||
async throws -> T
|
||||
@@ -712,7 +712,7 @@ extension DatabaseWriter {
|
||||
/// Erase the database: delete all content, drop all tables, etc.
|
||||
///
|
||||
/// - note: [**🔥 EXPERIMENTAL**](https://github.com/groue/GRDB.swift/blob/master/README.md#what-are-experimental-features)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func erase() async throws {
|
||||
try await writeWithoutTransaction { try $0.erase() }
|
||||
}
|
||||
@@ -723,7 +723,7 @@ extension DatabaseWriter {
|
||||
/// - note: [**🔥 EXPERIMENTAL**](https://github.com/groue/GRDB.swift/blob/master/README.md#what-are-experimental-features)
|
||||
///
|
||||
/// Related SQLite documentation: <https://www.sqlite.org/lang_vacuum.html>
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func vacuum() async throws {
|
||||
try await writeWithoutTransaction { try $0.execute(sql: "VACUUM") }
|
||||
}
|
||||
@@ -740,7 +740,7 @@ extension DatabaseWriter {
|
||||
/// Related SQLite documentation: <https://www.sqlite.org/lang_vacuum.html#vacuuminto>
|
||||
///
|
||||
/// - Parameter filePath: file path for new database
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func vacuum(into filePath: String) async throws {
|
||||
try await writeWithoutTransaction {
|
||||
try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath])
|
||||
@@ -755,7 +755,7 @@ extension DatabaseWriter {
|
||||
/// Related SQLite documentation: <https://www.sqlite.org/lang_vacuum.html#vacuuminto>
|
||||
///
|
||||
/// - Parameter filePath: file path for new database
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func vacuum(into filePath: String) async throws {
|
||||
try await writeWithoutTransaction {
|
||||
try $0.execute(sql: "VACUUM INTO ?", arguments: [filePath])
|
||||
@@ -800,7 +800,7 @@ extension DatabaseWriter {
|
||||
///
|
||||
/// - parameter scheduler: A Combine Scheduler.
|
||||
/// - parameter updates: A closure which accesses the database.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func writePublisher<Output>(
|
||||
receiveOn scheduler: some Combine.Scheduler = DispatchQueue.main,
|
||||
updates: @escaping (Database) throws -> Output)
|
||||
@@ -865,7 +865,7 @@ extension DatabaseWriter {
|
||||
/// - parameter scheduler: A Combine Scheduler.
|
||||
/// - parameter updates: A closure which writes in the database.
|
||||
/// - parameter value: A closure which reads from the database.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func writePublisher<S, T, Output>(
|
||||
receiveOn scheduler: S = DispatchQueue.main,
|
||||
updates: @escaping (Database) throws -> T,
|
||||
@@ -897,7 +897,7 @@ extension DatabaseWriter {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension DatabasePublishers {
|
||||
/// A publisher that writes into the database.
|
||||
///
|
||||
@@ -916,7 +916,7 @@ extension DatabasePublishers {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Publisher where Failure == Error {
|
||||
fileprivate func eraseToWritePublisher() -> DatabasePublishers.Write<Output> {
|
||||
.init(upstream: self.eraseToAnyPublisher())
|
||||
|
||||
@@ -146,7 +146,7 @@ public final class Statement {
|
||||
database.sqliteConnection, statementStart, -1, prepFlags,
|
||||
&sqliteStatement, statementEnd)
|
||||
#else
|
||||
if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+
|
||||
if #available(macOS 10.14, *) { // SQLite 3.20+
|
||||
code = sqlite3_prepare_v3(
|
||||
database.sqliteConnection, statementStart, -1, prepFlags,
|
||||
&sqliteStatement, statementEnd)
|
||||
|
||||
@@ -52,7 +52,7 @@ public struct JSONDumpFormat: Sendable {
|
||||
public static var defaultEncoder: JSONEncoder {
|
||||
// This encoder MUST NOT CHANGE, because some people rely on this format.
|
||||
let encoder = JSONEncoder()
|
||||
if #available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) {
|
||||
if #available(iOS 13.0, macOS 10.15, tvOS 13.0, *) {
|
||||
encoder.outputFormatting = .withoutEscapingSlashes
|
||||
}
|
||||
encoder.nonConformingFloatEncodingStrategy = .convertToString(
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public struct FTS3 {
|
||||
#elseif !GRDBCIPHER
|
||||
/// Remove diacritics from Latin script characters. This option matches
|
||||
/// the `remove_diacritics=2` tokenizer argument.
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.27+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.27+
|
||||
case remove
|
||||
#endif
|
||||
}
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ public struct FTS5 {
|
||||
/// Remove diacritics from Latin script characters. This
|
||||
/// option matches the raw "remove_diacritics=2" tokenizer argument,
|
||||
/// available from SQLite 3.27.0
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.27+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.27+
|
||||
case remove
|
||||
#endif
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public struct FTS5 {
|
||||
return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer)
|
||||
#else
|
||||
// GRDB is linked against the system SQLite.
|
||||
if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+
|
||||
if #available(macOS 10.14, *) { // SQLite 3.20+
|
||||
return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer)
|
||||
} else {
|
||||
return api_v1(db)
|
||||
|
||||
+3
-3
@@ -119,7 +119,7 @@ extension PersistableRecord {
|
||||
public func performSave(_ db: Database) throws { preconditionFailure() }
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension QueryInterfaceRequest where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible {
|
||||
@available(*, unavailable, message: "selectID() has been removed. You may use selectPrimaryKey(as:) instead.")
|
||||
public func selectID() -> QueryInterfaceRequest<RowDecoder.ID> { preconditionFailure() }
|
||||
@@ -144,13 +144,13 @@ extension SelectionRequest {
|
||||
@available(*, unavailable, renamed: "SQLExpression.AssociativeBinaryOperator")
|
||||
public typealias SQLAssociativeBinaryOperator = SQLExpression.AssociativeBinaryOperator
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible {
|
||||
@available(*, unavailable, message: "selectID() has been removed. You may use selectPrimaryKey(as:) instead.")
|
||||
public func selectID() -> QueryInterfaceRequest<RowDecoder.ID> { preconditionFailure() }
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
|
||||
@available(*, unavailable, message: "selectID() has been removed. You may use selectPrimaryKey(as:) instead.")
|
||||
public static func selectID() -> QueryInterfaceRequest<ID> { preconditionFailure() }
|
||||
|
||||
@@ -496,7 +496,7 @@ extension DatabaseMigrator {
|
||||
/// - parameter writer: A DatabaseWriter.
|
||||
/// where migrations should apply.
|
||||
/// - parameter scheduler: A Combine Scheduler.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func migratePublisher(
|
||||
_ writer: some DatabaseWriter,
|
||||
receiveOn scheduler: some Scheduler = DispatchQueue.main)
|
||||
@@ -514,7 +514,7 @@ extension DatabaseMigrator {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension DatabasePublishers {
|
||||
/// A publisher that migrates a database.
|
||||
///
|
||||
|
||||
@@ -583,7 +583,7 @@ extension TableRequest where Self: FilteredRequest, Self: TypedRequest {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension TableRequest
|
||||
where Self: FilteredRequest,
|
||||
Self: TypedRequest,
|
||||
|
||||
@@ -1989,7 +1989,7 @@ struct SQLAggregateFunctionInvocation {
|
||||
var arguments: [SQLExpression]
|
||||
var isDistinct = false
|
||||
var ordering: SQLOrdering? = nil // SQLite 3.44.0+
|
||||
var filter: SQLExpression? = nil // @available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) SQLite 3.30+
|
||||
var filter: SQLExpression? = nil // @available(iOS 14, macOS 10.16, tvOS 14, *) SQLite 3.30+
|
||||
|
||||
/// A boolean value indicating if a function is known to return a
|
||||
/// JSON value.
|
||||
@@ -2328,13 +2328,13 @@ extension SQLSpecificExpressible {
|
||||
}
|
||||
#elseif !GRDBCIPHER
|
||||
/// An ordering term for ascending order (nulls last).
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+
|
||||
public var ascNullsLast: SQLOrdering {
|
||||
.ascNullsLast(sqlExpression)
|
||||
}
|
||||
|
||||
/// An ordering term for descending order (nulls first).
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+
|
||||
public var descNullsFirst: SQLOrdering {
|
||||
.descNullsFirst(sqlExpression)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public func average(
|
||||
/// // AVG(length) FILTER (WHERE length > 0)
|
||||
/// average(Column("length"), filter: Column("length") > 0)
|
||||
/// ```
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+
|
||||
public func average(
|
||||
_ value: some SQLSpecificExpressible,
|
||||
filter: some SQLSpecificExpressible)
|
||||
@@ -145,7 +145,7 @@ public func max(
|
||||
/// // MAX(score) FILTER (WHERE score < 0)
|
||||
/// max(Column("score"), filter: Column("score") < 0)
|
||||
/// ```
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+
|
||||
public func max(
|
||||
_ value: some SQLSpecificExpressible,
|
||||
filter: some SQLSpecificExpressible)
|
||||
@@ -190,7 +190,7 @@ public func min(
|
||||
/// // MIN(score) FILTER (WHERE score > 0)
|
||||
/// min(Column("score"), filter: Column("score") > 0)
|
||||
/// ```
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+
|
||||
public func min(
|
||||
_ value: some SQLSpecificExpressible,
|
||||
filter: some SQLSpecificExpressible)
|
||||
@@ -248,7 +248,7 @@ public func sum(
|
||||
/// See also ``total(_:)``.
|
||||
///
|
||||
/// Related SQLite documentation: <https://www.sqlite.org/lang_aggfunc.html#sumunc>.
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+
|
||||
public func sum(
|
||||
_ value: some SQLSpecificExpressible,
|
||||
filter: some SQLSpecificExpressible)
|
||||
@@ -312,7 +312,7 @@ public func total(
|
||||
/// See also ``total(_:)``.
|
||||
///
|
||||
/// Related SQLite documentation: <https://www.sqlite.org/lang_aggfunc.html#sumunc>.
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // SQLite 3.30+
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // SQLite 3.30+
|
||||
public func total(
|
||||
_ value: some SQLSpecificExpressible,
|
||||
filter: some SQLSpecificExpressible)
|
||||
|
||||
@@ -723,7 +723,7 @@ extension Table {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Table where RowDecoder: Identifiable, RowDecoder.ID: DatabaseValueConvertible {
|
||||
/// Returns a request filtered by primary key.
|
||||
///
|
||||
@@ -1546,7 +1546,7 @@ extension Table {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Table
|
||||
where RowDecoder: Identifiable,
|
||||
RowDecoder.ID: DatabaseValueConvertible
|
||||
@@ -1688,7 +1688,7 @@ extension Table {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Table
|
||||
where RowDecoder: Identifiable,
|
||||
RowDecoder.ID: DatabaseValueConvertible
|
||||
|
||||
@@ -129,7 +129,7 @@ public final class TableAlteration {
|
||||
///
|
||||
/// - parameter name: the old name of the column.
|
||||
/// - parameter newName: the new name of the column.
|
||||
@available(iOS 13, tvOS 13, watchOS 6, *) // SQLite 3.25+
|
||||
@available(iOS 13, tvOS 13, *) // SQLite 3.25+
|
||||
public func rename(column name: String, to newName: String) {
|
||||
_rename(column: name, to: newName)
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ extension TableRecord {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
|
||||
/// Returns a request filtered by primary key.
|
||||
///
|
||||
|
||||
@@ -217,7 +217,7 @@ extension FetchableRecord where Self: TableRecord {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension FetchableRecord where Self: TableRecord & Identifiable, ID: DatabaseValueConvertible {
|
||||
|
||||
// MARK: Fetching by Single-Column Primary Key
|
||||
@@ -359,7 +359,7 @@ extension FetchableRecord where Self: TableRecord & Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension FetchableRecord where Self: TableRecord & Hashable & Identifiable, ID: DatabaseValueConvertible {
|
||||
/// Returns a set of records identified by their primary keys.
|
||||
///
|
||||
|
||||
@@ -319,7 +319,7 @@ extension TableRecord {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
|
||||
/// Returns whether a record exists for this primary key.
|
||||
///
|
||||
@@ -455,7 +455,7 @@ extension TableRecord {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
|
||||
/// Deletes records identified by their primary keys, and returns the number
|
||||
/// of deleted records.
|
||||
@@ -774,7 +774,7 @@ extension TableRecord where Self: EncodableRecord {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension TableRecord where Self: Identifiable, ID: DatabaseValueConvertible {
|
||||
/// Returns an error for a record that does not exist in the database.
|
||||
///
|
||||
|
||||
@@ -14,7 +14,7 @@ import Foundation
|
||||
/// Both two extra scheduling guarantees are used by GRDB in order to be
|
||||
/// able to spawn concurrent database reads right from the database writer
|
||||
/// queue, and fulfill GRDB preconditions.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
struct OnDemandFuture<Output, Failure: Error>: Publisher {
|
||||
typealias Promise = (Result<Output, Failure>) -> Void
|
||||
typealias Output = Output
|
||||
@@ -33,7 +33,7 @@ struct OnDemandFuture<Output, Failure: Error>: Publisher {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
private class OnDemandFutureSubscription<Downstream: Subscriber>: Subscription {
|
||||
typealias Promise = (Result<Downstream.Input, Downstream.Failure>) -> Void
|
||||
|
||||
|
||||
@@ -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(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
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(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
private class ReceiveValuesOnSubscription<Upstream, Context, Downstream>: Subscription, Subscriber
|
||||
where
|
||||
Upstream: Publisher,
|
||||
@@ -211,7 +211,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Publisher {
|
||||
/// Specifies the scheduler on which to receive values from the publisher
|
||||
///
|
||||
|
||||
@@ -291,7 +291,7 @@ public final class SharedValueObservation<Element> {
|
||||
/// print("fresh players: \(players)")
|
||||
/// }
|
||||
/// ```
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func publisher() -> DatabasePublishers.Value<Element> {
|
||||
DatabasePublishers.Value { onError, onChange in
|
||||
self.start(onError: onError, onChange: onChange)
|
||||
@@ -368,7 +368,7 @@ extension SharedValueObservation {
|
||||
/// print("Fresh players: \(players)")
|
||||
/// }
|
||||
/// ```
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func values(bufferingPolicy: AsyncValueObservation<Element>.BufferingPolicy = .unbounded)
|
||||
-> AsyncValueObservation<Element>
|
||||
{
|
||||
|
||||
@@ -294,7 +294,7 @@ extension ValueObservation {
|
||||
/// ```
|
||||
///
|
||||
/// - parameter reader: A DatabaseReader.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func values(
|
||||
in reader: some DatabaseReader,
|
||||
bufferingPolicy: AsyncValueObservation<Reducer.Value>.BufferingPolicy = .unbounded)
|
||||
@@ -334,7 +334,7 @@ extension ValueObservation {
|
||||
///
|
||||
/// You build an `AsyncValueObservation` from ``ValueObservation`` or
|
||||
/// ``SharedValueObservation``.
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public struct AsyncValueObservation<Element>: AsyncSequence {
|
||||
public typealias BufferingPolicy = AsyncThrowingStream<Element, Error>.Continuation.BufferingPolicy
|
||||
public typealias AsyncIterator = Iterator
|
||||
@@ -436,7 +436,7 @@ extension ValueObservation {
|
||||
/// - parameter scheduler: A ValueObservationScheduler. By default, fresh
|
||||
/// values are dispatched asynchronously on the main dispatch queue.
|
||||
/// - returns: A Combine publisher
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func publisher(
|
||||
in reader: some DatabaseReader,
|
||||
scheduling scheduler: some ValueObservationScheduler = .async(onQueue: .main))
|
||||
@@ -453,7 +453,7 @@ extension ValueObservation {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension DatabasePublishers {
|
||||
/// A publisher that publishes the values of a ``ValueObservation``.
|
||||
///
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
**Latest release**: March 23, 2024 • [version 6.26.0](https://github.com/groue/GRDB.swift/tree/v6.26.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
|
||||
|
||||
**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / visionOS 1.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 15.3+
|
||||
**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / visionOS 1.0+ / watchOS 7.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 15.3+
|
||||
|
||||
**Contact**:
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13
|
||||
TVOS_DEPLOYMENT_TARGET = 12.0
|
||||
WATCHOS_DEPLOYMENT_TARGET = 4.0
|
||||
WATCHOS_DEPLOYMENT_TARGET = 7.0
|
||||
XROS_DEPLOYMENT_TARGET = 1.0
|
||||
@@ -1,7 +1,7 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13
|
||||
TVOS_DEPLOYMENT_TARGET = 12.0
|
||||
WATCHOS_DEPLOYMENT_TARGET = 4.0
|
||||
WATCHOS_DEPLOYMENT_TARGET = 7.0
|
||||
XROS_DEPLOYMENT_TARGET = 1.0
|
||||
OTHER_SWIFT_FLAGS = $(inherited) -D SQLITE_ENABLE_FTS5
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
- [X] GRDB7: stop exporting CSQLite https://github.com/groue/GRDB.swift/issues/642#issuecomment-1937347696
|
||||
- [ ] GRDB7: AsyncValueObservation: experiment with an immediate scheduler that does not hop to the main queue.
|
||||
- [ ] GRDB7: Question Sendability of SQLExpressible et al. If we can copy Sendable representations in requests, it's not needed.
|
||||
- [ ] GRDB7: Raise the minimum watchOS target https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836
|
||||
- [X] GRDB7: Raise the minimum watchOS target https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836
|
||||
- [ ] GRDB7: Consider putting a Task cancellation handler on async methods.
|
||||
- [ ] GRDB7: All writes should be immediate, right? https://github.com/groue/GRDB.swift/pull/1485#issuecomment-1953793553
|
||||
- [ ] GRDB7: Sendable conformances
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#if canImport(Combine)
|
||||
import XCTest
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation which waits for the timeout to expire, or
|
||||
/// the recorded publisher to complete.
|
||||
|
||||
@@ -17,7 +17,7 @@ import XCTest
|
||||
// try wait(for: recorder.finished.inverted, timeout: 1)
|
||||
// }
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation which waits for the recorded publisher
|
||||
/// to complete.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#if canImport(Combine)
|
||||
import XCTest
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation that fails if the base expectation is fulfilled.
|
||||
///
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#if canImport(Combine)
|
||||
import XCTest
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation that transforms the value of a base expectation.
|
||||
///
|
||||
@@ -20,7 +20,7 @@ extension PublisherExpectations {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectation {
|
||||
/// Returns a publisher expectation that transforms the value of the
|
||||
/// base expectation.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#if canImport(Combine)
|
||||
import XCTest
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation which waits for the recorded publisher to emit
|
||||
/// `count` elements, or to complete.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#if canImport(Combine)
|
||||
import XCTest
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation which waits for the recorded publisher to emit
|
||||
/// one element, or to complete.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#if canImport(Combine)
|
||||
import XCTest
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation which waits for the recorded publisher to emit
|
||||
/// `maxLength` elements, or to complete.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import Combine
|
||||
import XCTest
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// A publisher expectation which waits for the recorded publisher
|
||||
/// to complete.
|
||||
|
||||
@@ -13,7 +13,7 @@ import XCTest
|
||||
///
|
||||
/// let elements = try wait(for: recorder.elements, timeout: 1)
|
||||
/// XCTAssertEqual(elements, ["foo", "bar", "baz"])
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public class Recorder<Input, Failure: Error>: Subscriber {
|
||||
public typealias Input = Input
|
||||
public typealias Failure = Failure
|
||||
@@ -287,7 +287,7 @@ public class Recorder<Input, Failure: Error>: Subscriber {
|
||||
|
||||
// MARK: - Publisher Expectations
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension PublisherExpectations {
|
||||
/// The type of the publisher expectation returned by `Recorder.completion`.
|
||||
public typealias Completion<Input, Failure: Error> = Map<Recording<Input, Failure>, Subscribers.Completion<Failure>>
|
||||
@@ -302,7 +302,7 @@ extension PublisherExpectations {
|
||||
public typealias Single<Input, Failure: Error> = Map<Elements<Input, Failure>, Input>
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Recorder {
|
||||
/// Returns a publisher expectation which waits for the timeout to expire,
|
||||
/// or the recorded publisher to complete.
|
||||
@@ -584,7 +584,7 @@ extension Recorder {
|
||||
|
||||
// MARK: - Publisher + Recorder
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Publisher {
|
||||
/// Returns a subscribed Recorder.
|
||||
///
|
||||
|
||||
@@ -22,7 +22,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testReadPublisher() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
|
||||
// frame #71: 0x00007fff72311cc9 libdyld.dylib`start + 1
|
||||
// frame #72: 0x00007fff72311cc9 libdyld.dylib`start + 1
|
||||
func testReadPublisherError() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testReadPublisherIsAsynchronous() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testReadPublisherDefaultScheduler() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testReadPublisherCustomScheduler() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testReadPublisherIsReadonly() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ private struct Player: Codable, FetchableRecord, PersistableRecord {
|
||||
class DatabaseRegionObservationPublisherTests : XCTestCase {
|
||||
|
||||
func testChangesNotifications() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class DatabaseRegionObservationPublisherTests : XCTestCase {
|
||||
// TODO: do the same, but asynchronously. If this is too hard, update the
|
||||
// public API so that users can easily do it.
|
||||
func testPrependInitialDatabaseSync() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWritePublisher() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWritePublisherValue() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWritePublisherError() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testWritePublisherErrorRollbacksTransaction() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWritePublisherIsAsynchronous() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWritePublisherDefaultScheduler() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWritePublisherCustomScheduler() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// TODO: Fix flaky test with both pool and on-disk queue:
|
||||
// - Expectation timeout
|
||||
func testWriteThenReadPublisher() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWriteThenReadPublisherIsReadonly() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// MARK: -
|
||||
|
||||
func testWriteThenReadPublisherWriteError() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testWriteThenReadPublisherWriteErrorRollbacksTransaction() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// TODO: Fix flaky test with both pool and on-disk queue:
|
||||
// - Expectation timeout
|
||||
func testWriteThenReadPublisherReadError() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ class DatabaseWriterWritePublisherTests : XCTestCase {
|
||||
// Regression test against deadlocks created by concurrent completion
|
||||
// and cancellations triggered by .switchToLatest().prefix(1)
|
||||
func testDeadlockPrevention() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ final class Test<Context> {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
final class AsyncTest<Context> {
|
||||
// Raise the repeatCount in order to help spotting flaky tests.
|
||||
private let repeatCount: Int
|
||||
@@ -100,7 +100,7 @@ final class AsyncTest<Context> {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
public func assertNoFailure<Failure>(
|
||||
_ completion: Subscribers.Completion<Failure>,
|
||||
file: StaticString = #file,
|
||||
@@ -111,7 +111,7 @@ public func assertNoFailure<Failure>(
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
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(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testDefaultSchedulerFirstValueIsEmittedAsynchronously() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testDefaultSchedulerError() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
// MARK: - Immediate Scheduler
|
||||
|
||||
func testImmediateSchedulerChangesNotifications() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testImmediateSchedulerEmitsFirstValueSynchronously() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testImmediateSchedulerError() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
|
||||
// MARK: - Demand
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
private class DemandSubscriber<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(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testDemandOneReceivesOneElement() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testDemandOneDoesNotReceiveTwoElements() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
}
|
||||
|
||||
func testDemandTwoReceivesTwoElements() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ class ValueObservationPublisherTests : XCTestCase {
|
||||
|
||||
/// Regression test for https://github.com/groue/GRDB.swift/issues/1194
|
||||
func testIssue1194() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ private struct RecordWithData<Strategy: StrategyProvider>: EncodableRecord, Enco
|
||||
var data: Data
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension RecordWithData: Identifiable {
|
||||
var id: Data { data }
|
||||
}
|
||||
@@ -33,7 +33,7 @@ private struct RecordWithOptionalData<Strategy: StrategyProvider>: EncodableReco
|
||||
var data: Data?
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension RecordWithOptionalData: Identifiable {
|
||||
var id: Data? { data }
|
||||
}
|
||||
@@ -150,7 +150,7 @@ extension DatabaseDataEncodingStrategyTests {
|
||||
}
|
||||
|
||||
func testFilterID() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Identifiable not available")
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ extension DatabaseDataEncodingStrategyTests {
|
||||
}
|
||||
|
||||
func testDeleteID() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Identifiable not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ private struct RecordWithDate<Strategy: StrategyProvider>: EncodableRecord, Enco
|
||||
var date: Date
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension RecordWithDate: Identifiable {
|
||||
var id: Date { date }
|
||||
}
|
||||
@@ -60,7 +60,7 @@ private struct RecordWithOptionalDate<Strategy: StrategyProvider>: EncodableReco
|
||||
var date: Date?
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension RecordWithOptionalDate: Identifiable {
|
||||
var id: Date? { date }
|
||||
}
|
||||
@@ -260,7 +260,7 @@ extension DatabaseDateEncodingStrategyTests {
|
||||
}
|
||||
|
||||
func testFilterID() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Identifiable not available")
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ extension DatabaseDateEncodingStrategyTests {
|
||||
}
|
||||
|
||||
func testDeleteID() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Identifiable not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ final class DatabaseDumpTests: GRDBTestCase {
|
||||
// MARK: - JSON
|
||||
|
||||
func test_json_value_formatting() throws {
|
||||
guard #available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) else {
|
||||
guard #available(iOS 13.0, macOS 10.15, tvOS 13.0, *) else {
|
||||
throw XCTSkip("Skip because this test relies on JSONEncoder.OutputFormatting.withoutEscapingSlashes")
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
func testEmptyMigratorPublisher() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
func testNonEmptyMigratorPublisher() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
func testEmptyMigratorPublisherIsAsynchronous() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
func testNonEmptyMigratorPublisherIsAsynchronous() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
func testMigratorPublisherDefaultScheduler() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
func testMigratorPublisherCustomScheduler() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class DatabaseReaderTests : GRDBTestCase {
|
||||
#endif
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_ReadCanRead() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
try dbWriter.write { db in
|
||||
@@ -75,7 +75,7 @@ class DatabaseReaderTests : GRDBTestCase {
|
||||
#endif
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_ReadPreventsDatabaseModification() async throws {
|
||||
func test(_ dbReader: some DatabaseReader) async throws {
|
||||
do {
|
||||
@@ -119,7 +119,7 @@ class DatabaseReaderTests : GRDBTestCase {
|
||||
#endif
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_UnsafeReadCanRead() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
try dbWriter.write { db in
|
||||
|
||||
@@ -220,7 +220,7 @@ final class DatabaseSnapshotPoolTests: GRDBTestCase {
|
||||
try XCTAssertEqual(dbPool.read(counter.value), 2)
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func test_read_async() async throws {
|
||||
let dbPool = try makeDatabasePool()
|
||||
let counter = try Counter(dbPool: dbPool) // 0
|
||||
|
||||
@@ -23,7 +23,7 @@ private struct RecordWithUUID<Strategy: StrategyProvider>: EncodableRecord, Enco
|
||||
var uuid: UUID
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension RecordWithUUID: Identifiable {
|
||||
var id: UUID { uuid }
|
||||
}
|
||||
@@ -33,7 +33,7 @@ private struct RecordWithOptionalUUID<Strategy: StrategyProvider>: EncodableReco
|
||||
var uuid: UUID?
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension RecordWithOptionalUUID: Identifiable {
|
||||
var id: UUID? { uuid }
|
||||
}
|
||||
@@ -184,7 +184,7 @@ extension DatabaseUUIDEncodingStrategyTests {
|
||||
}
|
||||
|
||||
func testFilterID() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Identifiable not available")
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ extension DatabaseUUIDEncodingStrategyTests {
|
||||
}
|
||||
|
||||
func testDeleteID() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Identifiable not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
func testVacuumInto() throws {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip("VACUUM INTO is not available")
|
||||
}
|
||||
// Prevent SQLCipher failures
|
||||
@@ -275,7 +275,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
try DatabaseQueue().backup(to: dbQueue)
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_write() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
try dbWriter.write { db in
|
||||
@@ -295,7 +295,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
try await test(setup(makeDatabasePool()))
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_writeWithoutTransaction() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
try dbWriter.write { db in
|
||||
@@ -318,7 +318,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
try await test(setup(makeDatabasePool()))
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_barrierWriteWithoutTransaction() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
try dbWriter.write { db in
|
||||
@@ -341,7 +341,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
try await test(setup(makeDatabasePool()))
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_erase() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
try dbWriter.write { db in
|
||||
@@ -359,7 +359,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
try await test(setup(makeDatabasePool()))
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_vacuum() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
try dbWriter.write { db in
|
||||
@@ -375,7 +375,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
try await test(setup(makeDatabasePool()))
|
||||
}
|
||||
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) // async + vacuum into
|
||||
@available(iOS 14, macOS 10.16, tvOS 14, *) // async + vacuum into
|
||||
func testAsyncAwait_vacuumInto() async throws {
|
||||
// Prevent SQLCipher failures
|
||||
guard sqlite3_libversion_number() >= 3027000 else {
|
||||
@@ -406,7 +406,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
}
|
||||
|
||||
/// A test related to <https://github.com/groue/GRDB.swift/issues/1456>
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncWriteThenRead() async throws {
|
||||
/// An async read performed after an async write should see the write.
|
||||
func test(_ dbWriter: some DatabaseWriter) async throws {
|
||||
|
||||
@@ -76,7 +76,7 @@ class FTS3TableBuilderTests: GRDBTestCase {
|
||||
}
|
||||
#elseif !GRDBCIPHER
|
||||
func testUnicode61TokenizerDiacriticsRemove() throws {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip()
|
||||
}
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
|
||||
@@ -130,7 +130,7 @@ class FTS5TableBuilderTests: GRDBTestCase {
|
||||
}
|
||||
#elseif !GRDBCIPHER
|
||||
func testUnicode61TokenizerDiacriticsRemove() throws {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip()
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ private struct FlatModel: FetchableRecord {
|
||||
self.t5count = row.scopes[Scopes.suffix]!["t5count"]
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
static func modernAll() -> some FetchRequest<FlatModel> {
|
||||
all()
|
||||
}
|
||||
@@ -138,7 +138,7 @@ private struct CodableFlatModel: FetchableRecord, Codable {
|
||||
var t3: T3?
|
||||
var t5count: Int
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
static func modernAll() -> some FetchRequest<CodableFlatModel> {
|
||||
all()
|
||||
}
|
||||
@@ -186,7 +186,7 @@ private struct CodableNestedModel: FetchableRecord, Codable {
|
||||
var t3: T3?
|
||||
var t5count: Int
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
static func modernAll() -> some FetchRequest<CodableNestedModel> {
|
||||
all()
|
||||
}
|
||||
|
||||
@@ -1512,7 +1512,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#else
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#endif
|
||||
@@ -1561,7 +1561,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#else
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#endif
|
||||
@@ -1594,7 +1594,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#else
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#endif
|
||||
@@ -1627,7 +1627,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#else
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#endif
|
||||
@@ -1684,7 +1684,7 @@ class QueryInterfaceExpressionsTests: GRDBTestCase {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#else
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) else {
|
||||
guard #available(iOS 14, macOS 10.16, tvOS 14, *) else {
|
||||
throw XCTSkip("FILTER clause on aggregate functions is not available")
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -779,7 +779,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
|
||||
sql(dbQueue, tableRequest.order(Col.age.descNullsFirst)),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST")
|
||||
#elseif !GRDBCIPHER
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) {
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, *) {
|
||||
XCTAssertEqual(
|
||||
sql(dbQueue, tableRequest.order(Col.age.ascNullsLast)),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST")
|
||||
@@ -809,7 +809,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
|
||||
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).descNullsFirst)),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE DESC NULLS FIRST")
|
||||
#elseif !GRDBCIPHER
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) {
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, *) {
|
||||
XCTAssertEqual(
|
||||
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).ascNullsLast)),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE ASC NULLS LAST")
|
||||
@@ -858,7 +858,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
|
||||
sql(dbQueue, tableRequest.order(Col.age.ascNullsLast).reversed()),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST")
|
||||
#elseif !GRDBCIPHER
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) {
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, *) {
|
||||
XCTAssertEqual(
|
||||
sql(dbQueue, tableRequest.order(Col.age.descNullsFirst).reversed()),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST")
|
||||
@@ -888,7 +888,7 @@ class QueryInterfaceRequestTests: GRDBTestCase {
|
||||
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).descNullsFirst).reversed()),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE ASC NULLS LAST")
|
||||
#elseif !GRDBCIPHER
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) {
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, *) {
|
||||
XCTAssertEqual(
|
||||
sql(dbQueue, tableRequest.order(Col.name.collating(.nocase).ascNullsLast).reversed()),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"name\" COLLATE NOCASE DESC NULLS FIRST")
|
||||
|
||||
@@ -41,7 +41,7 @@ private class MinimalNonOptionalPrimaryKeySingle: Record, Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension MinimalNonOptionalPrimaryKeySingle: Identifiable { }
|
||||
|
||||
class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
@@ -471,7 +471,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [String] = []
|
||||
let cursor = try MinimalNonOptionalPrimaryKeySingle.fetchCursor(db, ids: ids)
|
||||
@@ -510,7 +510,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [String] = []
|
||||
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchAll(db, ids: ids)
|
||||
@@ -548,7 +548,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [String] = []
|
||||
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.fetchSet(db, ids: ids)
|
||||
@@ -583,7 +583,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.fetchOne(db, id: record.id)!
|
||||
XCTAssertTrue(fetchedRecord.id == record.id)
|
||||
@@ -611,7 +611,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
_ = try MinimalNonOptionalPrimaryKeySingle.find(db, key: "missing")
|
||||
XCTFail("Expected RecordError")
|
||||
@@ -651,7 +651,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [String] = []
|
||||
let cursor = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchCursor(db)
|
||||
@@ -690,7 +690,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [String] = []
|
||||
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchAll(db)
|
||||
@@ -728,7 +728,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.id }), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [String] = []
|
||||
let fetchedRecords = try MinimalNonOptionalPrimaryKeySingle.filter(ids: ids).fetchSet(db)
|
||||
@@ -763,7 +763,7 @@ class RecordMinimalNonOptionalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"id\" = '\(record.id)'")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try MinimalNonOptionalPrimaryKeySingle.filter(id: record.id).fetchOne(db)!
|
||||
XCTAssertTrue(fetchedRecord.id == record.id)
|
||||
|
||||
@@ -45,7 +45,7 @@ class MinimalRowID : Record, Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension MinimalRowID: Identifiable { }
|
||||
|
||||
class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
@@ -505,7 +505,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let cursor = try MinimalRowID.fetchCursor(db, ids: ids)
|
||||
@@ -544,7 +544,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try MinimalRowID.fetchAll(db, ids: ids)
|
||||
@@ -582,7 +582,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try MinimalRowID.fetchSet(db, ids: ids)
|
||||
@@ -617,7 +617,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try MinimalRowID.fetchOne(db, id: record.id!)!
|
||||
XCTAssertTrue(fetchedRecord.id == record.id)
|
||||
@@ -648,7 +648,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
_ = try MinimalRowID.find(db, id: -1)
|
||||
XCTFail("Expected RecordError")
|
||||
@@ -691,7 +691,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let cursor = try MinimalRowID.filter(ids: ids).fetchCursor(db)
|
||||
@@ -730,7 +730,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchAll(db)
|
||||
@@ -768,7 +768,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try MinimalRowID.filter(ids: ids).fetchSet(db)
|
||||
@@ -803,7 +803,7 @@ class RecordMinimalPrimaryKeyRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalRowIDs\" WHERE \"id\" = \(record.id!)")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try MinimalRowID.filter(id: record.id!).fetchOne(db)!
|
||||
XCTAssertTrue(fetchedRecord.id == record.id)
|
||||
|
||||
@@ -39,7 +39,7 @@ class MinimalSingle: Record, Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension MinimalSingle: Identifiable {
|
||||
/// Test non-optional ID type
|
||||
var id: String { UUID! }
|
||||
@@ -529,7 +529,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let UUIDs: [String] = []
|
||||
let cursor = try MinimalSingle.fetchCursor(db, ids: UUIDs)
|
||||
@@ -570,7 +570,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let UUIDs: [String] = []
|
||||
let fetchedRecords = try MinimalSingle.fetchAll(db, ids: UUIDs)
|
||||
@@ -610,7 +610,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let UUIDs: [String] = []
|
||||
let fetchedRecords = try MinimalSingle.fetchSet(db, ids: UUIDs)
|
||||
@@ -646,7 +646,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try MinimalSingle.fetchOne(db, id: record.UUID!)!
|
||||
XCTAssertTrue(fetchedRecord.UUID == record.UUID)
|
||||
@@ -675,7 +675,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
_ = try MinimalSingle.find(db, id: "missing")
|
||||
XCTFail("Expected RecordError")
|
||||
@@ -717,7 +717,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let UUIDs: [String] = []
|
||||
let cursor = try MinimalSingle.filter(ids: UUIDs).fetchCursor(db)
|
||||
@@ -758,7 +758,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let UUIDs: [String] = []
|
||||
let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchAll(db)
|
||||
@@ -798,7 +798,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map { $0.UUID! }), Set(UUIDs))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let UUIDs: [String] = []
|
||||
let fetchedRecords = try MinimalSingle.filter(ids: UUIDs).fetchSet(db)
|
||||
@@ -834,7 +834,7 @@ class RecordMinimalPrimaryKeySingleTests: GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT * FROM \"minimalSingles\" WHERE \"UUID\" = '\(record.UUID!)'")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try MinimalSingle.filter(id: record.UUID!).fetchOne(db)!
|
||||
XCTAssertTrue(fetchedRecord.UUID == record.UUID)
|
||||
|
||||
@@ -77,7 +77,7 @@ private class Person : Record, Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Person: Identifiable { }
|
||||
|
||||
class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
@@ -597,7 +597,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let cursor = try Person.fetchCursor(db, ids: ids)
|
||||
@@ -636,7 +636,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try Person.fetchAll(db, ids: ids)
|
||||
@@ -674,7 +674,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try Person.fetchSet(db, ids: ids)
|
||||
@@ -712,7 +712,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try Person.fetchOne(db, id: record.id!)!
|
||||
XCTAssertTrue(fetchedRecord.id == record.id)
|
||||
@@ -749,7 +749,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
_ = try Person.find(db, id: -1)
|
||||
XCTFail("Expected RecordError")
|
||||
@@ -795,7 +795,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let cursor = try Person.filter(ids: ids).fetchCursor(db)
|
||||
@@ -834,7 +834,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try Person.filter(ids: ids).fetchAll(db)
|
||||
@@ -872,7 +872,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(Set(fetchedRecords.map(\.id)), Set(ids))
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let ids: [Int64] = []
|
||||
let fetchedRecords = try Person.filter(ids: ids).fetchSet(db)
|
||||
@@ -910,7 +910,7 @@ class RecordPrimaryKeyHiddenRowIDTests : GRDBTestCase {
|
||||
XCTAssertEqual(lastSQLQuery, "SELECT *, \"rowid\" FROM \"persons\" WHERE \"rowid\" = \(record.id!)")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
do {
|
||||
let fetchedRecord = try Person.filter(id: record.id!).fetchOne(db)!
|
||||
XCTAssertTrue(fetchedRecord.id == record.id)
|
||||
|
||||
@@ -104,7 +104,7 @@ class SharedValueObservationTests: GRDBTestCase {
|
||||
|
||||
#if canImport(Combine)
|
||||
func test_immediate_publisher() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ class SharedValueObservationTests: GRDBTestCase {
|
||||
|
||||
#if canImport(Combine)
|
||||
func test_async_publisher() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ class SharedValueObservationTests: GRDBTestCase {
|
||||
|
||||
#if canImport(Combine)
|
||||
func test_error_recovery_observationLifetime() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ class SharedValueObservationTests: GRDBTestCase {
|
||||
|
||||
#if canImport(Combine)
|
||||
func test_error_recovery_whileObserved() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Combine is not available")
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ class SharedValueObservationTests: GRDBTestCase {
|
||||
}
|
||||
#endif
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait() async throws {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
try await dbQueue.write { db in
|
||||
|
||||
@@ -806,7 +806,7 @@ class TableDefinitionTests: GRDBTestCase {
|
||||
throw XCTSkip("ALTER TABLE RENAME COLUMN is not available")
|
||||
}
|
||||
#if !GRDBCUSTOMSQLITE && !GRDBCIPHER
|
||||
guard #available(iOS 13, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, tvOS 13, *) else {
|
||||
throw XCTSkip("ALTER TABLE RENAME COLUMN is not available")
|
||||
}
|
||||
#endif
|
||||
@@ -834,7 +834,7 @@ class TableDefinitionTests: GRDBTestCase {
|
||||
throw XCTSkip("ALTER TABLE RENAME COLUMN is not available")
|
||||
}
|
||||
#if !GRDBCUSTOMSQLITE && !GRDBCIPHER
|
||||
guard #available(iOS 13, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, tvOS 13, *) else {
|
||||
throw XCTSkip("ALTER TABLE RENAME COLUMN is not available")
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -259,7 +259,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase {
|
||||
sql(dbQueue, Reader.order(Col.age.descNullsFirst)),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST")
|
||||
#elseif !GRDBCIPHER
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, watchOS 7, *) {
|
||||
if #available(iOS 14, macOS 10.16, tvOS 14, *) {
|
||||
XCTAssertEqual(
|
||||
sql(dbQueue, Reader.order(Col.age.ascNullsLast)),
|
||||
"SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST")
|
||||
@@ -357,7 +357,7 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase {
|
||||
}
|
||||
|
||||
func testExistsIdentifiable() throws {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else {
|
||||
guard #available(iOS 13, macOS 10.15, tvOS 13, *) else {
|
||||
throw XCTSkip("Identifiable is not available")
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ private struct Hacker : TableRecord {
|
||||
var id: Int64? // Optional
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Hacker: Identifiable { }
|
||||
|
||||
private struct Person : Codable, PersistableRecord, FetchableRecord, Hashable {
|
||||
@@ -16,7 +16,7 @@ private struct Person : Codable, PersistableRecord, FetchableRecord, Hashable {
|
||||
var email: String
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Person: Identifiable { }
|
||||
|
||||
private struct Citizenship : TableRecord {
|
||||
@@ -46,7 +46,7 @@ class TableRecordDeleteTests: GRDBTestCase {
|
||||
XCTAssertTrue(deleted)
|
||||
XCTAssertEqual(try Hacker.fetchCount(db), 0)
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
try db.execute(sql: "INSERT INTO hackers (rowid, name) VALUES (?, ?)", arguments: [1, "Arthur"])
|
||||
try XCTAssertFalse(Hacker.deleteOne(db, id: nil))
|
||||
deleted = try Hacker.deleteOne(db, id: 1)
|
||||
@@ -62,7 +62,7 @@ class TableRecordDeleteTests: GRDBTestCase {
|
||||
XCTAssertEqual(deletedCount, 2)
|
||||
XCTAssertEqual(try Hacker.fetchCount(db), 1)
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
try db.execute(sql: "INSERT INTO hackers (rowid, name) VALUES (?, ?)", arguments: [2, "Barbara"])
|
||||
try db.execute(sql: "INSERT INTO hackers (rowid, name) VALUES (?, ?)", arguments: [3, "Craig"])
|
||||
let deletedCount = try Hacker.deleteAll(db, ids: [2, 3, 4])
|
||||
@@ -85,7 +85,7 @@ class TableRecordDeleteTests: GRDBTestCase {
|
||||
XCTAssertTrue(deleted)
|
||||
XCTAssertEqual(try Person.fetchCount(db), 0)
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
try db.execute(sql: "INSERT INTO persons (id, name, email) VALUES (?, ?, ?)", arguments: [1, "Arthur", "arthur@example.com"])
|
||||
deleted = try Person.deleteOne(db, id: 1)
|
||||
XCTAssertTrue(deleted)
|
||||
@@ -100,7 +100,7 @@ class TableRecordDeleteTests: GRDBTestCase {
|
||||
XCTAssertEqual(deletedCount, 2)
|
||||
XCTAssertEqual(try Person.fetchCount(db), 1)
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
try db.execute(sql: "INSERT INTO persons (id, name, email) VALUES (?, ?, ?)", arguments: [2, "Barbara", "barbara@example.com"])
|
||||
try db.execute(sql: "INSERT INTO persons (id, name, email) VALUES (?, ?, ?)", arguments: [3, "Craig", "craig@example.com"])
|
||||
let deletedCount = try Person.deleteAll(db, ids: [2, 3, 4])
|
||||
@@ -190,7 +190,7 @@ class TableRecordDeleteTests: GRDBTestCase {
|
||||
try Person.filter(keys: [1, 2]).deleteAll(db)
|
||||
XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2)")
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
try Person.filter(id: 1).deleteAll(db)
|
||||
XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1")
|
||||
|
||||
@@ -279,7 +279,7 @@ class TableRecordDeleteTests: GRDBTestCase {
|
||||
XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" IN (1, 2) RETURNING *")
|
||||
|
||||
#if GRDBCUSTOMSQLITE || GRDBCIPHER
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
_ = try Person.filter(id: 1).deleteAndFetchCursor(db).next()
|
||||
XCTAssertEqual(self.lastSQLQuery, "DELETE FROM \"persons\" WHERE \"id\" = 1 RETURNING *")
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ private struct Player: Codable, PersistableRecord, FetchableRecord, Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
extension Player: Identifiable { }
|
||||
|
||||
private enum Columns: String, ColumnExpression {
|
||||
@@ -56,7 +56,7 @@ class TableRecordUpdateTests: GRDBTestCase {
|
||||
UPDATE "player" SET "score" = 0 WHERE "id" IN (1, 2)
|
||||
""")
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
try Player.filter(id: 1).updateAll(db, assignment)
|
||||
XCTAssertEqual(self.lastSQLQuery, """
|
||||
UPDATE "player" SET "score" = 0 WHERE "id" = 1
|
||||
|
||||
@@ -117,7 +117,7 @@ class TableTests: GRDBTestCase {
|
||||
""")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
struct Player: Identifiable { var id: Int64 }
|
||||
let t = Table<Player>("player")
|
||||
|
||||
@@ -129,7 +129,7 @@ class TableTests: GRDBTestCase {
|
||||
""")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
struct Player: Identifiable { var id: Int64? }
|
||||
let t = Table<Player>("player")
|
||||
|
||||
@@ -806,7 +806,7 @@ class TableTests: GRDBTestCase {
|
||||
""")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
// Non-optional ID
|
||||
struct Country: Identifiable { var id: String }
|
||||
|
||||
@@ -821,7 +821,7 @@ class TableTests: GRDBTestCase {
|
||||
""")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
// Optional ID
|
||||
struct Country: Identifiable { var id: String? }
|
||||
|
||||
@@ -920,7 +920,7 @@ class TableTests: GRDBTestCase {
|
||||
""")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
// Non-optional ID
|
||||
struct Country: Identifiable { var id: String }
|
||||
|
||||
@@ -930,7 +930,7 @@ class TableTests: GRDBTestCase {
|
||||
""")
|
||||
}
|
||||
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) {
|
||||
if #available(iOS 13, macOS 10.15, tvOS 13, *) {
|
||||
// Optional ID
|
||||
struct Country: Identifiable { var id: String? }
|
||||
|
||||
|
||||
@@ -799,7 +799,7 @@ class ValueObservationTests: GRDBTestCase {
|
||||
|
||||
// MARK: - Async Await
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_values_prefix() async throws {
|
||||
func test(_ writer: some DatabaseWriter) async throws {
|
||||
// We need something to change
|
||||
@@ -833,7 +833,7 @@ class ValueObservationTests: GRDBTestCase {
|
||||
try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_values_break() async throws {
|
||||
func test(_ writer: some DatabaseWriter) async throws {
|
||||
// We need something to change
|
||||
@@ -871,7 +871,7 @@ class ValueObservationTests: GRDBTestCase {
|
||||
try await AsyncTest(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
|
||||
}
|
||||
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
|
||||
@available(iOS 13, macOS 10.15, tvOS 13, *)
|
||||
func testAsyncAwait_values_cancelled() async throws {
|
||||
func test(_ writer: some DatabaseWriter) async throws {
|
||||
// We need something to change
|
||||
|
||||
Reference in new issue
Block a user