원클릭으로
modify-room-database
Instructions for modifying the Room caching database in MemosM.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Instructions for modifying the Room caching database in MemosM.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Instructions for adding a new API endpoint handling versioning backward compatibility in MemosM.
Instructions for scaffolding a new Jetpack Compose screen or component and using Koin for ViewModel injection in MemosM.
| name | Modify Room Database |
| description | Instructions for modifying the Room caching database in MemosM. |
MemosM uses Android Room for local caching.
Entities are located in app/src/main/java/org/example/memosm/data/cache/. Define your data class and annotate it with @Entity.
@Entity(tableName = "my_custom_table")
data class CachedData(
@PrimaryKey val id: String,
val content: String
)
Add query methods to app/src/main/java/org/example/memosm/data/cache/MemoDao.kt (or create a new DAO).
@Dao
interface MemoDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertData(data: CachedData)
}
Note: If you create a new DAO, expose it in MemoCacheDatabase.kt and provide it in Koin (Modules.kt).
If you changed an existing entity or added a new one, you must increment the version in MemoCacheDatabase.kt.
@Database(
entities = [CachedMemo::class, CachedData::class],
version = 2, // <-- Increment this
exportSchema = false
)
abstract class MemoCacheDatabase : RoomDatabase() { ... }
In a production app, you should also provide a Migration block, but depending on the user requirements, a simple destructive migration (fallbackToDestructiveMigration()) might be used if it's just a pure cache. Check existing logic in MemoCacheDatabase.kt to follow the project's strategy.