Ben. Your post was in spam. Is your extension function an aggregate?
From https://www.sqlite.org/c3ref/get_auxdata.html "These functions may be used by (non-aggregate) SQL functions..." The trace hook API has some statement level modes you might hook for to manage your cached data: https://www.sqlite.org/c3ref/c_trace.html You are also completely free to reference your own data structures by name from your custom extension. Thinking about this, it occurs to me again, it would help many if SQLite also had the similar sqlite3_get_data() and sqlite3_set_data() per connection. In your case you could organize your data on the connection and use trace hook to keep it relevant to extension function query(s). As it stands the only connection level object appears to be a custom VFS shim which is overkill for this. Does DRH read these posts? The question is why isn't there a connection level get/set cache API similar to the auxdata calls? Peter On Tue, Nov 21, 2017 at 3:03 PM, Stadin, Benjamin < benjamin.sta...@heidelberg-mobil.com> wrote: > Hi, > > I register a custom SQL function using dms_create_function_v2, and in the > C callback I create a rather heavy C++ helper class which I need to prepare > the result. > > I currently use sqlite3_get_auxdata and sqlite3_set_auxdata, but my > problem is that the finalization callback of sqlite3_set_auxdata is called > after each step(). > > Is there a way to hook into sqlite3_finalize(), in order to manage the > lifecycle of application data that is created together with a statement and > to be destroyed once the statement is finalized? > > Ben > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users