Compare commits
No commits in common. "9088154372f91cf6ef6db745732d5dea83314bfe" and "c0049fc7b6fdcf7bed3e2e95b99f429b841f8ce5" have entirely different histories.
9088154372
...
c0049fc7b6
@ -72,7 +72,6 @@ void CategoryDaoSqlite::deleteCategory(std::string name)
|
|||||||
}
|
}
|
||||||
catch(sqlite::sqlite_exception &e)
|
catch(sqlite::sqlite_exception &e)
|
||||||
{
|
{
|
||||||
*db << "ROLLBACK";
|
|
||||||
throwFrom(e);
|
throwFrom(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,21 +105,18 @@ std::vector<Page> CategoryDaoSqlite::fetchMembers(std::string name, QueryOption
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto query = *db << "SELECT page.id, page.name AS name, page.title, page.lastrevision, page.visible FROM "
|
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 INNER JOIN page ON page.id = "
|
|
||||||
"categorymember.page WHERE category = (SELECT id FROM category WHERE name = ? ) AND " +
|
"categorymember.page WHERE category = (SELECT id FROM category WHERE name = ? ) AND " +
|
||||||
queryoptions
|
queryoptions
|
||||||
<< name;
|
<< 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;
|
Page p;
|
||||||
p.name = name;
|
p.name = name;
|
||||||
p.pageid = id;
|
p.pageid = id;
|
||||||
p.title = title;
|
p.title = title;
|
||||||
p.current_revision = lastrevision;
|
p.current_revision = lastrevision;
|
||||||
p.listed = visible;
|
p.listed = visible;
|
||||||
result.push_back(p);
|
result.push_back(p); };
|
||||||
};
|
|
||||||
}
|
}
|
||||||
catch(const sqlite::exceptions::no_rows &e)
|
catch(const sqlite::exceptions::no_rows &e)
|
||||||
{
|
{
|
||||||
|
@ -109,7 +109,6 @@ void PageDaoSqlite::deletePage(std::string page)
|
|||||||
}
|
}
|
||||||
catch(sqlite::sqlite_exception &e)
|
catch(sqlite::sqlite_exception &e)
|
||||||
{
|
{
|
||||||
*db << "ROLLBACK";
|
|
||||||
throwFrom(e);
|
throwFrom(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,17 +140,15 @@ std::vector<Page> PageDaoSqlite::getPageList(QueryOption option)
|
|||||||
.setPrependWhere(true)
|
.setPrependWhere(true)
|
||||||
.build();
|
.build();
|
||||||
std::string query = "SELECT id, name, title, lastrevision, visible FROM page " + queryOption;
|
std::string query = "SELECT id, name, title, lastrevision, visible FROM page " + queryOption;
|
||||||
*db << query >>
|
*db << query >> [&](unsigned int pageid, std::string name, std::string title,unsigned int current_revision, bool visible ) {
|
||||||
[&](unsigned int pageid, std::string name, std::string title, unsigned int current_revision, bool visible)
|
|
||||||
{
|
|
||||||
Page tmp;
|
Page tmp;
|
||||||
tmp.pageid = pageid;
|
tmp.pageid = pageid;
|
||||||
tmp.name = name;
|
tmp.name = name;
|
||||||
tmp.title = title;
|
tmp.title = title;
|
||||||
tmp.current_revision = current_revision;
|
tmp.current_revision = current_revision;
|
||||||
tmp.listed = visible;
|
tmp.listed = visible;
|
||||||
result.push_back(tmp);
|
result.push_back(tmp); };
|
||||||
};
|
|
||||||
}
|
}
|
||||||
catch(const sqlite::errors::no_rows &e)
|
catch(const sqlite::errors::no_rows &e)
|
||||||
{
|
{
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit c7ed1796a778592ae5a122287a16b1dd4770858a
|
Subproject commit 27c0e1186c28f4f6a6864e0f8e14a2898a33a794
|
Loading…
Reference in New Issue
Block a user