Open xuxiaocheng0201 opened 3 months ago
Error: no such function: fts5 in SELECT fts5(?1) at offset 7
Caused by:
Error code 1: SQL error or missing database
I also tested sqlite-regex = "0.2.3"
, but the same error.
Oooh that's not good. I think this has to do with a bug from a previous version of sqlite-regex
, where it would accidentally link it's own version of sqlite3
instead of what rusqlite
created. I thought it was fixed in 0.2.4-alpha.1
.
I'm having trouble reproducing - I ran what you have but it seemed to work fine. A few questions:
cargo clean
before running that code-snippet? Hoping it's not some lingering build artifacts in target/
that's causing the issuesqlite_version()
In your code-snippet, before calling fts5()
? The latest published version that rusqlite has should be 3.45.1
, but for some reason locally I'm getting 3.45.0
Thanks for reporting!
I just run cargo clean
, but unfortunately it output the same error.
The sqlite_version()
is 3.39.4
. I searched the source codes, it's in sqlite3ext-sys
.
I cloned your two repositories, it works. and the sqlite_version()
is 3.45.0
Ok cool, thanks for the info! So it does appear to be the issue I alluded to earlier - the 3.39.4
version definitely comes from sqlite3ext-sys
, which should not be linked to in this case. That linked sqlite3 version also probably doesn't compile in the fts5
extension, which is causing the original error you reported here.
The sqlite-loadable
crate is what depends on sqlite3ext-sys
. However, when the static
feature is enabled, it instead links to libsqlite3-sys
. So the goal should be to enable the static
feature on sqlite-loadable
, which avoids sqlite3ext-sys
and won't overwrite the sqlite3
linking.
Could you try something like this in your Cargo.toml?
sqlite-loadable = { version = "0.0.6-alpha.6", features=["static"]}
I tried this locally but ran into some version conflicts. Might need to push a new update to sqlite-regex
for a proper fix
I encountered the same version conflicts.
error: failed to select a version for `libsqlite3-sys`.
... required by package `sqlite-loadable v0.0.6-alpha.6`
... which satisfies dependency `sqlite-loadable = "^0.0.6-alpha.6"` (locked to 0.0.6-alpha.6) of package `tester v0.1.0 (D:\Projects\tester)`
versions that meet the requirements `^0.26.0` are: 0.26.0
the package `libsqlite3-sys` links to the native library `sqlite3`, but it conflicts with a previous package which links to `sqlite3` as well:
package `libsqlite3-sys v0.28.0`
... which satisfies dependency `libsqlite3-sys = "^0.28.0"` (locked to 0.28.0) of package `rusqlite v0.31.0`
... which satisfies dependency `rusqlite = "~0.31"` (locked to 0.31.0) of package `tester v0.1.0 (D:\Projects\tester)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "sqlite3"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
failed to select a version for `libsqlite3-sys` which could resolve this conflict
Hi, I created a PR that may fix the conflicts. I hope you can merge it.
When I was loading this extension, the
fts5
function was missing.Used
sqlite3_auto_extension
inrusqlite
Dependencies
Code
But when I comment out these lines:
it works.
Is there any error in my code? I'm curious why, these should be two unrelated extensions.