xerial/sqlite-jdbc

Extract DB files to a subdirectory within temporary folder

belugabehr opened this issue · 2 comments

Is your feature request related to a problem? Please describe.

The library performs a cleanup routine of the /tmp directory at the start of every execution.

https://github.com/xerial/sqlite-jdbc/blob/61fda53dd39bc31dbf46f5f4523d85334f6c0fb9/src/main/java/org/sqlite/SQLiteJDBCLoader.java#L90C48-L90C58

This means that the duration of time to perform this action depends on the number of files in the /tmp directory at the time of startup.

Describe the solution you'd like
This can be mostly mitigated by first creating a sub-directory in the /tmp directory (e.g., "xerial-sqlite-jdbc") and only store JDBC native libs in this directory. The size of this directory will be much less at risk of having large numbers of files present.

PR welcome

I thought about that, and we already have org.sqlite.tmpdir, so this seems redundant. What do you think?