walterDurin / sqlite-jdbc

Automatically exported from code.google.com/p/sqlite-jdbc
Apache License 2.0
0 stars 0 forks source link

Empty "file names" for temporary databases are not accepted #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Per the SQLite documentation concerning temporary databases

  http://www.sqlite.org/inmemorydb.html#temp_db

it's supposed to be possible to supply an empty string as a file name when 
opening a database, which will yield an temporary database similar to the 
in-memory one supplied with the ":memory:" argument, but backed additionally by 
a temporary file, to which data can spill under memory pressure.

By my reading, the current Conn#open(int) method precludes supplying such an 
empty string; there's no way to supply a URL of, say "jdbc:sqlite:" and wind up 
down around line 142 at the call to DB#open() with the "fileName" variable 
bound to an empty string.

Please consider either amending Conn#open(int) to accommodate such an empty 
string, or perhaps introduce a new sentinel string (":temporary:", perhaps?) 
that could indicate the caller's intention and serve the same purpose, 
translating the sentinel string back to an empty string.

Original issue reported on code.google.com by sehar...@gmail.com on 6 Jul 2011 at 4:54

GoogleCodeExporter commented 8 years ago
For the record, I consider this an enhancement request more than a defect, 
unless one expects that the JDBC wrapper claims to expose all the capabilities 
offered by the underlying SQLite library, in which case the current lack of 
support for such temporary databases would constitute a defect in meeting that 
claim.

Original comment by sehar...@gmail.com on 6 Jul 2011 at 4:55

GoogleCodeExporter commented 8 years ago
Are you willing to accept a patch that provides this temporary database 
specification capability?

Original comment by sehar...@gmail.com on 17 Aug 2011 at 8:52

GoogleCodeExporter commented 8 years ago
Yes. Your contribution is always welcome. 

Original comment by taroleo on 18 Aug 2011 at 4:16