fix travis build pipeline
This commit is contained in:
@@ -81,8 +81,10 @@ namespace sourcetrail
|
||||
DatabaseStorage() = default;
|
||||
|
||||
void setupTables();
|
||||
void clearTables();
|
||||
void setupIndices();
|
||||
void setupPrecompiledStatements();
|
||||
void clearPrecompiledStatements();
|
||||
|
||||
int insertElement();
|
||||
void insertOrUpdateMetaValue(const std::string& key, const std::string& value);
|
||||
|
||||
@@ -52,25 +52,7 @@ namespace sourcetrail
|
||||
|
||||
DatabaseStorage::~DatabaseStorage()
|
||||
{
|
||||
m_insertElementStatement.finalize();
|
||||
m_findNodeStatement.finalize();
|
||||
m_insertNodeStatement.finalize();
|
||||
m_setNodeTypeStmt.finalize();
|
||||
m_insertSymbolStatement.finalize();
|
||||
m_findFileStatement.finalize();
|
||||
m_insertFileStatement.finalize();
|
||||
m_setFileLanguageStmt.finalize();
|
||||
m_insertFileContentStatement.finalize();
|
||||
m_findEdgeStatement.finalize();
|
||||
m_insertEdgeStatement.finalize();
|
||||
m_findLocalSymbolStmt.finalize();
|
||||
m_insertLocalSymbolStmt.finalize();
|
||||
m_findSourceLocationStmt.finalize();
|
||||
m_insertSourceLocationStmt.finalize();
|
||||
m_insertOccurenceStmt.finalize();
|
||||
m_findErrorStatement.finalize();
|
||||
m_insertErrorStatement.finalize();
|
||||
m_insertOrUpdateMetaValueStmt.finalize();
|
||||
clearPrecompiledStatements();
|
||||
|
||||
m_database.close();
|
||||
}
|
||||
@@ -97,25 +79,9 @@ namespace sourcetrail
|
||||
{
|
||||
executeStatement("PRAGMA foreign_keys=OFF;");
|
||||
|
||||
const std::vector<std::string> tableNames = {
|
||||
"meta",
|
||||
"error",
|
||||
"component_access",
|
||||
"occurrence",
|
||||
"source_location",
|
||||
"local_symbol",
|
||||
"filecontent",
|
||||
"file",
|
||||
"symbol",
|
||||
"node",
|
||||
"edge",
|
||||
"element"
|
||||
};
|
||||
clearPrecompiledStatements();
|
||||
|
||||
for (const std::string& tableName : tableNames)
|
||||
{
|
||||
executeStatement("DROP TABLE IF EXISTS main." + tableName + ";");
|
||||
}
|
||||
clearTables();
|
||||
|
||||
setupDatabase();
|
||||
}
|
||||
@@ -533,6 +499,29 @@ namespace sourcetrail
|
||||
);
|
||||
}
|
||||
|
||||
void DatabaseStorage::clearTables()
|
||||
{
|
||||
const std::vector<std::string> tableNames = {
|
||||
"meta",
|
||||
"error",
|
||||
"component_access",
|
||||
"occurrence",
|
||||
"source_location",
|
||||
"local_symbol",
|
||||
"filecontent",
|
||||
"file",
|
||||
"symbol",
|
||||
"node",
|
||||
"edge",
|
||||
"element"
|
||||
};
|
||||
|
||||
for (const std::string& tableName : tableNames)
|
||||
{
|
||||
executeStatement("DROP TABLE IF EXISTS main." + tableName + ";");
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseStorage::setupIndices()
|
||||
{
|
||||
executeStatement(
|
||||
@@ -651,6 +640,29 @@ namespace sourcetrail
|
||||
);
|
||||
}
|
||||
|
||||
void DatabaseStorage::clearPrecompiledStatements()
|
||||
{
|
||||
m_insertElementStatement.finalize();
|
||||
m_findNodeStatement.finalize();
|
||||
m_insertNodeStatement.finalize();
|
||||
m_setNodeTypeStmt.finalize();
|
||||
m_insertSymbolStatement.finalize();
|
||||
m_findFileStatement.finalize();
|
||||
m_insertFileStatement.finalize();
|
||||
m_setFileLanguageStmt.finalize();
|
||||
m_insertFileContentStatement.finalize();
|
||||
m_findEdgeStatement.finalize();
|
||||
m_insertEdgeStatement.finalize();
|
||||
m_findLocalSymbolStmt.finalize();
|
||||
m_insertLocalSymbolStmt.finalize();
|
||||
m_findSourceLocationStmt.finalize();
|
||||
m_insertSourceLocationStmt.finalize();
|
||||
m_insertOccurenceStmt.finalize();
|
||||
m_findErrorStatement.finalize();
|
||||
m_insertErrorStatement.finalize();
|
||||
m_insertOrUpdateMetaValueStmt.finalize();
|
||||
}
|
||||
|
||||
int DatabaseStorage::insertElement()
|
||||
{
|
||||
executeStatement(m_insertElementStatement);
|
||||
|
||||
@@ -17,7 +17,7 @@ target_include_directories(${EXAMPLE_NAME} PUBLIC
|
||||
"${CORE_SOURCE_DIR}/include"
|
||||
)
|
||||
|
||||
target_link_libraries(${EXAMPLE_NAME} ${LIB_CORE})
|
||||
target_link_libraries(${EXAMPLE_NAME} ${LIB_CORE} "-ldl")
|
||||
|
||||
|
||||
# --- Configure Sourcetrail Project File ---
|
||||
|
||||
@@ -17,7 +17,7 @@ target_include_directories(${EXAMPLE_NAME} PUBLIC
|
||||
"${CORE_SOURCE_DIR}/include"
|
||||
)
|
||||
|
||||
target_link_libraries(${EXAMPLE_NAME} ${LIB_CORE})
|
||||
target_link_libraries(${EXAMPLE_NAME} ${LIB_CORE} "-ldl")
|
||||
|
||||
|
||||
# --- Configure Sourcetrail Project File ---
|
||||
|
||||
Reference in New Issue
Block a user