coresmart / persistencejs

persistence.js is an asynchronous Javascript database mapper library. You can use it in the browser, as well on the server (and you can share data models between them).
http://persistencejs.org
1.72k stars 239 forks source link

Possibility of adapting for React Native #168

Open jsierles opened 9 years ago

jsierles commented 9 years ago

React Native runs in javascriptcore, but already has an adapter for SQLite. Could persistence.js work in it, given a proper adapter?

lukasredev commented 9 years ago

That's exactly the thought, that I had and I'am currently using the persistence in memory adapter to implement a simple app ( working fine so far ) and planning to create an adapter that works with react-native as soon as I get the time ( or some one else does it before I have to :D ) ....

My Idea was to create a persistencejs adapter, that uses the react-native AsyncStorage ... How would you use the SQLite database?

jsierles commented 9 years ago

Good to know it works already! asyncstorage is also a good idea, I'm just sqlite as there's already an adapter and I need SQL behavior at times. Here's the adapter I'm using now: https://github.com/almost/react-native-sqlite

lukasredev commented 9 years ago

And is it possible to use this adapter with persistencejs?

jsierles commented 9 years ago

Not out of the box, but it's not much work to adapt. I'll take a look!