How can I enable FTS5 in SQLite?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
waheed
Posts: 18
Joined: Mon 02 Nov 2009 19:47
Location: Kuwait

How can I enable FTS5 in SQLite?

Post by waheed » Sat 11 May 2019 06:10

I'm using UniDAC 7.4, but I don't see where I enable FTS5 for SQLite. FTS5 is included in v.3.9 but not enabled by default except when I use "--enable-fts5" option when running the configure script. https://sqlite.org/fts5.html
But where can I enable it in UniConnection?
I'm using DirectMode=True

I found this in the documentation:

Code: Select all

UniConnection.ExecSQL('SELECT load_extension(''C:\ext.dll'', ''sqlite3_ext_init'');');
so I replaced it by:

Code: Select all

UniConnection1.ExecSQL('SELECT load_extension(''C:\sqlite\sqlite3.exe'', ''sqlite3_fts5_init'');');
But still it didn't work, it gave me (The specified procedure could not be found) error

MaximG
Devart Team
Posts: 1445
Joined: Mon 06 Jul 2015 11:34

Re: How can I enable FTS5 in SQLite?

Post by MaximG » Wed 15 May 2019 08:09

Please follow the steps to work with FTS5 and UniDAC in Direct Mode:

1. Compile Loadable Extension with FTS5 support as described in the docs: https://www.sqlite.org/loadext.html. On Windows, you’ll get a DLL file – you can name it fts5.dll, for example.
2. Enable support for Loadable Extension : UniConnection.SpecificOptions.Values['EnableLoadExtension'] := 'True';
3. Set the path to fts5.dll when downloading the extension (for example, to C:\fts5.dll): UniConnection.ExecSQL('SELECT load_extension(''C:\fts5.dll'', ''sqlite3_fts5_init'');');

The next version of UniDAC will support FTS5 in Direct Mode by default.

waheed
Posts: 18
Joined: Mon 02 Nov 2009 19:47
Location: Kuwait

Re: How can I enable FTS5 in SQLite?

Post by waheed » Tue 02 Jul 2019 15:26

"The next version of UniDAC will support FTS5 in Direct Mode by default."

Does the new version support it?

MaximG
Devart Team
Posts: 1445
Joined: Mon 06 Jul 2015 11:34

Re: How can I enable FTS5 in SQLite?

Post by MaximG » Wed 03 Jul 2019 10:14

We were going to support FTS5 in Direct Mode in the latest version of UniDAC, however, we hadn't been able to ensure stable operation in all supported modes. For that reason, we haven't added this capability in the latest version of our driver.
We'll continue to work on adding support for FTS5 and we'll update you on the progress.

waheed
Posts: 18
Joined: Mon 02 Nov 2009 19:47
Location: Kuwait

Re: How can I enable FTS5 in SQLite?

Post by waheed » Wed 03 Jul 2019 18:25

Anxiously waiting for it. Thanks

Meanwhile, if there is any one out there able to create a SQLite version with built-in FTS5 support enabled so I can connect to it in indirect mode, I will greatly appreciate it.

MaximG
Devart Team
Posts: 1445
Joined: Mon 06 Jul 2015 11:34

Re: How can I enable FTS5 in SQLite?

Post by MaximG » Thu 04 Jul 2019 12:03

We can prepare and send you a nightly build of our product with support for FTS5. What are your primary platforms (Win32, Win64, MacOS etc.)? Please send us your license key and IDE version number via e-support form https://www.devart.com/company/contactform.html

Post Reply