Data Sync Select Objects
By default, Data Sync aligns all tables in the database. Filtering the synchronization objects allows for the following functionalities:
- Include or exclude specific databases
- Include or exclude specific schemas
- Include or exclude specific tables
To select or exclude a few objects, you can check or cross them out. For simpler options, refer to the basic filtering section. For more complex selection or exclusion criteria, use regular expressions for filtering. Please consult the regular expressions filtering section for details.
Basic Filtering
Using MySQL as an example
Include and Exclude Databases
As shown in the figure below, all databases are selected by default.
Include or exclude a database by checking or unchecking it. Once a database is unchecked, the associated tables will no longer be expandable and cannot be synchronized.
Search database by names.
Include and Exclude Tables
In MySQL, Tables are based on the Database. Review the Database before selecting the corresponding table. Once reviewed, all tables are automatically selected by default, as shown below. Include or exclude tables by checking or unchecking them. Within the TABLES node, select all or exclude all tables, as depicted in the figure below.
Regular Expressions Filtering
When dealing with a vast array of objects on the source side, filter them according to specific formats, such as by prefix or suffix. Objects can be filtered using regular expressions, as illustrated in the figure below:
Once you click on the page, operate in two ways: through form model or editor model.
Form Model
Using MySQL as the example for the source end, follow these specific operations:
- Decide whether to select or exclude objects.
- Input the regular expressions for both the Database and Table. Leaving them blank signifies a full match. These two regular expressions are connected by an "and" relationship.
- No limit to the number of rules you can create. Click the [Add Rule] button to include more for multiple rules. These rules operate under an "or" relationship. Click OK to begin filtering. The window will display all objects that meet the criteria.
Editor Model
Along with establishing rules through "Form Model", a file editing mode is also available. This mode is especially useful for managing numerous rules. For instance, if you need to filter out 100 tables from a specific library, utilizing file editing mode is incredibly convenient. Convert the 100 table names to JSON format and paste them into the editor. To switch to file editing mode, click [Editor Model]. Here are some important notes:
- In form mode, the completed rules are saved and shown in the editor in JSON format.
- Rules entered in file editing mode will remain intact and appear in form mode after switching back.
- Easily switch between the two modes, and the rules will always stay consistent.
Notices
- If the Database is chosen and all subordinate Tables are marked as unavailable, full synchronization will not synchronize any object's data. In the case of incremental synchronization, if the Database properties allow Create, the newly created table and its data will be synchronized.