Simon, don't know what exactly wrong in your particular case, but I'd suggest setting debugger breakpoints everywhere in your x-handlers and notice the moment after which calls are ceased (or you get a error code).
Max On Fri, Oct 4, 2013 at 6:07 PM, Simon <turne...@gmail.com> wrote: > Hi there, > > I'm currently building my own virtual table implementation. I've built a > dummy vtable that returns the string "1" to all queries for all columns.... > but I'm having trouble getting started (getting a 'misuse' error). Can > someone help me get in the right direction? > > > >>>>>>>>>>>>> > > 1) I first create an sqlite3* object in ":memory:". This one works fine. > > 2) Allocate and init my derived sqlite3_module* object. > 2.1) Function pointers I use are Create,Destroy, Connect,Disconnect, > Open,Close, BestIndex,Filter, Next,Eof, Column,Rowid. > 2.2) NULL pointers for Update, Begin,Sync,Commit,Rollback, > FindFunction,Rename, Savepoint,Release,RollbackTo. > 2.3) *** ? *** Are there any other members not documented I'd need to init? > > 3) I call sqlite3_create_module() with module name "vtable1" > > 4) I call sqlite3_declare_vtab() with this statement: "CREATE TABLE foo ( x > integer, y integer );" > > --> That one fails with ERROR 21 (lib misuse). > > <<<<<<<<<<<<< > > > Did I forget a step? Do them in wrong order? Anything obvious seems wrong > to you? Where should I go to get more details and fix the issue? > My current implementation is rather complex and involves C++ and templates > a lot. Making a "small example" would be highly time-consuming, so I'd > prefer to avoid going that way if possible. > > Anyone can tell me where I'd find a simple functionnal vtable "hello > world"? The vtable documentation is great but is missing examples, imo. > Personnally, I think the vtable documentation page could benefit from one > example project throughout and develop it. Something like a basic CSV > vtable would probably help the masses a lot! :) > > Thanks for your help and time, > Simon > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users