I can make the cached memory connection with the imported sqlite3_open() command.
But, to avoid using the low level calls, I could briefly ATTACH the file db to the :memory: db as a fallback.
Just not sure of the performance penalty when the file database is very large?
Code: Select all
Debug ";-!TRY ATTACH"
UseSQLiteDatabase()
ImportC "" ; UseSQLiteDatabase() must be called prior
sqlite3_open(filename.s, *hDB)
sqlite3_close(hDB.i)
EndImport
DB1$ = "c:\try\db1.db"
CreateFile(99, db1$)
CloseFile(99)
u$ = "CREATE TABLE T1 (nid INTEGER PRIMARY KEY, Item TEXT, XdB DOUBLE);"
db1n = OpenDatabase(#PB_Any, DB1$, #Empty$, #Empty$, #PB_Database_SQLite)
dbm$ = "file::memory:?cache=shared"
Debug sqlite3_open(dbm$, @dbmh) ;<-- works
dbmn = OpenDatabase(#PB_Any, DBm$, #Empty$, #Empty$, #PB_Database_SQLite)