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..

user2241289
  • 345
  • 2
  • 13

2 Answers2

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

user2241289
  • 345
  • 2
  • 13
  • I only get a '...procedure not found'. Are you sure that this works for the actual SQLite v1.0.103? – PeterCo Nov 28 '16 at 10:58
  • 3
    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(). – user2241289 Nov 30 '16 at 07:54
0

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.

Underscore
  • 1,017
  • 2
  • 10
  • 26