realm / realm-browser-osx

DEPRECATED - Realm Browser for Mac OS X has been replaced by realm-studio which is cross platform.
https://realm.io
502 stars 54 forks source link

Save javascript model definitions #272

Closed ksibod closed 7 years ago

ksibod commented 7 years ago

Simple saving of model definitions in javascript for use in React-Native or node js. Saves all schema definitions into a single js file (It adds the Schema text after the actual table name). The schema consts are exported at the bottom of the file through module.exports. It might not handle every case but is at least a good start for exporting models from existing realm files!

screen shot 2017-02-01 at 12 07 49 am screen shot 2017-02-01 at 10 03 21 pm screen shot 2017-02-01 at 12 10 05 am
ksibod commented 7 years ago

Added some style and syntax fixes.

stel commented 7 years ago

Thank you very much for this PR, @ksibod! Will take a closure look on it as soon as possible ;)

ksibod commented 7 years ago

@stel No problem, thanks!

ksibod commented 7 years ago

@stel Got it thanks! I'll make these changes and push again

ksibod commented 7 years ago

@stel Updated and pushed

ksibod commented 7 years ago

@stel I apologize, I missed one of the cases! That should do the trick.

stel commented 7 years ago

Awesome, @ksibod! Merging it now, thank you very much!