-
Notifications
You must be signed in to change notification settings - Fork 121
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
sqlite statement with two "UPDATE" works in web but not in android #393
Comments
@folsze clone your app try to run it and get
So if you do not me wasting my time please make sure that when you give a app which reproduces the bug, this app works. I am not sure that the schema of your database is correct in the way you define the link between your tables |
@folsze i also do not see the |
Ok sorry my bad I definitely should have checked and downloaded it myself before posting here. I will update it now right away. |
Thank you for your comments. I will review and try all things you said. I will see if those things fixed the bug and close this issue if they do, if you agree that's the right thing to do. Also let me know if I can/should provide any more info in some way or do anything. UPDATE: I will still try to fix the error myself by trying the things you suggested with ON UPDATE CASCADE and will review the database schema. |
Hey @jepiqueau I just went to my dad today, he has MacOS too. I set the project up on his laptop (XCode emulator AND on my iPhone) and the project was able to start without the "Assertion Failed" or "table not found" that you mentioned being triggered. This assertion error probably means that something failed with inserting initial data. And that probably because the creation of the database probably fails. I pushed the ios folder that it worked with for me to the repo. Maybe you could try running it with this one? Let me know if it still doesn't work. About DELETE: UPDATE: I appreciate you taking your time to look into this. Let me know if I can be of any help |
I managed to fix it. It works after I split the statement containing multiple update statement into multiple single UPDATE statements. And await each statement to finish first. I don't see any reason to investigate this further but maybe it would be good to tell people through the documentation that there might be issues if they pack multiple statements into one statement and just run them all in one statement. But maybe I just did things wrong 🤷 |
@folsze may be you should make a PR to the API.md documentation to warn on this. |
@folsze send me the API.md modified on jepi.queau@free.fr and i will replace it in the next releasethanks for this |
Didn't figure out right away how to do it right away and then I was busy but I now created a PR: |
I created a minimal reproducible example, I ket it very simple for you to understand it quickly:
https://github.com/folsze/ionic-capacitor-sqlite-update-bug
Describe the bug
I have a sqlite statement with two relevant "UPDATE" statements inside it. It works in web but not in android.
In android only one of the update statements gets executed, the other one is not.
To Reproduce
Click this:
Now this looks good, the progress of the first map & the first mode gets updated from 0 -> 0.3:
BUT ON ANDROID:
Click this:
Here it does not update the mode (it stays 0), only the map 0 -> 0.3:
Desktop (please complete the following information):
Windows Google Chrome
Smartphone (please complete the following information):
PIXEL XL 33 API emulator, ran through Android Studio
Additional things:
I would like to know how the two databases (android sqlite database, web sqlite-wasm database) roughly differ. Is there any explanation or any reason why they are different? I have experienced the two behaving slightly different on a lot of occasions. See my Q&A question:
#389 (comment)
The text was updated successfully, but these errors were encountered: