How to Store Image in SQLite Database in React Native

Viewed 780

I have taken an image with Image Picker and want to store it in sqlite database and retrive it. Should I store uri which I got in reponse from Image Picker or what should I do,

Thanks!

2 Answers

My honest opinion is to use a dedicated storage space for your images, and store the url and the image meta data in your database.

You can store your image as a base64, however this will take up a lot of space in your database, and the conversion to base64 and back to binary may even make the image size bigger.

Stick to a storage solution for your image (Both Google and AWS offers them), and save the url in your database.

Regards
Stephan Bakkelund Valois

you have to save image in local storage and save uri of that in SQLite. that's way is the better performance .

Related