Porównaj commity

...

2 Commity

Autor SHA1 Wiadomość Data
9088154372 submodules: cpp-httplib: Update 2023-08-09 13:56:04 +02:00
8a2d9fdc58 {page,categorydao}sqlite: Add missing ROLLBACK 2023-08-09 13:53:49 +02:00
3 zmienionych plików z 14 dodań i 7 usunięć

Wyświetl plik

@ -72,6 +72,7 @@ void CategoryDaoSqlite::deleteCategory(std::string name)
}
catch(sqlite::sqlite_exception &e)
{
*db << "ROLLBACK";
throwFrom(e);
}
}
@ -105,18 +106,21 @@ std::vector<Page> CategoryDaoSqlite::fetchMembers(std::string name, QueryOption
try
{
auto query = *db << "SELECT page.id, page.name AS name, page.title, page.lastrevision, page.visible FROM categorymember INNER JOIN page ON page.id = "
auto query = *db << "SELECT page.id, page.name AS name, page.title, page.lastrevision, page.visible FROM "
"categorymember INNER JOIN page ON page.id = "
"categorymember.page WHERE category = (SELECT id FROM category WHERE name = ? ) AND " +
queryoptions
<< name;
query >> [&](unsigned int id, std::string name, std::string title, unsigned int lastrevision, bool visible) {
query >> [&](unsigned int id, std::string name, std::string title, unsigned int lastrevision, bool visible)
{
Page p;
p.name = name;
p.pageid = id;
p.title = title;
p.current_revision = lastrevision;
p.listed = visible;
result.push_back(p); };
result.push_back(p);
};
}
catch(const sqlite::exceptions::no_rows &e)
{

Wyświetl plik

@ -109,6 +109,7 @@ void PageDaoSqlite::deletePage(std::string page)
}
catch(sqlite::sqlite_exception &e)
{
*db << "ROLLBACK";
throwFrom(e);
}
}
@ -140,15 +141,17 @@ std::vector<Page> PageDaoSqlite::getPageList(QueryOption option)
.setPrependWhere(true)
.build();
std::string query = "SELECT id, name, title, lastrevision, visible FROM page " + queryOption;
*db << query >> [&](unsigned int pageid, std::string name, std::string title,unsigned int current_revision, bool visible ) {
*db << query >>
[&](unsigned int pageid, std::string name, std::string title, unsigned int current_revision, bool visible)
{
Page tmp;
tmp.pageid = pageid;
tmp.name = name;
tmp.title = title;
tmp.current_revision = current_revision;
tmp.listed = visible;
result.push_back(tmp); };
result.push_back(tmp);
};
}
catch(const sqlite::errors::no_rows &e)
{

@ -1 +1 @@
Subproject commit 27c0e1186c28f4f6a6864e0f8e14a2898a33a794
Subproject commit c7ed1796a778592ae5a122287a16b1dd4770858a