-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot bind buffer in Android #428
Comments
@maitre-piccolo Can you share your app so i can test and try fixing the issue |
I cannot share my app but I can share a test case using one of your starter app. Step 1 : Install this app https://github.com/jepiqueau/react-sqlite-app-starter Step 2 : Add the buffer package (npm install buffer) Step 3 : replace the file src/pages/Tab1.tsx with I added code in this file to create a table with a GUID field and then an example of inserting a buffer. This code triggers the problem I have. BTW, there seem to be a bindBlob function in android SQLite lib. |
@maitre-piccolo this has been fixed for iOS ans Android and will be in the next release late today |
@maitre-piccolo Can you test release 5.0.3-1 and give me your feedback |
Thanks, I just did a simple test and it seems to be working perfectly now. I'll test properly everything I have with GUID/buffer tomorrow and if all is good I'll close this issue :) |
Ok tested properly, everything is good for me, thanks again for the quick fix ! |
I have tested that with android it is working fine but with iOS I am getting this error thanks |
@rattata2023 can you send the url of the image that you try to save and the code you are using to store it in SQLite db. I have a test case and it works fine |
@jepiqueau thanks for the quick response I have tried to save base64 image here is my code async saveUserInfo(profile:any):Promise{
try { export const b64ToBlob = async (b64Image:string):Promise => new Promise(async (resolve,reject)=>{ |
@jepiqueau if you save a base64 image in the db as a blob you do not need to do this as it is a string so you can directly use the value returned in the image src.if the string returned does not start by something like "data:image/png;base64" if it is a png image do That is it |
@jepiqueau I was trying to save base64 image as blob in the db I am not storing bas64 image in the Db I have also tried with the testblobs.page.ts it stores base64 image and return base64 image . |
@rattata2023 Look at angular-sqlite-app-starter 5.0.2 i add a test to save base64 image as blob and it works fine. So you should be looking at your code |
ok thanks working now |
Hello,
I'm using GUID columns in my tables. GUID type is basically a BLOB/Binary type in SQLite.
In javascript we use Buffer to store the values of such fields.
With the web version of this plugin, the binding on insert works great.
But when testing the same code in android I get this error :
Error: Run: Cannot bind {"type":"Buffer","data":[17,238,5,240,250,46,224,16,157,33,165,212,107,42,117,113]} at index 1 Supported types: Null, ByteArray, Float, Double, Long, Int, Short, Byte, String
It seems that in android, it doesn't pass the Buffer directly but pass the result of Buffer.toJSON()
I can't figure a way to circumvent this issue.
Am I missing something or is it not supported yet ?
The text was updated successfully, but these errors were encountered: