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

Issue with reading SQLite database files in DuckDB WASM #1972

Open
booandrew opened this issue Mar 3, 2025 · 0 comments
Open

Issue with reading SQLite database files in DuckDB WASM #1972

booandrew opened this issue Mar 3, 2025 · 0 comments

Comments

@booandrew
Copy link

booandrew commented Mar 3, 2025

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

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