>>101929179
>You can't manipulate tables via DDL and the types system is not enforced,
Us androidchads solved this with room like 5 years ago
>Type system with type converters built in (want to use a date object? Np, just convert it into whatever primitive you want)
>Automatic database migrations
>Data access objects that represent entities and their operations
This makes sql literal babby tier. Here's what the CRUD codebase for a user table looks like:
@Dao
interface UserDao {
@Query("SELECT * FROM user")
fun getAll(): List<User>
@Query("SELECT * FROM user WHERE uid IN (:userIds)")
fun loadAllByIds(userIds: IntArray): List<User>
@Query("SELECT * FROM user WHERE first_name LIKE :first AND " +
"last_name LIKE :last LIMIT 1")
fun findByName(first: String, last: String): User
@Insert
fun insertAll(vararg users: User)
@Delete
fun delete(user: User)
}
Yes, that's literally it. You just use the functions with your user object and the database does the rest