How to add table at run time in sugar ORM

279 views Asked by At

My android application is using SUGAR ORM, that's working fine.

But now I have to add new table in the DataBase at run time, I am getting data from server and according to that I have to create some new tables.

How can I achieve it while using Sugar ORM.

1

There are 1 answers

0
Tyler Kiser On

Well this is not really what Sugar ORM is about. Sugar is just a nice little layer that sits on top of a SQLite db, and makes it very easy to manage. You create classes (the objects) and use methods from Sugar that it interprets and performs the appropriate queries against the db file.

If you want to add tables, you will need to use just regular queries against your db. Information on how to do this (with examples!) is found in the Android dev docs: https://developer.android.com/training/basics/data-storage/databases.html