SQLite Forum

Verifying schema for application file format
Login
SQLite allows considerable freedom in statements.  Your <code>CREATE TABLE</code> statements can contain different spacing characters and even comments.  So your answer depends what you want to do.

Checking that the schema (the <code>CREATE TABLE</code> statements used) are *exactly* what you used is easy.  You execute the

<code>SELECT sql FROM sqlite_master ORDER BY sql</code>

statement given earlier, and check to see that it returns exactly what you expect.  On the other hand, checking that the database has *compatible* table definitions, which will not return errors when you use them can be done only extensively: run a test sequence of example SQL commands and check to see it doesn't return any errors.