DuckDB Connector Locks DuckDB file
Steps To Reproduce
- Connect evidence to the needful things database in the example project
- (install and run the duckdb DB)
- run
.open needful_things.duckdb
Environment
- OS: MacOS 13.4.1
- Database: duckdb
Expected Behavior
Can access duckdb from another program
Actual Behaviour
Error: unable to open database "needful_things.duckdb": IO Error: Could not set lock on file "needful_things.duckdb": Resource temporarily unavailable
Is this happening while a query is running or just in general while the dev server is open?
In general while the dev server is open.
I suspect we arent closing the connection properly after running queries or something like that
Do you suspect this is an issue with the underlying library? or the way we are implementing it? https://github.com/motherduckdb/duckdb-async
No, it's because we never actually close the connection, so I would assume it just lasts until the dev server is closed or the GC picks it up
I might be wrong, but I think there isn't a close method implemented in duckdb-async?
I am wrong: https://github.com/motherduckdb/duckdb-async/blob/868886e3beac197c97fe30673f894938e806c646/src/duckdb-async.ts#L322
Yeah, we could just put await db.close() right after executing
I think this has been fixed w/ #1483's closeConnection callback