summaryrefslogtreecommitdiff
path: root/lib/output/dumpToConsole.h
blob: bbbac44cc3e43e6a64855a47599532c972af9bd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef MYGRATE_OUTPUT_DUMPTOCONSOLE_H
#define MYGRATE_OUTPUT_DUMPTOCONSOLE_H

#include <eventHandlerBase.h>
struct st_mariadb_rpl_rows_event;

namespace MyGrate::Output {
	class DumpToConsole : public MyGrate::EventHandlerBase {
	protected:
		void tableMap(MyGrate::MariaDB_Event_Ptr event) override;

		void insertRow(MyGrate::MariaDB_Event_Ptr event) override;

		void updateRow(MyGrate::MariaDB_Event_Ptr event) override;

		void deleteRow(MyGrate::MariaDB_Event_Ptr event) override;

	private:
		using TableId = decltype(st_mariadb_rpl_table_map_event::table_id);
		using TableMaps = std::map<TableId, MyGrate::MariaDB_Event_Ptr>;

		void dumpRowData(const st_mariadb_rpl_rows_event & row) const;
		void dumpRowPairData(const st_mariadb_rpl_rows_event & row) const;

		TableMaps tableMaps;
	};
}

#endif