使用带有域pre-填充数据库 [英] Use pre-populated databases with Realm
问题描述
我们怎么能SQLite数据库转换为境界的数据库?
How could we convert SQLite database to a Realm database?
有没有办法使用pre填充数据库与Android的领域?
Is there any way to use pre-populated databases with Realm on Android?
推荐答案
目前没有办法自动SQLite数据库转换为一种境界的数据库,你就必须从SQLite数据库手动读取所有数据,并把它们插入到境界。
Currently there is no way to automatically convert a SQLite database to a Realm database, you would have to manually read all data from the SQLite database and insert them into Realm.
这是另一种可能是浏览器领域,可能使这更容易,但它是目前适用于MacOS X的唯一。你可以点击这里阅读: https://github.com/realm/realm-java/issues / 435
An alternative could be the Realm browser that might make this easier, but it is currently available for MacOS X only. You can read more here: https://github.com/realm/realm-java/issues/435
有关第二部分:作为域数据库只是一个单一的文件,这样就可以轻松地将pre-居住境界数据库添加到您的应用程序和Realm.getInstance引用它()
For the second part: As Realm databases are just a single file so you can easily add a pre-populated realm database to you app and reference it with Realm.getInstance().
这篇关于使用带有域pre-填充数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!