mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Restrict async/await to Xcode 13.1+
This commit is contained in:
1 parent
9cc30018b6
commit
c755dc70ef
13 files changed
+25
-22
No files matched your search
@@ -5,6 +5,8 @@ Async/Await + SwiftUI Demo Application
|
||||
|
||||
**This demo application is an Async/Await + SwiftUI application.** For a demo application that uses UIKit, see [GRDBDemoiOS](../GRDBDemoiOS/README.md), and for Combine + SwiftUI, see [GRDBCombineDemo](../GRDBCombineDemo/README.md).
|
||||
|
||||
**Requirements**: iOS 15.0+ / Xcode 13.1+
|
||||
|
||||
> :point_up: **Note**: This demo app is not a project template. Do not copy it as a starting point for your application. Instead, create a new project, choose a GRDB [installation method](../../../README.md#installation), and use the demo as an inspiration.
|
||||
|
||||
The topics covered in this demo are:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Demo Applications
|
||||
=================
|
||||
|
||||
- [UIKit Demo Application](GRDBDemoiOS/README.md): a storyboard-based UIKit application.
|
||||
- [Combine + SwiftUI Demo Application](GRDBCombineDemo/README.md): a Combine + SwiftUI application.
|
||||
- [GRDBDemoiOS](GRDBDemoiOS/README.md): a storyboard-based UIKit application.
|
||||
- [GRDBCombineDemo](GRDBCombineDemo/README.md): a Combine + SwiftUI application.
|
||||
- [GRDBAsyncDemo](GRDBAsyncDemo/README.md): a Async/Await + SwiftUI application.
|
||||
@@ -307,7 +307,7 @@ extension DatabaseReader {
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
extension DatabaseReader {
|
||||
// MARK: - Asynchronous Database Access
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ extension DatabaseWriter {
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
extension DatabaseWriter {
|
||||
// MARK: - Asynchronous Database Access
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public struct DatabaseMigrator {
|
||||
try migrate(writer, upTo: lastMigration.identifier)
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
/// Iterate migrations in the same order as they were registered. If a
|
||||
/// migration has not yet been applied, its block is executed in
|
||||
/// a transaction.
|
||||
@@ -149,7 +149,7 @@ public struct DatabaseMigrator {
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
/// Iterate migrations in the same order as they were registered, up to the
|
||||
/// provided target. If a migration has not yet been applied, its block is
|
||||
/// executed in a transaction.
|
||||
|
||||
@@ -295,7 +295,7 @@ public final class SharedValueObservation<Element> {
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
extension SharedValueObservation {
|
||||
// MARK: - Asynchronous Observation
|
||||
/// The database observation, as an asynchronous sequence of
|
||||
|
||||
@@ -219,7 +219,7 @@ extension ValueObservation: Refinable {
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
extension ValueObservation {
|
||||
// MARK: - Asynchronous Observation
|
||||
/// The database observation, as an asynchronous sequence of
|
||||
|
||||
@@ -51,7 +51,7 @@ final class Test<Context> {
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
final class AsyncTest<Context> {
|
||||
// Raise the repeatCount in order to help spotting flaky tests.
|
||||
|
||||
@@ -98,7 +98,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
.runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_NonEmptyMigratorSync() async throws {
|
||||
func test(writer: DatabaseWriter) async throws {
|
||||
@@ -423,7 +423,7 @@ class DatabaseMigratorTests : GRDBTestCase {
|
||||
.runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_MigrateUpTo() async throws {
|
||||
func test(writer: DatabaseWriter) async throws {
|
||||
|
||||
@@ -30,7 +30,7 @@ class DatabaseReaderTests : GRDBTestCase {
|
||||
try test(setup(makeDatabasePool()).makeSnapshot())
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_ReadCanRead() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
@@ -68,7 +68,7 @@ class DatabaseReaderTests : GRDBTestCase {
|
||||
try test(makeDatabasePool().makeSnapshot())
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_ReadPreventsDatabaseModification() async throws {
|
||||
func test(_ dbReader: DatabaseReader) async throws {
|
||||
@@ -107,7 +107,7 @@ class DatabaseReaderTests : GRDBTestCase {
|
||||
try test(setup(makeDatabasePool()).makeSnapshot())
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_UnsafeReadCanRead() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
|
||||
@@ -266,7 +266,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
try DatabaseQueue().backup(to: dbQueue)
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_write() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
@@ -288,7 +288,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_writeWithoutTransaction() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
@@ -313,7 +313,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_barrierWriteWithoutTransaction() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
@@ -338,7 +338,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_erase() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
@@ -358,7 +358,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_vacuum() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
@@ -376,7 +376,7 @@ class DatabaseWriterTests : GRDBTestCase {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait_vacuumInto() async throws {
|
||||
func setup<T: DatabaseWriter>(_ dbWriter: T) throws -> T {
|
||||
|
||||
@@ -602,7 +602,7 @@ class SharedValueObservationTests: GRDBTestCase {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
func testAsyncAwait() async throws {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
|
||||
@@ -519,7 +519,7 @@ class ValueObservationTests: GRDBTestCase {
|
||||
try test(makeDatabasePool())
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
#if compiler(>=5.5.1)
|
||||
// MARK: - Async Await
|
||||
|
||||
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
|
||||
|
||||
Reference in new issue
Block a user