File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class PythonParser : public AbstractParser
2626 PythonParser (ParserContext& ctx_);
2727 virtual ~PythonParser ();
2828 virtual bool parse () override ;
29+ virtual bool cleanupDatabase () override ;
2930private:
3031 struct ParseResultStats {
3132 std::uint32_t partial;
Original file line number Diff line number Diff line change @@ -182,6 +182,19 @@ bool PythonParser::parse()
182182 return true ;
183183}
184184
185+ bool PythonParser::cleanupDatabase ()
186+ {
187+ LOG (info) << " [pythonparser] Incremental parsing unsupported, cleaning up previous analysis results from database ..." ;
188+ odb::connection_ptr connection = _ctx.db ->connection ();
189+ #ifdef DATABASE_PGSQL
190+ connection->execute (" TRUNCATE TABLE \" PYName\" ;" );
191+ #else
192+ connection->execute (" DELETE FROM \" PYName\" ;" );
193+ #endif
194+ LOG (info) << " [pythonparser] Cleanup finished!" ;
195+ return true ;
196+ }
197+
185198PythonParser::~PythonParser ()
186199{
187200}
You can’t perform that action at this time.
0 commit comments