From 8c0cde0b6d09fe51cdb4ccc2604dee620cbb3722 Mon Sep 17 00:00:00 2001 From: Joe Green Date: Sun, 5 Aug 2018 17:40:22 +0100 Subject: [PATCH] example of how to include/exclude columns from the comparison --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 768942a..eadc5b5 100644 --- a/README.md +++ b/README.md @@ -210,13 +210,16 @@ $targetTable = new Table($targetConnection, $targetDb, $targetTable); // if you only want specific columns $columnConfig = new ColumnConfiguration($syncColumns, $ignoreColumns); +// if you only want to use specific columns for the comparison +$compareConfig = new ColumnConfiguration($compareColumns, $ignoreCompareColumns); + // optionally apply a where clause - this can be useful when sync-ing large tables, where // you can make use of a column to rule out large portions of the data // that you know haven't changed, such as columns with "on update CURRENT_TIMESTAMP" etc.. $sourceTable->setWhereClause(new WhereClause("column_name = ?", ['value'])); $targetTable->setWhereClause(new WhereClause("column_name > ?", ['value'])); -$sync->sync($sourceTable, $targetTable, $columnConfig); +$sync->sync($sourceTable, $targetTable, $columnConfig, $compareConfig); ``` Roadmap