duckdb / sqlite_scanner

DuckDB extension to read and write to SQLite databases
MIT License
189 stars 19 forks source link

Invalid Error: Failed to prepare query "PRAGMA table_info('non_fiction_fts')": no such module: fts5 #58

Closed palmaresk8 closed 8 months ago

palmaresk8 commented 11 months ago

What happens?

I use LibgenDesktop to download/update the book database from Library Genesis in SQLite format, and them execute some SQL scripts to search for newly added books from several subjects.

When I try to use sqlite_scanner extension to open the database, I get this message:

Invalid Error: Failed to prepare query "PRAGMA table_info('non_fiction_fts')": no such module: fts5

Although it looks like an error and interrupts the script execution, I still manage to execute the SQL queries afterwards.

I do not have any issues opening the database or querying data when I just use SQLite itself.

Maybe enable FTS5 when compiling SQLite by default in sqlite_scanner? Not sure if what I'm saying make sense.

To Reproduce


/* Load database */

LOAD sqlite_scanner;
SET GLOBAL sqlite_all_varchar=true;

-- This CALL raises the Error: Invalid Error: Failed to prepare query "PRAGMA table_info('non_fiction_fts')": no such module: fts5
CALL sqlite_attach('D:\Portable\PortableApps\LibgenDesktop.Portable.64-bit\libgen.db', overwrite=true);

/* Describe tables */

SHOW tables;
DESCRIBE non_fiction;

/* R programming books */

SELECT Title, Authors, "Year", AddedDateTime
FROM NON_FICTION NF
WHERE (Title LIKE '% R' OR Title LIKE '% R %' OR Title LIKE 'R %') 
    AND "Year" IN ('2020', '2021', '2022', '2023')
    AND AddedDateTime::TIMESTAMP >= '2023-04-01T00:00:00'::TIMESTAMP
    AND Format = 'pdf'
ORDER BY AddedDateTime DESC;

OS:

Windows 11 x64

SQLite Version:

sqlite_scanner bundled with DuckDB 0.8.1

DuckDB Version:

0.8.1

DuckDB Client:

Python, JDBC (DBeaver)

Full Name:

Fabio Vaz

Affiliation:

Myself

Have you tried this on the latest master branch?

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

Mytherin commented 8 months ago

Thanks for the report! This should be fixed with #70