I have an SQLite binary dump of around 10mb. The dumped database contains some catalogue data, which I need to be able to read from really fast from a Ruby application (sub-millisecond). Therefore I was thinking to load the datadump into an in-memory read only instance of SQLite - but - I have a hard time figuring out exactly how?
I have tried something like this, but it does not keep the db in-memory:
require 'sqlite3'require 'fileutils'# Path to the binary database dumpbinary_dump_path = 'path_to_your_binary_dump.db'# Create a temporary filetemp_db_path = 'temp_database.db'FileUtils.copy(binary_dump_path, temp_db_path)# Open the temporary databasedb = SQLite3::Database.new(temp_db_path)# Optionally, set the database to read-only modedb.execute('PRAGMA query_only = ON')