Hello all,

I'm experimenting with virtual tables and I must say that it's a very nice feature to have, it saves me from inserting millions of records in a database when I can simply map the source file in memory and read it directly. However, I have a small issue when renaming a database. What is happening is the following:

xDisconnect
xRename
xConnect

Those calls are quite expected and fine by me.
However, what surprises me is that xConnect is given a zero ppVTab parameter (that is, *ppVTab == 0) I would have thought that since the disconnect was given a valid pVTab, this one could have been given back to xConnect when reconnecting the database after its rename. As it turns out, I use pAux to point to my own structure, so I was able to create a list of "dangling" databases to pick from when connecting. That is to say, when xDisconnect is called, the database is put in that list of "dangling" databases and using the name in xConnect, its value is retrieved at that time. I know that the documentation says that xConnect and xCreate can be the same, and that most implementation that I have seen are actually the same, but when they are not, the current situation makes it difficult (at first sight) not to call again lengthy code when *ppVTab is zero.

Is this behavior expected? I'm fine with my current solution, but I was expecting xConnect to get a non zero *pPVTab most, if not all the time.

Thanks in advance for any clarification on this subject.

Regards
Olivier
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to