Skip to content

Commit d74471c

Browse files
committed
Add fetch all request
1 parent 1f5374d commit d74471c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

DBClient/Core/DBClient.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ public protocol DBClient {
7676
}
7777

7878
public extension DBClient {
79+
80+
/// Fetch all entities from database
81+
///
82+
/// - Returns: Task with array of objects
83+
func fetchAll<T: Stored>() -> Task<[T]> {
84+
return execute(FetchRequest())
85+
}
7986

8087
/**
8188
Finds first element with given value as primary.

0 commit comments

Comments
 (0)