MCPcopy Create free account
hub / github.com/codestation/qcma / initialize

Method initialize

common/sqlitedb.cpp:227–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool SQLiteDB::initialize()
228{
229 QSqlQuery query;
230
231 for(unsigned int i = 0; i < sizeof(table_list) / sizeof(const char *); i++) {
232 if(!query.exec(table_list[i])) {
233 qDebug() << query.lastError();
234 return false;
235 }
236 }
237
238 for(unsigned int i = 0; i < sizeof(trigger_list) / sizeof(const char *); i++) {
239 if(!query.exec(trigger_list[i])) {
240 qDebug() << query.lastError();
241 return false;
242 }
243 }
244
245 // force object_id to start at 256
246 if(query.exec("INSERT INTO object_node (object_id, data_type, type) VALUES (255, 0, 0)")) {
247 query.exec("DELETE FROM object_node WHERE object_id = 255");
248 }
249 return true;
250}
251
252QSqlError SQLiteDB::getLastError()
253{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected