1) Each connection needs to load the image(s) that contain(s) the virtual module code (unless you have already linked it into a single image). 2) Each connection needs to declare the virtual module(s) by calling sqlite3_create_module(_v2). 3) Each connection needs to declare the tables using "CREATE VIRTUAL TABLE IF NOT EXISTS <table> USING <module> [(<arguments>)]" 4) Each xCreate/xConnect method needs to call sqlite3_declare_vtab() to tell SQLite about the table's fields 5) Each xCrteae/xConnect method also needs to allocate and return a sqlite_vtab structure on success, or an error status.
Ad3) using IF NOT EXISTS prevents problems with failing re-creation of tables -----Urspr?ngliche Nachricht----- Von: Dominique Devienne [mailto:ddevienne at gmail.com] Gesendet: Dienstag, 06. Oktober 2015 16:53 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Multiple connections to in-memory DB and virtual tables On Tue, Oct 6, 2015 at 4:39 PM, Simon Slavin <slavins at bigfraud.org> wrote: > On 6 Oct 2015, at 2:51pm, Dominique Devienne <ddevienne at gmail.com> wrote: > > Is this use case supported by SQLite? > > Whether this works correctly depends on how your Virtual Module is > written. It should be possible to implement this correctly, but I can > imagine a virtual system written quickly which does not take the care > to get this right. > It was not written "quickly" but it was definitely not written with that use-case in mind. And writing a virtual module correctly is not easy. > There are also things Virtual Tables can't do. For instance you > cannot index a Virtual Table using SQL commands. > That's a bit beside the point. Our vtable already provide indexing support. Just not dynamically added indexing via SQL commands.