Any way to convert Realm database file in to sqlite?

百般思念 提交于 2019-12-07 02:15:30

问题


I have realm database (.realm) from an existing application, which has more than 400k records.

I dug my head in to this for more than 3-4 hours, but I couldn't find any fruitful results towards converting a .realm file in to a sqlite file.


回答1:


Any data conversion so far has been done manually. People have converted from Core Data to Realm by grabbing the objects from Core Data and then saving them to a Realm.

I imagine your best bet will be similar here. Grab each object from the Realm and then convert it to the tables/rows/and columns in sqlite. Then you can take that file anywhere.




回答2:


I'm not at home with this, but I found this link hopefully it can help.




回答3:


You can open the realm file in Realm Browser & there you have the option to convert the file in to CSV ( File => Export => CSV ). Then you can import that CSV file to mysql database.

If you want sqlite more specifically, You can import tables separately to your sqlite db through SQLiteBrowser . Create or open your database file and select the specific table you want , then you can import table from CSV.



来源:https://stackoverflow.com/questions/29317258/any-way-to-convert-realm-database-file-in-to-sqlite

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!