![]() The intent here is to cache X number of records in memory before writing to the disk. I fill one QList up with data, and when full, I send its QList> for recording to the database, then start filling up the second QList. QDebug() >, the top level of which has 2 QLists. The SQLite process: void saveData::setup()ĭb = QSqlDatabase::addDatabase("SQLITECIPHER", "data") ĭb.setConnectOptions("QSQLITE_USE_CIPHER=sqlcipher SQLCIPHER_LEGACY=1") įor (int i = 0 i addBindValue(data.at(j)) I've included (simplified) code below which illustrates each of these two processes. Step 2 can be executed in the background by using the Asynchronous Module, if it still proves to be a bit slow. This technique is based on the theory that the INSERT INTO that takes a SELECT statement is faster than executing individual INSERTs. As a point of comparison, I've also implemented a QFile process, which simply streams all the data to a. Delete the records from the temporary table. However, the insertion/write performance makes the current solution unusable (I'll outline the performance issues below). The process works as intended, and I'm able to write the data and have the resultant SQLite file encrypted using the SQLITECIPHER plugin. The issue I'm having with this setup is in insertion/write performance. I'm using a single table, no indexing, etc.) I'm essentially using SQLite as a flat file. I don't have any need for typical 'database' functionality (i.e. ![]() ![]() I've implemented an SQLite-based process for recording the data, as I'm able to encrypt the data (which is a requirement) using the SQLITECIPHER database plugin, and the data is contained within a single file (another requirement). The logging function is enabled/disabled via a simple button in the QML UI. I'm implementing a logging function, which records this data to a file on the device's drive (flash-based, not a spinning platter). My application receives data from a remote server via a QTCPSocket. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |