-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core Data to React Native Realm #584
Comments
At this point you will need to write new ObjectSchema objects for each Core Data type you want to support. Unless you have a huge number of objects this shouldn't be too difficult to do by hand. It may be possible to write tools to generate the JSON schema automatically but we haven't spent any time working on this. |
@alazier so, in theory I just have to re-define the objects (on the React Native side) as they are defined in Core Data (objective-c side) and I will be able to use the existing data and add new one? My main issue is in not understanding if Core Data (objective-c) -> Realm (React Native) is possible. When it seems pretty straightforward on the native side (https://realm.io/news/migrating-from-core-data-to-realm/). |
You could migrate to Realm using the cocoa api - as long as your schema is identical, realms created using the cocoa api will be usable using the React-Native binding. That is probably the most straightforward approach if you want to migrate over existing data. |
This means if I re-write the schema with Realm React Native and query it, I should be able to see data if I have correctly migrated the Core Data to Realm Objective-C, right? Sorry If I ask again, just want to be sure. The cocoa API migration didn't seem a problem, I wasn't sure if I could use the data with the RN binding. |
@alazier ? |
All Realm products can share files, so you can generate data from ObjC and read it in RN - no problem as long as you obviously match the models. |
Okay, perfect. I didn't know that. |
Hi guys,
I do have an existing iOS native app that is running on Core Data. I was wondering if it was possible to port, in some way, the whole Core Data data model to React Native Realm, as I am re-writing the app in React Native. This would help me a lot since I also need to ship it on Android (and I want to have the same data model on both).
I haven't found anything related to this, apart from a migration from Core Data to Realm on the native side.
The text was updated successfully, but these errors were encountered: