Hi, Ralf Junker wrote:
> 2. xBestIndex / xFilter / sqlite3_index_info > > The sqlite3_index_info structure contains char *idxStr; which may be used to > the application's liking. In addition, int needToFreeIdxStr; can be used to > instruct SQLite3 to free idxStr. > > Would it be possible that SQLite3 could pass idxStr back to the application > when it needs to be freed instead of freeing it using sqlite3_free? This > would allow to free complex memory structures which sqlite3_free can not > handle. I would not mind if idxStr would just be void* so I can store to it > whatever I need. I am writing a Perl wrapper for the virtual table feature and have encountered the same problem. For maximum flexibility I would like to use a Perl SV to identify the index, but that requires a custom destructor. In my opinion, the needToFreeIdxStr should be replaced by a pointer to a callback able to release the structure in idxStr. Similar to how it is done for blobs in sqlite3_bind_blob(). For those interested I have just uploaded an early release of the Perl module SQLite::VirtualTable to CPAN. Cheers, - Salva.