SQLite: no such module: fts5 error with System.Data.SQLite.dll 1.0.101.0
Asked Answered
R

2

8

I am using System.Data.SQLite.dll 1.0.101.0 and I get this error when execute the command "CREATE VIRTUAL TABLE tbl_fts USING fts5 (fld1, fld2)".

error: no such module: fts5

in this page we can see: 1.0.99.0 - December 9, 2015

•Add experimental support for the native json1 and fts5 extensions

https://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki

so what is the problem, and how can I enable fts5, should I rebuild System.Data.SQLite.dll? how can I do that?

thanks..

Redound answered 1/6, 2016 at 9:59 Comment(0)
R
15

here the solution, more than 6 hours of work until found it:

    MyConnection.EnableExtensions(True)
    MyConnection.LoadExtension("System.Data.SQLite.dll", "sqlite3_fts5_init") ''/// Or "SQLite.Interop.dll" as you need.

I understood that by this sentence: "Add experimental support for the FTS5 loadable extension. (user: mistachkin)"

http://system.data.sqlite.org/index.html/finfo?name=SQLite.Interop/SQLite.Interop.2010.vcxproj

Redound answered 2/6, 2016 at 21:43 Comment(2)
I only get a '...procedure not found'. Are you sure that this works for the actual SQLite v1.0.103?Emaciated
Yes I tested it with v1.0.103 with no problem. that error because you are using "System.Data.SQLite.dll" but you need to use "SQLite.Interop.dll" if not using 'static-binary-bundle' package. Also note that code must be after MyConnection.Open().Redound
C
1

In my case I was trying to call this from a .NET Core 2.1 project.

I didn't manage to get this working using System.Data.SQLite.dll so instead I referenced Microsoft.Data.Sqlite.dll (version 5.0.11). Since this is the package used by EntityFramework Core which does support FTS5.

Note when adding Microsoft.Data.Sqlite via NuGet that you need the package with that name and not Microsoft.Data.Sqlite.Core which does not include the native libraries needed for SQLite.

Cabby answered 15/10, 2021 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.