Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting errors when creating a VIRTUAL table for Full Text Search with SQLite extension #128

Open
kuatroka opened this issue Jan 13, 2025 · 0 comments

Comments

@kuatroka
Copy link

What happens?

Getting an error when using SQLite extension to create a full text search table in SQLite through VIRTUAL table mechanism
code example

fts_table_name = 'cik_md'
if any(fts_table_name in table for table in tables_duckdb): 
    duckdb_con.execute(f"""
        CREATE VIRTUAL TABLE {SQLITE_DB_NAME}.site_search_fts USING fts5(
            code,
            name,
            category UNINDEXED,
            updated_at UNINDEXED,
            tokenize='unicode61 remove_diacritics 2'
        );
    """)
    
    # Populate the FTS table with data from the 'cik_name' table
    duckdb_con.execute(f"""
        INSERT INTO {SQLITE_DB_NAME}.site_search_fts (code, name, category)
        SELECT cik AS code, cik_name AS name, 'investor' AS category
        FROM {SQLITE_DB_NAME}.{fts_table_name};
    """)
    ```
    
** The error**


ParserException Traceback (most recent call last)
File :36

ParserException: Parser Error: syntax error at or near "VIRTUAL"

    

### To Reproduce

Try creating a full text search table in SQLite with Duckdb's SQLite extension

### OS:

mac os

### SQLite Version:

3.47.2

### DuckDB Version:

1.1.3

### DuckDB Client:

python

### Full Name:

kuatroka

### Affiliation:

kuatroka

### Have you tried this on the latest `main` branch?

- [X] I agree

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

- [X] I agree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant