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

Method createTable

sql/configstore.cpp:53–74  ·  view source on GitHub ↗

Create the table & set the initial values

Source from the content-addressed store, hash-verified

51// Create the table & set the initial values
52//********************************************
53void ConfigStore::createTable() {
54 QLOG_TRACE() << "Entering ConfigStore::createTable()";
55
56 QLOG_DEBUG() << "Creating table ConfigStore";
57 NSqlQuery sql(db);
58
59 db->lockForWrite();
60 // build the SQL command & cretae the table
61 QString command("Create table if not exists ConfigStore (" +
62 QString("key integer primary key not null unique,") +
63 QString("value blob)"));
64 if (!sql.exec(command)) {
65 QLOG_ERROR() << "Creation of ConfigStore table failed: " << sql.lastError();
66 sql.finish();
67 db->unlock();
68 } else {
69 // insert default values into the new table
70 this->initTable();
71 sql.finish();
72 db->unlock();
73 }
74}
75
76
77

Callers 1

ConfigStoreMethod · 0.95

Calls 5

initTableMethod · 0.95
lockForWriteMethod · 0.80
QStringClass · 0.50
execMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected