@@ -158,6 +158,30 @@ public struct FetchAll<Element: Sendable>: Sendable {
158158 )
159159 }
160160
161+ /// Initializes this property with a query associated with the wrapped value.
162+ ///
163+ /// - Parameters:
164+ /// - statement: A query associated with the wrapped value.
165+ /// - database: The database to read from. A value of `nil` will use the default database
166+ /// (`@Dependency(\.defaultDatabase)`).
167+ public init < S: StructuredQueriesCore . Statement < Element > > (
168+ wrappedValue: [ Element ] = [ ] ,
169+ _ statement: S ,
170+ database: ( any DatabaseReader ) ? = nil
171+ )
172+ where
173+ Element: QueryRepresentable ,
174+ Element == S . QueryValue . QueryOutput
175+ {
176+ sharedReader = SharedReader (
177+ wrappedValue: wrappedValue,
178+ . fetch(
179+ FetchAllStatementValueRequest ( statement: statement) ,
180+ database: database
181+ )
182+ )
183+ }
184+
161185 /// Initializes this property with a query associated with the wrapped value.
162186 ///
163187 /// - Parameters:
@@ -397,6 +421,34 @@ extension FetchAll {
397421 )
398422 }
399423
424+ /// Initializes this property with a query associated with the wrapped value.
425+ ///
426+ /// - Parameters:
427+ /// - statement: A query associated with the wrapped value.
428+ /// - database: The database to read from. A value of `nil` will use the default database
429+ /// (`@Dependency(\.defaultDatabase)`).
430+ /// - scheduler: The scheduler to observe from. By default, database observation is performed
431+ /// asynchronously on the main queue.
432+ public init < S: StructuredQueriesCore . Statement < Element > > (
433+ wrappedValue: [ Element ] = [ ] ,
434+ _ statement: S ,
435+ database: ( any DatabaseReader ) ? = nil ,
436+ scheduler: some ValueObservationScheduler & Hashable
437+ )
438+ where
439+ Element: QueryRepresentable ,
440+ Element == S . QueryValue . QueryOutput
441+ {
442+ sharedReader = SharedReader (
443+ wrappedValue: wrappedValue,
444+ . fetch(
445+ FetchAllStatementValueRequest ( statement: statement) ,
446+ database: database,
447+ scheduler: scheduler
448+ )
449+ )
450+ }
451+
400452 /// Initializes this property with a query associated with the wrapped value.
401453 ///
402454 /// - Parameters:
@@ -666,6 +718,34 @@ extension FetchAll: Equatable where Element: Equatable {
666718 )
667719 }
668720
721+ /// Initializes this property with a query associated with the wrapped value.
722+ ///
723+ /// - Parameters:
724+ /// - statement: A query associated with the wrapped value.
725+ /// - database: The database to read from. A value of `nil` will use the default database
726+ /// (`@Dependency(\.defaultDatabase)`).
727+ /// - animation: The animation to use for user interface changes that result from changes to
728+ /// the fetched results.
729+ public init < S: StructuredQueriesCore . Statement < Element > > (
730+ wrappedValue: [ Element ] = [ ] ,
731+ _ statement: S ,
732+ database: ( any DatabaseReader ) ? = nil ,
733+ animation: Animation
734+ )
735+ where
736+ Element: QueryRepresentable ,
737+ Element == S . QueryValue . QueryOutput
738+ {
739+ sharedReader = SharedReader (
740+ wrappedValue: wrappedValue,
741+ . fetch(
742+ FetchAllStatementValueRequest ( statement: statement) ,
743+ database: database,
744+ animation: animation
745+ )
746+ )
747+ }
748+
669749 /// Initializes this property with a query associated with the wrapped value.
670750 ///
671751 /// - Parameters:
0 commit comments