diff --git a/Package.swift b/Package.swift index e7ba31f..a69f2b7 100644 --- a/Package.swift +++ b/Package.swift @@ -5,6 +5,7 @@ import PackageDescription let package = Package( name: "PostgREST", + platforms: [.iOS(.v11), .macOS(.v10_10)], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( diff --git a/Sources/PostgREST/Concurrency.swift b/Sources/PostgREST/Concurrency.swift new file mode 100644 index 0000000..70dd89c --- /dev/null +++ b/Sources/PostgREST/Concurrency.swift @@ -0,0 +1,14 @@ +import Foundation + +#if compiler(>=5.5) +@available(iOS 15.0.0, macOS 12.0.0, *) +extension PostgrestBuilder { + public func execute(head: Bool = false, count: CountOption? = nil) async throws -> PostgrestResponse { + try await withCheckedThrowingContinuation { continuation in + self.execute(head: head, count: count) { result in + continuation.resume(with: result) + } + } + } +} +#endif