Reputation: 15
Is there any way to create tables at runtime using room using existing schema?
Upvotes: 1
Views: 924
Reputation: 4956
Since room use @Entity
annotation to generate tables, I don't think you can create tables at runtime simply using Room.
But room is just a wrapper for Sqlite, you can fall back to Sqlite and SQL and then manipulate database.
RoomDatabase
has lots of helpers. For example, yourRoomDatabase.getOpenHelper().getWritableDatabase()
returns a traditional writable database. Just like old days.
Upvotes: 2