Connecting to DuckDB database



I'm very new to databasing, and I am trying to connect DataGrip to a DuckDB database. However, when I create the database file 


from the DuckDB python API , and try to connect via DataGrip, I receive the following error after clicking the 'Test Connection' button:

IO Error: Could not set lock on file error

Anyone run into similar issues? Any input would be valuable! Thanks in advance!

EDIT: The plot thickens. I now get this error when trying to connect to .duckdb file via DataGrip after disconnecting from python.

So it appears that DuckDB isn't stable yet, and this is causing issues when opening in DataGrip? On a side-note, is it possible to have simultaneous DB connections from both python and DataGrip? I was attempting to have simultaneous connections via python API and DataGrip during the first error.


The first error you observed

Could not set lock on file error

usually appears in various situations when one program locks access to the file, so other programs can't have it before unlocking. To access the file using DataGrip, you should close its connection with Python API.

The second error is about the version of our driver for DuckDB. Please, try to use a workaround provided in this comment to add a custom JDBC driver.


Awesome, thank you!


Please sign in to leave a comment.