sqlite.createDatabase - destroys any existing content

I had a bug that took me a while to resolve - so I thought I’d document it.

I had an in-memory database (scanDB) that I wanted saved to a file so that it could be attached to second in-memory database (filterDB). So I used scanDB.createDatabase and then for a long while could not fathom why filterDB could not access tables in the attached scanDB.

Was it a threading problem? Was it a duplicate names issue? Was it not attaching properly? Was something else clearing the database before I was accessing it?

Of course, and it’s obvious in retrospect, I had created the tables and content of scanDB before applying createDatabase - which then created a “New Database”. And perhaps that’s why the name createDatabaseFile was changed - as it does more than create a file for the database.