-
Notifications
You must be signed in to change notification settings - Fork 0
/
TableCompareQuery.h
42 lines (31 loc) · 1.34 KB
/
TableCompareQuery.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
/*----------------------------------------------------------------------
Copyright (c) Dan Petitt, http://www.coderanger.com
All Rights Reserved.
Please see the file "licence.txt" for licencing details.
File: TableCompareQuery.h
Owner: [email protected]
Purpose: Derived table syncronisation class which uses 3 different queries
to find out rows to insert, delete, update
Advantages: It works, its quick and uses low memory
Disadvantages: Lot of work is done on server siding calculating
hashes
----------------------------------------------------------------------*/
#pragma once
#include "TableCompareABC.h"
class CTableCompareQuery: public CTableCompareABC
{
public:
CTableCompareQuery(void);
~CTableCompareQuery(void);
protected:
virtual void OnProcessTable( const XMySQL::CConnection::Table &tbl );
private:
std::string BuildUpdateValues( const std::vector< CTableCompareABC::Field > &arrFields );
std::string BuildUpdateWhereClause( const std::vector< CTableCompareABC::Field > &arrFields );
std::string BuildInsertFieldValues( const XMySQL::CResultSet &rs );
std::string BuildBulkInsertFieldValues( const XMySQL::CResultSet &rs );
std::string BuildDeleteWhereClause( const XMySQL::CResultSet &rs );
private:
CTableCompareQuery( const CTableCompareQuery & );
CTableCompareQuery & operator = ( const CTableCompareQuery & );
};