Skip to content
Merged
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
10 changes: 4 additions & 6 deletions Sources/GRDBQuery/Queryable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Combine

// See Documentation.docc/Extensions/Queryable.md
public protocol Queryable: Equatable {
/// The type of the published values.
associatedtype Value

/// The type that provides database access.
///
/// Any type can fit, as long as the `Queryable` type can build a Combine
Expand All @@ -14,7 +17,7 @@ public protocol Queryable: Equatable {

/// The type of the Combine publisher of database values, returned
/// from ``publisher(in:)``.
associatedtype ValuePublisher: Publisher
associatedtype ValuePublisher: Publisher where ValuePublisher.Output == Value

/// The default value, used until the Combine publisher publishes its
/// initial value.
Expand All @@ -28,8 +31,3 @@ public protocol Queryable: Equatable {
/// - parameter database: Provides access to the database.
func publisher(in database: DatabaseContext) -> ValuePublisher
}

extension Queryable {
/// The type of the published values.
public typealias Value = ValuePublisher.Output
}