~phablet-team/history-service/staging

« back to all changes in this revision

Viewing changes to plugins/sqlite/sqlitedatabase.cpp

  • Committer: Gustavo Pichorim Boiko
  • Date: 2017-03-22 20:59:13 UTC
  • mfrom: (227.2.2 trace_sqlite)
  • Revision ID: gustavo.boiko@canonical.com-20170322205913-32fk9wa98t1b4hpf
Make it possible to debug sqlite commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
    return true;
184
184
}
185
185
 
 
186
 
 
187
void trace(void *something, const char *query)
 
188
{
 
189
    qDebug() << "SQLITE TRACE:" << query;
 
190
}
 
191
 
186
192
bool SQLiteDatabase::createOrUpdateDatabase()
187
193
{
188
194
    bool create = !QFile(mDatabasePath).exists();
199
205
    // and also create the normalizeId function
200
206
    sqlite3_create_function(handle, "normalizeId", 2, SQLITE_ANY, NULL, &normalizeId, NULL, NULL);
201
207
 
 
208
#ifdef TRACE_SQLITE
 
209
    sqlite3_trace(handle, &trace, NULL);
 
210
#endif
 
211
 
202
212
    parseVersionInfo();
203
213
 
204
214
    QSqlQuery query(mDatabase);