-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Modify schema structure fails on iOS 14 #525
Comments
I was not aware of such function and I considered Personnally I find it scary to modify sqflite does not do anything special here and uses whatever sqlite version iOS 14 decides to ship so you might get better help asking some iOS 14 forums. |
Thanks @alextekartik for your quick reply, FYI: I follow the instructions from the SQLite alter table page (the 9 step example). I've had a bit of a dive further down into the stack around SQLite and FMDB and nothing was raising red flags. I'll close the issue and see what I can find out in the iOS ecosystem. |
Hi @alextekartik, Looks like defensive mode is the culprit. To disable it a connection parameter needs to be passed down to SQLite. |
Hey guys is there any workaround to make it work on iOS 14? My app stopped working since iOS 14 update |
I think sqflite could call |
…n iOS 14 using an ugly workaround
I published a workaround in in a dev version The String Could you let me know if that works for you @nikopolidi @JamesMcIntosh Thanks! |
Hi @alextekartik, thanks for the quick solution, sorry for the super-slow reply. I have given it a test on iOS 14.2 and the upgrade process work as expected. For my case I'm not too worried but were you going to have a PRAGMA command to flick the switch back off again? Where the docs talk about potential corruption it is pretty much a disclaimer to think about what you are doing, Many thanks |
On MacOS 10.13.6 getting error: use of undeclared identifier 'SQLITE_DBCONFIG_DEFENSIVE'. Works when I comment this out: // Handle Hardcoded workarounds
// Handle issue #525
if ([SqfliteSqlPragmaSqliteDefensiveOff isEqualToString:sql]) {
sqlite3_db_config(db.sqliteHandle, SQLITE_DBCONFIG_DEFENSIVE, 0, 0);
} |
Hi @developer-so, you should probably be opening a new ticket and mentioning this one as this ticket was closed. |
Hi @JamesMcIntosh, Ok! I want to know if it's an issue or if it's my setup tho, before opening a new issue. |
Hi @developer-so , The constant comes directly from SQLite: It was added in SQlite 3.26.0 Which version of SQLite are you using? |
sqflite: ^2.2.0+3. |
@developer-so That is the SQFLite version, not SQLite. Try running this query
|
OH! Ok! Never thought of it. Let me check... |
Thanks @JamesMcIntosh, That was it. Sqlite3 version on the osx was 3.19.3. The error went away when I used the sqflite_common_ffi package. I assume it comes with a later version. However querying |
You're welcome @developer-so FYI the reason it is working for you is that the "defensive" parameter check is only in this project (sqflite). See:
If you upgrade the version of SQLite you have on your Mac then you would be able to use this project sqflite rather than sqflite_common_ffi. Up to you which better suits you needs. I would still recommend upgrading SQLite anyway as 3.19.3 was release on 2017-06-08. |
Hmm.. Ok! Tried to upgrade. But eventualy ended up with with workarounds to point to different a version. The app was still reading from the default version on the system. It's an old mac I'm using as a dev env and I'm at an early stage of dev'ing this app. But this raised the point of safegaurding against external dependencies issues. |
During opening of the database I alter the original SQL and add foreign keys to the table and encounter a
table sqlite_master may not be modified
error. The only happens when I run on iOS 14.I have checked and
pragma writable_schema
is 1, so my expectation is that the table is writable.The only similar issue I could find is:
Nozbe/WatermelonDB#772
The text was updated successfully, but these errors were encountered: