In our virtual table implementations, we are using the rowid to return the location of the record in the backing store (e.g. record offset in the file used as a backing store, offset within a shared memory section or maybe even the memory address of the record image) and also implement fast lookup by rowid.
If you don't require such ability, you may as well return a constant, a global counter value or a counter that is reset in the xFilter function. So, YES you always have to implement the xRowid method. It will only get called if your SELECT statement explicitly mentions it. No "INTEGER PRIMARY KEY" magic is performed for virtual tables. -----Ursprüngliche Nachricht----- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von dave Gesendet: Montag, 16. Oktober 2017 21:23 An: 'SQLite mailing list' <sqlite-users@mailinglists.sqlite.org> Betreff: [EXTERNAL] [sqlite] xRowid and read only virtual tables.... 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 ask in particular because implementing it will be quite awkward for the underlying implementation in my case, and I'd very much prefer to skip it. Even a 'without rowid' table would imply specifying some primary key, which in a few cases would also be awkward. Thanks in advance, -dave _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0 May be privileged. May be confidential. Please delete if not the addressee. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users