capacitor-community / sqlite

Community plugin for native & electron SQLite databases
MIT License
426 stars 104 forks source link

BLOB binding issue in iOS #514

Closed maitre-piccolo closed 2 months ago

maitre-piccolo commented 3 months ago

Describe the bug Hi, last year I reported this issue related to blob. The issue was fixed, but in iOS there is still one related issue left.

In both Android and iOS you can insert and retrieve buffers. More importantly you can bind a buffer while doing an insert. But you cannot, in the same manner, bind a buffer while doing a select. Well, you can in Android, but you can't in iOS. It's important because such buffer can be used to store GUID, so you have to be able to query them using "where" clause.

I hope I didn't miss something.

To Reproduce Steps to reproduce the behavior:

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 Tab1.txt

(Of course be sure to revert the extension to tsx)

I added code in this file to create a table with a GUID field and then an example of inserting a buffer, and then an example of selecting using a buffer. The last part of the example (bold) triggers the problem I have in iOS.

I hope I didn't miss something.

Expected behavior When binding a buffer in where clause of select statement, this should work in iOS as it does already in Android.

jepiqueau commented 2 months ago

@maitre-piccolo fixed in v5.6.1-2 can you check and revert to me

maitre-piccolo commented 2 months ago

@maitre-piccolo fixed in v5.6.1-2 can you check and revert to me

@jepiqueau Did some tests, seems to be working great. Thanks for the work !