prsn / redux-persist-sqlite-storage

A redux-persist store adaptor that uses SQLite to persist store
MIT License
40 stars 7 forks source link

Error storing data Operation is not allowed when DB is closed! #4

Open genesiscrew opened 5 years ago

genesiscrew commented 5 years ago

Hi, Im using this package with expo and redux-persist, ive followed the example code, and i have function that passess the create store and persistor object which are then wrapped to the react code as follows:

} persistor={persistor}> {Routes}
prsn commented 5 years ago

Hi @genesiscrew , Thanks for trying out, I'm not sure how it will behave with expo I haven't tested on expo though, but there is one fork which is modified to work with expo, you can try that https://github.com/AGIsmail/redux-persist-sqlite-storage

Let me re-run the example to see if I face the same issue. BTW, can you please let me know which version of RN you are using?

genesiscrew commented 5 years ago

Thanks for that, it works now, however im still having the issue of data more than 6MB not being stored on android. the main reason why i want to use sqlite is because asynstorage has a limit of 6MB of storage for android, and i used to get error of storage is full. Now after using sqllite and your modified wrapper, the error does not show, however it is not able to save data more than 6MB on android, any ideas as to why this is happening?

genesiscrew commented 5 years ago

@prsn im also using "react-native": "^0.54.2",

genesiscrew commented 5 years ago

its also crashing on android, i think it still has memory limit on android.

prsn commented 5 years ago

Hi @genesiscrew , thanks for the inputs, not sure why this error message is shown, but I have also encountered this error message today for the example projects, which ran perfectly when I first release this library.

Not sure if 6MB data is huge or not, but SQLite can store more than this size that is for sure. Will look into this soon.

genesiscrew commented 5 years ago

@prsn Actually there are no error messages now, so im not sure why SQL lite with your wrapper doesnt worl for dat more than 6MB, it works only for small amounts of data. what could be the reason?

prsn commented 5 years ago

Not sure @genesiscrew , but I am planning to test it with more data today. Will let you know my findings.

genesiscrew commented 5 years ago

@prsn thanks. i might be wrong but i think the issue is with the Expo version of Sqllite, but its impossible to debug since no errors are being generated...