Apologies, my answer reads more like a "How to" than a "What is the best way" type answer, so to just elaborate on the brevity - SQLite stores no special pointer or memory or setting or even file value anywhere that can give you any clue apart from the actual words "Without RowID" which are found only in the Schema of the Table and mostly only at the end of it (barring added comments etc).

Hence my quick-draw solution hereunder is not so much the "best" way as it is the "only" way. Further to this, it is conceivable that a comment within the table definition might contain the words "WITHOUT" and "ROWID" together, so a more robust solution would probably be to ensure it follows the final right-brace.

Hope that answers the question more directly.


On 2014/05/07 15:40, RSmith wrote:
SELECT instr(upper(sql),'WITHOUT ROWID')>1 FROM sqlite_master WHERE 
type='table' AND tbl_name='YourTableName'

Returns 1 for tables made without rowid, 0 for the rest.


On 2014/05/07 15:00, Marco Bambini wrote:
What is the best way to know if a table has been created with the WITHOUT ROWID 
option?
--
Marco Bambini
http://www.sqlabs.com
http://twitter.com/sqlabs
http://instagram.com/sqlabs



_______________________________________________
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

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to