When creating RMarkdown documents, I tend to get the following error message, sometimes multiple times:
1: Connection is garbage-collected, use dbDisconnect() to avoid this.
2: Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this.
I think this happens because we don't explicitly close the database connection. As a resolution, I'd like to propose reg.finalizer() is called on the .volatiles environment and explicitly calls either dbDisconnect() or duckdb_shutdown().
When creating RMarkdown documents, I tend to get the following error message, sometimes multiple times:
I think this happens because we don't explicitly close the database connection. As a resolution, I'd like to propose
reg.finalizer()
is called on the.volatiles
environment and explicitly calls eitherdbDisconnect()
orduckdb_shutdown()
.