Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / room / AGENTS.md
| 1 | # AGENTS.md — library/room/ (':library:room') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/room/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | <!-- last-reviewed: 2026-10-16 --> |
| 6 | - Gradle: :library:room / dir: library/room/ |
| 7 | - Package roots present: (pure-Kotlin Room3 + SQLCipher wiring — single package) |
| 8 | - Entry files: RoomRepository.kt (no MainActivity/Route — library) |
| 9 | - Deps: :library (permission-free; SqlCipherDbCodec implements base's DbBackupCodec, #884) |
| 10 | - Metadata: metadata_data/library-room.md (absent — libraries have none by design) |
| 11 | - Rust: no / screenshotTest: no |
| 12 | |
| 13 | ## Overview |
| 14 | **Purpose:** Room 3 + SQLCipher wiring for every app database. Apps never call `buildDatabase()` — they subclass `RoomRepository` and apply `implementRoom(libs)`. |
| 15 | **How to use:** `abstract class XxxRepository : RoomRepository` → `implementRoom(libs)` in the module build file → committed schemas under the app's `schemas/` (read single files only, never scan). |
| 16 | **Entry points:** `RoomRepository.kt` → `SqlCipher.kt`. |
| 17 | **Gotchas:** The literal string `androidx.room.` is lint-flagged even in comments — write `Room` in prose. Schema migrations must be tested with the actual old DB, not fresh installs. |
| 18 | |
| 19 | ## Key files |
| 20 | - com/vayunmathur/library/room/RoomRepository.kt — subclass this, never `buildDatabase()` |
| 21 | - com/vayunmathur/library/room/SqlCipher.kt |
| 22 | - com/vayunmathur/library/room/SqlCipherDbCodec.kt |
| 23 | |
| 24 | ## Verify (this module only) |
| 25 | ``` |
| 26 | ./gradlew :library:room:compileDevKotlin |
| 27 | ./gradlew :library:room:lint |
| 28 | ``` |