| 44 | }; |
| 45 | |
| 46 | static int count_nodes(QSqlDatabase *db) |
| 47 | { |
| 48 | const auto query = "select count(*) from Nodes;"; |
| 49 | QSqlQuery count_stmt(*db); |
| 50 | count_stmt.prepare(query); |
| 51 | count_stmt.exec(); |
| 52 | count_stmt.next(); |
| 53 | return count_stmt.value(0).toInt(); |
| 54 | } |
| 55 | |
| 56 | /// Reads all nodes from a database and builds the tree; returns `true` on success |
| 57 | static bool read_nodes(QSqlDatabase *db, Execution &ex) |
no test coverage detected