ITADN

`'fetchAll' is only available in iOS 17 or newer` for tuple selections

#227Closedmertalev 创建于 2025-11-11
M
mertalevcommented
### Description The query builder doesn't allow selecting tuples unless I increase the iOS requirement to iOS 17, which seems rather arbitrary rather than an actual limitation. The minimum iOS version in my project is 14. ### Checklist - [ ] I have determined whether this bug is also reproducible in a vanilla SwiftUI project. - [ ] If possible, I've reproduced the issue using the `main` branch of this package. - [x] This issue hasn't been addressed in an [existing GitHub issue](https://github.com/pointfreeco/swift-structured-queries/issues) or [discussion](https://github.com/pointfreeco/swift-structured-queries/discussions). ### Expected behavior Given that it can select all columns or one column, the API for selecting *some* columns should not have different version requirements. ### Actual behavior Any tuple output type results in the version requirement increasing to iOS 17, while other parts of the API do not require this version. ### Reproducing project Given the table: ```swift @Table struct Asset { let id: String let foo: Bool let bar: Bool } ``` Compilation fails if I try to query it as such: ```swift let foo = try await db.read { conn in return try Asset.select { ($0.foo, $0.bar) }.fetchAll(conn) // `'fetchAll' is only available in iOS 17 or newer` } ``` Selecting one column works, as does selecting `self`: ```swift let ids = try await db.read { conn in return try Asset.select(\.id).fetchAll(conn) } let assets = try await db.read { conn in return try Asset.select(\.self).fetchAll(conn) } ``` Interestingly, selecting one column doesn't work either for `returning`: ```swift let ids = try await db.read { conn in return try Asset.update { $0.foo = ""}.returning(\.id).fetchAll(conn) // `'fetchAll' is only available in iOS 17 or newer` } let assets = try await db.read { conn in return try Asset.update { $0.foo = ""}.returning(\.self).fetchAll(conn) // works } ``` ### Structured Queries version information 0.25.2 (sqlite-data is 1.3.0) ### Destination operating system iOS 26.1 ### Xcode version information Version 26.0.1 (17A400) ### Swift Compiler version information ```shell swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1) Target: arm64-apple-macosx26.0 ```
关闭于 2025-11-11 1 条评论