File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
persistence/src/commonMain/kotlin/com/quran/shared/persistence/repository Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.quran.shared.persistence.repository
2+
3+ import com.quran.shared.persistence.DriverFactory
4+ import com.quran.shared.persistence.makeDatabase
5+
6+ /* *
7+ * Factory for creating PageBookmarksRepository instances.
8+ * This factory hides the details of database creation and provides a clean interface
9+ * for obtaining repository instances.
10+ */
11+ class PageBookmarksRepositoryFactory {
12+ companion object {
13+ /* *
14+ * Creates a new instance of PageBookmarksRepository.
15+ * The repository is backed by a SQLite database created using the provided driver factory.
16+ *
17+ * @param driverFactory The driver factory to use for database creation
18+ * @return PageBookmarksRepository A new repository instance
19+ */
20+ fun createRepository (driverFactory : DriverFactory ): PageBookmarksRepository {
21+ val database = makeDatabase(driverFactory)
22+ return PageBookmarksRepositoryImpl (database)
23+ }
24+
25+ /* *
26+ * Creates a new instance of PageBookmarksSynchronizationRepository.
27+ * This repository provides synchronization-specific operations for page bookmarks.
28+ *
29+ * @param driverFactory The driver factory to use for database creation
30+ * @return PageBookmarksSynchronizationRepository A new synchronization repository instance
31+ */
32+ fun createSynchronizationRepository (driverFactory : DriverFactory ): PageBookmarksSynchronizationRepository {
33+ val database = makeDatabase(driverFactory)
34+ return PageBookmarksRepositoryImpl (database)
35+ }
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments