Transferring SQLite database file to memory

  1. 4 weeks ago

    Nathan W

    Oct 22 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    Is there an easy way to load a SQLite database from file to an in memory database, work on it in memory and then write the whole in memory database back to the database file?

    Perhaps it was before it became Xojo. Basically the steps are you create your in-memory database, attach the physical db and then use a bunch of select into statements to copy tables & data into your in-memory version. You would reverse the process to write the data back to the physical db file.

  2. Wayne G

    Oct 22 Pre-Release Testers, Xojo Pro Auckland, New Zealand

    Search the Xojo Blog site. @Geoff P did a blog on how they do this for their Eddies web demo.

  3. Nathan W

    Oct 22 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    @Wayne G Search the Xojo Blog site. @Geoff P did a blog on how they do this for their Eddies web demo.

    Hi Wayne, i have just search the Xojo blog for SQLite but cannot find any posts by Geoff or about Eddies web demo.

  4. Wayne G

    Oct 22 Pre-Release Testers, Xojo Pro Answer Auckland, New Zealand

    Perhaps it was before it became Xojo. Basically the steps are you create your in-memory database, attach the physical db and then use a bunch of select into statements to copy tables & data into your in-memory version. You would reverse the process to write the data back to the physical db file.

  5. Nathan W

    Oct 23 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    Thanks Wayne, that makes sense.

  6. Jay M

    Oct 23 Pre-Release Testers, Xojo Pro NC, USA

    Javier wrote about it here .

  7. Maurizio R

    Oct 23 Pre-Release Testers, Xojo Pro

    SQLiteDatabase.Backup

  8. Oliver O

    Oct 24 Pre-Release Testers, Xojo Pro https://udemy.seminar.pro
    Edited 4 weeks ago

    I used to instantiate a sqlitedatabase object without database file, so it exists in memory. Then attach a database to it And select into the memory db from the file db.

    Now deprecated:
    https://docs.xojo.com/SQLiteDatabase.AttachDatabase

  9. Dave S

    Oct 24 San Diego, California USA
    Edited 4 weeks ago

    Using the above mentioned BACKUP feature built in to SQLite is much easier, and faster.... just 2 or 3 lines of code, and no need to worry about the schema layout (ie. you don't need to know the table and field (oops row) names)

    and AttachDatabase has been renamed to AddDatabase (even though SQLite themselves uses ATTACH)

  10. Norman P

    Oct 24 Pre-Release Testers, Xojo Pro Outside

    AddDatabase sounds much more like CreateDatabase but .....

  11. Dave S

    Oct 24 San Diego, California USA

    Createing a NEW database connection would be "adding".... while "Attach" is exactly that.. it extends a current connection

  12. Norman P

    Oct 24 Pre-Release Testers, Xojo Pro Outside

    right .. attach was the right word before and still is
    but when you have to change something well .... :)

  13. Dave S

    Oct 24 San Diego, California USA
    Edited 4 weeks ago

    dunno.. but the word "STUPID" comes to mind

or Sign Up to reply!