mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-08-17 15:19:48 +00:00
Move db dbsource files to the postgresql backend lib and rename namespace.
This commit is contained in:
parent
baa67138eb
commit
70caa9e26c
24 changed files with 166 additions and 131 deletions
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "listdircontent.hpp"
|
||||
#include "entrypath.hpp"
|
||||
#include "dbsource.hpp"
|
||||
#include "backends/postgresql/dbsource.hpp"
|
||||
#include "helpers/infix_iterator.hpp"
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
@ -68,7 +68,7 @@ namespace din {
|
|||
}
|
||||
} //unnamed namespace
|
||||
|
||||
ListDirContent::ListDirContent (DBSource* parDB) :
|
||||
ListDirContent::ListDirContent (dinbpostgres::DBSource* parDB) :
|
||||
m_cache(g_max_cached_lists),
|
||||
m_db(parDB)
|
||||
{
|
||||
|
@ -86,13 +86,13 @@ namespace din {
|
|||
//Requested item is not cached, so we need to query the db now
|
||||
if (parDir.points_to_group()) {
|
||||
auto sets_ids = m_db->sets();
|
||||
auto sets_info = m_db->set_details<SetDetail_ID, SetDetail_Desc, SetDetail_CreeationDate>(sets_ids);
|
||||
auto sets_info = m_db->set_details<dinbpostgres::SetDetail_ID, dinbpostgres::SetDetail_Desc, dinbpostgres::SetDetail_CreeationDate>(sets_ids);
|
||||
m_cache.push_back(std::make_pair(curr_path, db_result_to_vec(sets_info)));
|
||||
}
|
||||
else {
|
||||
auto path_prefix = parDir.file_path();
|
||||
const auto set_id = parDir.group_id();
|
||||
auto files_info = m_db->file_details<FileDetail_Path>(set_id, parDir.level() + 1, path_prefix);
|
||||
auto files_info = m_db->file_details<dinbpostgres::FileDetail_Path>(set_id, parDir.level() + 1, path_prefix);
|
||||
m_cache.push_back(std::make_pair(curr_path, db_result_to_vec(files_info)));
|
||||
}
|
||||
return last_cached_item(curr_path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue