Files
Sourcetrail/src/lib/data/SqliteDatabaseIndex.cpp
T
malte_langkabel 2b24b88745 data: bookmark refactoring
* implemented handling of aggregations in bookmarks
* split index Storage and bookmark storage
* each sqlite database has its own version now
* added bookmark tests
* fixed creating bookmark tables when project can be loaded but bookmark db does not exist
* fixed font size for bookmarkview tooltips
* using bookmark cache now
* using default category name when none specified by the user
* raising bookmark windows when they should be shown
* clearing a bookmark or category in the editor will now update the star icon accordingly
* non-persistent bookmarks use ids of nodes and edges now (instead of names)
* git ignore .srctrlbm files
2017-04-17 10:55:59 +02:00

26 lines
591 B
C++

#include "data/SqliteDatabaseIndex.h"
SqliteDatabaseIndex::SqliteDatabaseIndex(const std::string& indexName, const std::string& indexTarget)
: m_indexName(indexName)
, m_indexTarget(indexTarget)
{
}
SqliteDatabaseIndex::~SqliteDatabaseIndex()
{
}
void SqliteDatabaseIndex::createOnDatabase(CppSQLite3DB& database)
{
database.execDML((
"CREATE INDEX IF NOT EXISTS " + m_indexName + " ON " + m_indexTarget + ";"
).c_str());
}
void SqliteDatabaseIndex::removeFromDatabase(CppSQLite3DB& database)
{
database.execDML((
"DROP INDEX IF EXISTS main." + m_indexName + ";"
).c_str());
}