Skip to content

Commit 8df0449

Browse files
authored
Fix 1.1.0 @FetchAll regression (#247)
An initializer was lost when introducing an initializer for selections.
1 parent 719f83a commit 8df0449

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let package = Package(
3636
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.4"),
3737
.package(
3838
url: "https://github.com/pointfreeco/swift-structured-queries",
39-
branch: "optional-selections",
39+
from: "0.22.3",
4040
traits: [
4141
.trait(name: "StructuredQueriesTagged", condition: .when(traits: ["SQLiteDataTagged"]))
4242
]

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let package = Package(
2828
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.9.0"),
2929
.package(url: "https://github.com/pointfreeco/swift-sharing", from: "2.3.0"),
3030
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.18.4"),
31-
.package(url: "https://github.com/pointfreeco/swift-structured-queries", branch: "optional-selections"),
31+
.package(url: "https://github.com/pointfreeco/swift-structured-queries", from: "0.22.3"),
3232
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.5.0"),
3333
],
3434
targets: [

Sources/SQLiteData/FetchAll.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ public struct FetchAll<Element: Sendable>: Sendable {
8686
self.init(wrappedValue: wrappedValue, statement, database: database)
8787
}
8888

89+
/// Initializes this property with a default value.
90+
@_disfavoredOverload
91+
public init(wrappedValue: [Element] = []) {
92+
sharedReader = SharedReader(value: wrappedValue)
93+
}
94+
8995
/// Initializes this property with a default value.
9096
public init(wrappedValue: [Element] = [])
9197
where Element: StructuredQueriesCore._Selection, Element.QueryOutput == Element {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import SQLiteData
2+
3+
private final class Model {
4+
@FetchAll var titles: [String]
5+
6+
init() {
7+
_titles = FetchAll(Reminder.select(\.title))
8+
}
9+
}

0 commit comments

Comments
 (0)