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

Improve error message when opening a .sqlite db with duckdb #401

Closed
garyrob opened this issue Jan 11, 2024 · 6 comments · Fixed by #407
Closed

Improve error message when opening a .sqlite db with duckdb #401

garyrob opened this issue Jan 11, 2024 · 6 comments · Fixed by #407
Labels
enhancement New feature or request

Comments

@garyrob
Copy link

garyrob commented Jan 11, 2024

Describe the bug
I can't connect to a database with Harlequin; I get an error involving DuckDB saying to INSTALL sqlite. sqlite does exist on my system and I have no problem using it with or without python.

To Reproduce
pip install harequin
Try to run it with harlequin /path/to/db

Expected behavior
It should connect to the database and do something useful.

Actual behavior

 DuckDB couldn't connect to your database. 
 IO Error: Extension "/xxxxx/xxxxx/.duckdb/extensions/v0.9.2/osx_amd64/sqlite_scanner.duckdb_extension" not found. 
Extension "sqlite" is an existing extension.                                                                        
Install it first using "INSTALL sqlite".                

Additional context
The output of harlequin --version is:

harlequin, version 1.9.2

Installed Adapters:
  - duckdb, version 1.9.2
  - sqlite, version 1.9.2

What database adapter are you using with Harlequin? (Default is DuckDB)
I'm just using the default.

Can you tell us more about your system?

  • Shell: zsh
  • Terminal: iTerm. Note however that I run iTerm under Rosetta because I want to use x86 software on my M1 Mac. So perhaps that has something to do with the issue.
  • OS of the shell: MacOS 14.2.1
@tconbeer
Copy link
Owner

I've gotten similar errors building some versions of python. SQLite should be installed when you install Python, but sometimes the linking breaks. I'd try re-installing Python (3.11 is latest supported)

@garyrob
Copy link
Author

garyrob commented Jan 11, 2024

I don't think that can be the problem, I was using dataset with sqlite3 with the same python installation. To be sure, I switched to another python3.11 installation and had exactly the same problem.

I will note that the error says: "/xxxxx/xxxxx/.duckdb/extensions/v0.9.2/osx_amd64/sqlite_scanner.duckdb_extension" not found.

And in fact, I have no .duckdb directory at all at the specified location. That seems like it's probably not a coincidence. Was harlequin supposed to create that directory, or do I have do already have duckdb installed and working in order to use harlequin??

@tconbeer
Copy link
Owner

Installing harlequin should automatically install duckdb, but it won't install the duckdb sqlite extension (https://duckdb.org/docs/extensions/sqlite.html).

If you're trying to open a sqlite database, you should invoke Harlequin with the -a sqlite option. Otherwise, it will use duckdb to try to open the file. With the duckdb-sqlite extension, duckdb can open sqlite databases, but I assume you are trying to connect using sqlite, not duckdb-sqlite?

@garyrob
Copy link
Author

garyrob commented Jan 11, 2024

Ah! Using -a sqlite does indeed get it to work! Thanks!

@garyrob garyrob closed this as completed Jan 11, 2024
@tconbeer
Copy link
Owner

glad that did it. I'll create an issue to improve the error message there; I'm sure this will be a common error.

@tconbeer tconbeer reopened this Jan 11, 2024
@tconbeer tconbeer changed the title INSTALL sqlite error Improve error message when opening a .sqlite db with duckdb Jan 11, 2024
@tconbeer tconbeer added the enhancement New feature or request label Jan 11, 2024
@tconbeer
Copy link
Owner

released in v1.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants