> On 10/16/17, dave <d...@ziggurat29.com> wrote: > > Hi, I am building a system which involves a number of virtual table > > implementations. They are all read-only, but will be > involved in a bunch of > > joins amongst themselves. My question is this: > > > > the documentation > > http://sqlite.org/vtab.html#tabfunc2 at 2.12 xRowid > > seems (to my reading) to be always required to be > implemented. But does it > > really? Is it ever used for read-only tables? I have never seen it > > invoked, and I have been blithely ignoring implementing it, > but I wonder if > > there is a case where it would be invoked for a read-only > query and so I am > > tempting fate. > > I don't think xRowid is ever called if you create a WITHOUT ROWID > virtual table (https://sqlite.org//vtab.html#worid). But, just to be > safe, I think I would include a stub function that always returned 0. > -- > D. Richard Hipp
Thanks. OK, I am interpreting that to mean: * you could use WITHOUT ROWID, which will surely obviate the need for a valid xRowid implementation. However that does incur the need for defining PRIMARY KEY, etc. (I have verified this. It is problemattic with at least a few of my vtables) * for a read-only vtable, you do not need a valid imlementation of xRowid, you can just stub it. However it is required to be present (i.e. the xRowid member must not be NULL). -dave _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users