Caveat: SQLite may call the xDisconnect method at other times too. I expect 
this will happen if the schema changes while a statement is prepared.

-----Urspr?ngliche Nachricht-----
Von: Peter Aronson [mailto:pbaronson at att.net]
Gesendet: Dienstag, 21. Juli 2015 01:20
An: General Discussion of SQLite Database
Betreff: Re: [sqlite] create temporary virtual table

Most types of virtual table can be created as temporary tables with no trouble 
by specifying the temp database when you create them.  IE:
CREATE VIRTUAL TABLE temp.myrtree USING RTREE (id,minx,maxx); However, the 
virtual table method xDestroy does not get called for a virtual table in the 
temp database unless an explicit DROP TABLE statement is executed on it; simply 
exiting and allowing SQLite to clean up the temp database won't do it.  
However, for many Virtual Tables, the xDestroy method and the xDisconnect 
methods are the same, and SQLite will call the xDisconnect method on a virtual 
table in the temp database before exiting.  So, unless the virtual table has to 
clean up additional metadata or if it deletes or releases some external 
resources, it can probably be safely created in the temp database and cleaned 
up by SQLite on exit.  Of course, if you explicitly DROP it when you are done 
with it, the xDestroy methods will be called and all should be as normal.
Peter


     On Monday, July 20, 2015 3:34 PM, Andy Rahn <andy.rahn at gmail.com> wrote:



 I see there is no way to create a temporary virtual table.

One idea I had was to create a second, in-memory db and attach that, then 
create the virtual table over there.

Currently I have it working where as soon as I open the db, I use sqlite_master 
to find any left over virtual tables from before and drop them.

Any other ideas?

 - Andy
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users




_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


Reply via email to