You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you using any asynchronous thing to call your two operations?
I think that call the select right after the insert, without any asynchronous thing, should work. If you use two asynchronous methods, the second one can be called before the first one is done.
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I made my application with SQLite, SwiftUI, Combine, MVVM, etc.
Issue
And I needed some feature to refresh view when the database table changes in my app.
I implemented like,
And I encountered an error, saying "database is locked (code: 5)", like below.
The app crashed when I try select action right after insert action.
And I searched about this error, and I got some clue at this. -> Link
The problem was "conflict between two transactions running on the same database connection".
So, to fix this problem, I want to make the select work is done definitely after insert work.
Therefore, some reactive functionality can be helpful, so that only when the database table changes, app does select action again to refresh view.
Is there any technique to help reactive view refresh in point of SQLite local DB?
I found some possible method,
But, I have no idea how to actually implement like this. I need more detailed explain...
Build Information
I added SQLite version 0.13.2 with CocoaPods.
'SQLite.swift', '~> 0.13.2'
And I use Xcode version 14.1, macOS Monterey version 12.6.
Related Issue
I checked issue #686,
and I hope to know more information about that.
Any clues will be helpful.
With Love 🫶,
Thank you.
The text was updated successfully, but these errors were encountered: