MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / initTable

Method initTable

sql/configstore.cpp:81–95  ·  view source on GitHub ↗

Insert default values into the new table

Source from the content-addressed store, hash-verified

79// Insert default values into the new table
80//*******************************************
81void ConfigStore::initTable() {
82 QLOG_TRACE() << "Entering ConfigStore::initTable()";
83
84 QLOG_DEBUG() << "Initializing table ConfigStore";
85 db->lockForWrite();
86 NSqlQuery sql(db);
87 sql.prepare("Insert into ConfigStore (key, value) values (:key, :value);");
88 sql.bindValue(":key", CONFIG_STORE_LID);
89 sql.bindValue(":value", 0);
90 if (!sql.exec()) {
91 QLOG_ERROR() << "Insertion of initial counter failed: " << sql.lastError();
92 }
93 sql.finish();
94 db->unlock();
95}
96
97
98//*******************************************************************

Callers 1

createTableMethod · 0.95

Calls 5

lockForWriteMethod · 0.80
bindValueMethod · 0.80
prepareMethod · 0.45
execMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected