Does anyone knows how to load an existing database (Sqlite 3) into memory for fast computation in Perl, MATLAB or Java? Perl is preferred?
I am working on a project that needs intensive computation, and I want to keep the real database fixed. So I want to read the entire Sqlite3 database into memory and perform anything there in memory.
I know the basics of in-memory database connection, but seems like Perl can only create a new database using this way, rather than loading an existing one (which is the option I want to implement).
You can use the &sqlite_backup_from_file method in DBD::SQLite. If the handle against which you invoke it is opened on the ':memory:' database , the external database is read into it. A corresponding &sqlite_backup_to_file method allows you to write it back when you're done. These functions are effectively just wrappers around the C interface for backups
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With