[Gambas-user] [DMARC]Re: sqlite full text search i.e. virtual tables

jose.rodriguez at cenpalab.cu jose.rodriguez at cenpalab.cu
Mon Sep 4 02:16:54 CEST 2023


On 2023-09-02 09:18, BB wrote:
> On 2/9/23 10:20 pm, Benoît Minisini wrote:
>> Le 02/09/2023 à 08:16, BB a écrit :
>>> Do we support queries on sqlite virtual tables? I am trying to 
>>> implement a full text search on names in 3 tables. sqlite3 has a full 
>>> text search (FTS) facility that seems to work quite well after 
>>> limited testing* but I can't seem to get access to it via gb.db 
>>> conn.Find() or conn.Exec().
>>> 
>>> The info on sqlite FTS can be found here 
>>> <https://www.sqlite.org/fts5.html>.
>>> 
>>> Any clues?
>>> 
>>> tia
>>> 
>>> Bruce
>>> 
>>> * I can add, delete and change the base tables and can successfully 
>>> "update" the FTS "table". Queries executed outside Gambas work fine. 
>>> The search table has two columns, name and type where type is 
>>> "person", "building", "place". A simple query on the FTS would be 
>>> something like "SELECT * FROM namesrch WHERE name MATCH 'Haricot';"
>>> 
>> 
>> The Exec() method allows you to run any SQL request, so I don't see 
>> why you couldn't use this SQLite extension.
>> 
>> Regards,
>> 
> Aaaargh! 3 hours ago it didn't work, now it does.
> 

That's par for the course. I find that after squeezing your brains and 
the docs, then a hefty bout of googling, an ep of your current goto TV 
series plus a drink or two (the latter is most important, hehehe) makes 
everything suddenly just falls into place.

Regards,
Joe1962



More information about the User mailing list