mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 16:07:01 +05:30
all: remove now unused to-do app code
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
63f5bea155
commit
06549bad2c
9 changed files with 0 additions and 451 deletions
|
@ -1,14 +0,0 @@
|
|||
package dev.msfjarvis.lobsters.data.model
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import java.time.LocalDateTime
|
||||
import java.time.ZoneId
|
||||
|
||||
@Entity(
|
||||
tableName = "todo_items",
|
||||
)
|
||||
data class TodoItem(
|
||||
@PrimaryKey val title: String,
|
||||
val time: LocalDateTime = LocalDateTime.now(ZoneId.of("GMT")),
|
||||
)
|
|
@ -1,18 +0,0 @@
|
|||
package dev.msfjarvis.lobsters.data.source
|
||||
|
||||
import androidx.room.Database
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.TypeConverters
|
||||
import dev.msfjarvis.lobsters.data.model.TodoItem
|
||||
|
||||
@Database(
|
||||
entities = [
|
||||
TodoItem::class,
|
||||
],
|
||||
version = 1,
|
||||
exportSchema = false,
|
||||
)
|
||||
@TypeConverters(DateTimeTypeConverters::class)
|
||||
abstract class TodoDatabase : RoomDatabase() {
|
||||
abstract fun todoItemsDao(): TodoItemDao
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package dev.msfjarvis.lobsters.data.source
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import dev.msfjarvis.lobsters.data.model.TodoItem
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
/**
|
||||
* Room [Dao] for [TodoItem]
|
||||
*/
|
||||
@Dao
|
||||
abstract class TodoItemDao {
|
||||
|
||||
@Query("SELECT * FROM todo_items")
|
||||
abstract fun getAllItems(): Flow<List<TodoItem>>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
abstract suspend fun insert(entity: TodoItem): Long
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
abstract suspend fun insertAll(vararg entity: TodoItem)
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
abstract suspend fun insertAll(entities: Collection<TodoItem>)
|
||||
|
||||
@Update(onConflict = OnConflictStrategy.REPLACE)
|
||||
abstract suspend fun update(entity: TodoItem)
|
||||
|
||||
@Delete
|
||||
abstract suspend fun delete(entity: TodoItem): Int
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue