Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/SharingGRDBCore/Fetch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ extension Fetch: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init(
wrappedValue: Value,
_ request: some FetchKeyRequest<Value>,
Expand All @@ -184,6 +185,7 @@ extension Fetch: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load(
_ request: some FetchKeyRequest<Value>,
database: (any DatabaseReader)? = nil,
Expand Down
6 changes: 6 additions & 0 deletions Sources/SharingGRDBCore/FetchAll.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ extension FetchAll: Equatable where Element: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init(
wrappedValue: [Element] = [],
database: (any DatabaseReader)? = nil,
Expand All @@ -381,6 +382,7 @@ extension FetchAll: Equatable where Element: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<S: SelectStatement>(
wrappedValue: [Element] = [],
_ statement: S,
Expand Down Expand Up @@ -409,6 +411,7 @@ extension FetchAll: Equatable where Element: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<V: QueryRepresentable>(
wrappedValue: [Element] = [],
_ statement: some StructuredQueriesCore.Statement<V>,
Expand All @@ -435,6 +438,7 @@ extension FetchAll: Equatable where Element: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<S: StructuredQueriesCore.Statement<Element>>(
wrappedValue: [Element] = [],
_ statement: S,
Expand All @@ -461,6 +465,7 @@ extension FetchAll: Equatable where Element: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load<S: SelectStatement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
Expand All @@ -484,6 +489,7 @@ extension FetchAll: Equatable where Element: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load<V: QueryRepresentable>(
_ statement: some StructuredQueriesCore.Statement<V>,
database: (any DatabaseReader)? = nil,
Expand Down
9 changes: 8 additions & 1 deletion Sources/SharingGRDBCore/FetchKey+SwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@available(macOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
@available(tvOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
@available(watchOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public static func fetch<Value>(
_ request: some FetchKeyRequest<Value>,
database: (any DatabaseReader)? = nil,
Expand All @@ -41,6 +42,7 @@
@available(macOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
@available(tvOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
@available(watchOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public static func fetch<Records: RangeReplaceableCollection>(
_ request: some FetchKeyRequest<Records>,
database: (any DatabaseReader)? = nil,
Expand All @@ -65,6 +67,7 @@
@available(macOS, deprecated: 9999, message: "Use '@FetchAll' and '#sql', instead")
@available(tvOS, deprecated: 9999, message: "Use '@FetchAll' and '#sql', instead")
@available(watchOS, deprecated: 9999, message: "Use '@FetchAll' and '#sql', instead")
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public static func fetchAll<Record: FetchableRecord>(
sql: String,
arguments: StatementArguments = StatementArguments(),
Expand Down Expand Up @@ -95,6 +98,7 @@
@available(macOS, deprecated: 9999, message: "Use '@FetchOne' and '#sql', instead")
@available(tvOS, deprecated: 9999, message: "Use '@FetchOne' and '#sql', instead")
@available(watchOS, deprecated: 9999, message: "Use '@FetchOne' and '#sql', instead")
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public static func fetchOne<Value: DatabaseValueConvertible>(
sql: String,
arguments: StatementArguments = StatementArguments(),
Expand All @@ -111,7 +115,7 @@
}
}

package struct AnimatedScheduler: ValueObservationScheduler, Hashable {
package struct AnimatedScheduler: ValueObservationScheduler, Equatable {
let animation: Animation
package func immediateInitialValue() -> Bool { true }
package func schedule(_ action: @escaping @Sendable () -> Void) {
Expand All @@ -123,6 +127,9 @@
}
}

@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
extension AnimatedScheduler: Hashable {}

extension ValueObservationScheduler where Self == AnimatedScheduler {
package static func animation(_ animation: Animation) -> Self {
AnimatedScheduler(animation: animation)
Expand Down
15 changes: 15 additions & 0 deletions Sources/SharingGRDBCore/FetchOne.swift
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init(
wrappedValue: sending Value,
database: (any DatabaseReader)? = nil,
Expand All @@ -853,6 +854,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init(
wrappedValue: sending Value,
database: (any DatabaseReader)? = nil,
Expand All @@ -875,6 +877,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<S: SelectStatement>(
wrappedValue: Value,
_ statement: S,
Expand Down Expand Up @@ -903,6 +906,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<V: QueryRepresentable>(
wrappedValue: Value,
_ statement: some StructuredQueriesCore.Statement<V>,
Expand All @@ -929,6 +933,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<V: QueryRepresentable>(
wrappedValue: Value = nil,
_ statement: some StructuredQueriesCore.Statement<V>,
Expand All @@ -955,6 +960,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<S: StructuredQueriesCore.Statement<Value>>(
wrappedValue: Value,
_ statement: S,
Expand Down Expand Up @@ -982,6 +988,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<S: SelectStatement>(
wrappedValue: Value = ._none,
_ statement: S,
Expand Down Expand Up @@ -1011,6 +1018,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init<S: StructuredQueriesCore.Statement>(
wrappedValue: Value = ._none,
_ statement: S,
Expand Down Expand Up @@ -1040,6 +1048,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public init(
wrappedValue: Value = ._none,
_ statement: some StructuredQueriesCore.Statement<Value>,
Expand Down Expand Up @@ -1067,6 +1076,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load<S: SelectStatement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
Expand All @@ -1088,6 +1098,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load<V: QueryRepresentable>(
_ statement: some StructuredQueriesCore.Statement<V>,
database: (any DatabaseReader)? = nil,
Expand All @@ -1107,6 +1118,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load<V: QueryRepresentable>(
_ statement: some StructuredQueriesCore.Statement<V>,
database: (any DatabaseReader)? = nil,
Expand All @@ -1126,6 +1138,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load<S: SelectStatement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
Expand All @@ -1148,6 +1161,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load<S: StructuredQueriesCore.Statement>(
_ statement: S,
database: (any DatabaseReader)? = nil,
Expand All @@ -1170,6 +1184,7 @@ extension FetchOne: Equatable where Value: Equatable {
/// (`@Dependency(\.defaultDatabase)`).
/// - animation: The animation to use for user interface changes that result from changes to
/// the fetched results.
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
public func load(
_ statement: some StructuredQueriesCore.Statement<Value>,
database: (any DatabaseReader)? = nil,
Expand Down