On 25 Sep 2015, at 5:04pm, Aaron Digulla <digulla at hepe.com> wrote:

> I was wondering if it was possible to create the same database (= no binary 
> difference) twice with sqlite.

Everything in a SQLite database is either structure (which we tend to call 
'schema' here) or data.  (For the same of argument we'll consider triggers and 
foreign keys to be structure.)

You can guarantee that the databases have the same structure and data in.  A 
trivial way to do this is to use the SQLite shell tool to do a '.dump' and then 
a '.read'.  However you can't guarantee that the database files are 
byte-for-byte identical.  If you want identical files you have to use a file 
API not a database API.

SQLite does include an API called the backup API:

<https://www.sqlite.org/backup.html>

My understanding of this is that it copies the database file block by block, 
without any understanding of what is in the blocks.  If this is true then it's 
a file API and will result in an identical file.

Simon.

Reply via email to