UPDATE(2021/02/12)
Created PouchDB@7 for React Native
Takuya Matsuyama ・ Feb 12 '21
...
For further actions, you may consider blocking this person and/or reporting abuse
Looks good. I wonder if it's possible to polyfill the buffer logic rather than forking pouchdb to sort the attachment issue. Otherwise, might be worth putting together a PR for a new option to the PouchDB repo for forcing base64 when buffers are not supported/available.
I've tried rn-nodeify to polyfill
Buffer
but it didn't solve the issue.Thanks so much for putting this together! I tried out the demo and it worked great. I was surprised to see that you have a simple "hello, world!" text encoded as base64. Why did you do that? Do all attachments have to be base64-encoded with your method?
That's because I wanted to demonstrate storing attachments works fine on RN apps. "Hello, world" text is useful for that.
Right. All attachments must be encoded in base64 to let PouchDB avoid calling
readAsBinaryString
.Hi takuya,
I apply your changes but still I cannot see the base64 image. I can see the _attachment field but with a weird format (maybe blob)
But when the synchronization tries to download the image back to the device its in a wrong format.
I can see the attachment has this form: 77+977+977+....9AAAA....
Could you please advise how did you solve this?
Thanks a lot in advance
I have the same problem, image attachment has a weird format with 77+9UE5HDQoaCgAAAAAAAAAA...
I think it still a blob type since the structure of this object is like this:
Thanks, wanted to mention the same. You're right, except there are some issues with attachments (see github.com/stockulus/pouchdb-react...), but they are working on it.
Sorry to say, but it doesn't and they dont, unfortunately. Project seems to be abandoned, look at open issues.
Sure you can still use it if you don't need replication (what?), but asyncstorage would be easier.
Replication does work, but not attachment.
I am getting this error
TypeError: WebSqlPouchCore.call is not a function
hi, how did you solve this issue please ?
Where are these SQLite DBs located on the phone? Does it exist in the app installation directory and will get removed upon app un-installation? If so, is there any DB that I can store outside the scope of the app installation so that it doesn't get removed after un-installation?
Asking because building a very offline first accessible app where the user might not be aware enough to know that uninstalling the app might lose all offline data.
You can see this
How to See SQLite Database Data Saved in Device using Android Studio
Hi! would it be possible to use this in order to have a preloaded database (including indexes) in a react-native app? thanks!
Yes you can, You just need to do some addition things
Example to Load Pre Populated SQLite Database in React Native
Thank you so much!
the example does not work : see issue
こんにちは Takuyaさん,
Thank you for your great work!
In the section "polyfill functions that PouchDB needs" why is "events" required to be installed?