Hello,
Is there a way to get use store and retrieve
data
classes directly with exposed, something like:
Copy code
object Users : Table() {}
// Get list of users
val usersList: List<User> = Users.select { Users.city.eq("a city") }
//Insert users
val allUsers: List<User> = //list of users
val aUser: User = //User instance
Users.insertAll(allUsers) // Inserts everything in to the user table
Users.insert(aUser) // Inserts a single user in to the table.
i.e Something that automatically maps/converts rows to data classes when reading stuff, and vice versa when inserting.
c
codec
03/17/2020, 3:06 AM
depending on the fields your user data class contains.. it could look something like this:
without having to write it manually... Imagine if you have objects/data classes with 30+ fields (i.e 30+ table columns).
👍 1
Rasheed Sulayman
03/17/2020, 11:28 AM
Copy code
There is <https://github.com/TouK/krush> and also you could vote and suggest for
<https://github.com/JetBrains/Exposed/issues/24#issuecomment-566725685>
Thanks @tapac, this sounds like what i'm looking for.