On Wed, May 7, 2014 at 4:57 PM, Simon Slavin <slav...@bigfraud.org> wrote:

> somehow ?  Perhaps the ROWID field of a table might have its own
> particular indication, and if you don't see any rows marked like that you
> could deduce that the table had no ROWID column.  I'm sure there are better
> ways the
>

This isn't efficient, but it should work without corner cases: (pseudocode):


function hasRowId(tablename) {
  prepare SELECT 1 FROM tablename; // if this fails, tablename likely does
not exist. else...
  prepare SELECT rowid FROM tablename; // if this fails, rowid missing
  return true only if the second PREPARE succeeds.
}


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to