Skip to content

Issue with reading SQLite database files in DuckDB WASM #1972

Open
@booandrew

Description

@booandrew

What happens?

I'm experiencing an error when trying to read tables from SQLite database files using DuckDB WASM in my application. When attempting to query a table from an attached SQLite database, I get errors indicating the table doesn't exist, even though it's present in the SQLite file.

To Reproduce

Steps to Reproduce

  1. Attach a SQLite database to DuckDB WASM:

ATTACH 'sakila.db' (TYPE sqlite);

  1. Try to read a table directly:

SELECT * FROM sakila.actor;

3.Get the following error:

-- Catalog Error: Table with name actor does not exist!
-- Did you mean "system.information_schema.table_constraints"?
-- LINE 1: select * from sakila.actor LIMIT 100 OFFSET 0

Failed to run query: Error: Error: INTERNAL Error: GetTableInfo - table "actor" not found
This error signals an assertion failure within DuckDB. This usually occurs due to unexpected conditions or errors in the program's logic.`

Alternative Approach Attempted

  1. I also tried using the sqlite_scanner extension:
INSTALL sqlite_scanner FROM 'https://extensions.duckdb.org';
LOAD sqlite_scanner;

FROM duckdb_extensions() WHERE loaded; -- confirms sqlite_scanner is loaded

FROM duckdb_databases; -- confirms sakila.db is in the list of databases

SELECT * FROM sqlite_scan('sakila.db', 'actor');
  1. This results in the same error:
INTERNAL Error: GetTableInfo - table "actor" not found
This error signals an assertion failure within DuckDB. This usually occurs due to unexpected conditions or errors in the program's logic.

After this error occurs, the database connection becomes invalid and cannot be accessed anymore.

I expect to be able to read tables from SQLite database files using DuckDB WASM, either through direct attachment or using the sqlite_scanner extension.

Browser/Environment:

Chrome 133.0.6943.142

Device:

MacBook Pro M

DuckDB-Wasm Version:

1.29.0

DuckDB-Wasm Deployment:

https://shell.duckdb.org/

Full Name:

Andrii Butko

Affiliation:

T1A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions