-
-
Notifications
You must be signed in to change notification settings - Fork 727
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
FT3/FTS5 issues #80
Comments
Hello @hdlj,
I'm not familiar with the SQLITE_CANTOPEN error. What specific option did you use in your custom SQLite build?
I have a slight idea about the problem, but I need your help: please provide some code that can run in a playground. |
Second answer
Lacking context, I'll assume you are getting your SQLITE_CANTOPEN error when you open, with a FTS5-enabled custom build, a database created with a regular FTS3-enabed SQLite. The very first question you have to ask yourself is whether FTS5 is compatible with full text indexes created by FTS3. If not, follow the recommended practice for migrating - it may involve dumping the content of the old database in a new one, I don't know.
I may have been hard asking for a playground. I just need some code I can paste in a project, make it run, and see the error - I'll answer with a code change recommendation, or a change in GRDB so that it better supports your need. |
Hello @groue, Thanks for your answers! I have tested the custom sqlite with a new database and with different simulators and the error still happens.
I try it also with the provided example (SQLITE_ENABLE_JSON1). I will ask this question on the SQLiteLib project also. I will keep you update if I find a solution.
Here is the setup code using a DatabasePool :
then the following code issue the error:
The following precondition:
contains this database event kind:
Thanks ! |
OK SQLite announces that the statement I'll try to have GRDB work around this SQLite oddity. Stay tuned. |
About your custom FTS5 build and SQLITE_CANTOPEN: I recommend you keep on investigating. I have no particular useful experience on this topic, and there's no reason you can't have SQLite open your database. For the record, |
Thanks a lot for the fix! |
Hello groue, For the custom sqlite issue. If found something. I explain it in this thread swiftlyfalling/SQLiteLib#7 |
Hello groue,
Thanks for GRDB!
I am trying to use it with a custom sqlite version (including the FTS5 module).
With the GRDB target, everything works well.
However when I use the GRDBCustomSQLite target, this piece of code throws a SQLite 14 error:
let db = try! DatabaseQueue(path: file)
I have followed the steps you recommend without success, do you have any idea of what I've missed?
I was using the GRDB 0.67.0 before and I was able to do a FTS query with the fts3 module. However, when I execute the same code on the version 0.74.0, It crashes because of the following precondition:
GRDBPrecondition(observer.databaseEventKinds.isEmpty, "Invalid statement type for query \(String(reflecting: sql)): use UpdateStatement instead.")
Actually during a FTS query, the observer contains an Update Event which makes the query crash.
What do you think is the workaround here?
Thanks in advance for your answers!
hdlj
The text was updated successfully, but these errors were encountered: