Shadow

Syntax

  1. SHOW SHADOW shadowRule | RULES [FROM schemaName]
  2. SHOW SHADOW TABLE RULES [FROM schemaName]
  3. SHOW SHADOW ALGORITHMS [FROM schemaName]
  4. shadowRule:
  5. RULE ruleName
  • Support querying all shadow rules and specified table query
  • Support querying all shadow table rules
  • Support querying all shadow algorithms

Return Value Description

Shadow Rule

ColumnDescription
rule_nameRule name
source_nameSource database
shadow_nameShadow database
shadow_tableShadow table

Shadow Table Rule

ColumnDescription
shadow_tableShadow table
shadow_algorithm_nameShadow algorithm name

Shadow Algorithms

ColumnDescription
shadow_algorithm_nameShadow algorithm name
typeShadow algorithm type
propertiesShadow algorithm parameters

Example

SHOW SHADOW RULES

  1. mysql> show shadow rules;
  2. +--------------------+-------------+-------------+--------------+
  3. | rule_name | source_name | shadow_name | shadow_table |
  4. +--------------------+-------------+-------------+--------------+
  5. | shadow_rule_1 | ds_1 | ds_shadow_1 | t_order |
  6. | shadow_rule_2 | ds_2 | ds_shadow_2 | t_order_item |
  7. +--------------------+-------------+-------------+--------------+
  8. 2 rows in set (0.02 sec)

SHOW SHADOW RULE ruleName

  1. mysql> show shadow rule shadow_rule_1;
  2. +------------------+-------------+-------------+--------------+
  3. | rule_name | source_name | shadow_name | shadow_table |
  4. +------------------+-------------+-------------+--------------+
  5. | shadow_rule_1 | ds_1 | ds_shadow_1 | t_order |
  6. +------------------+-------------+-------------+--------------+
  7. 1 rows in set (0.01 sec)

SHOW SHADOW TABLE RULES

  1. mysql> show shadow table rules;
  2. +--------------+--------------------------------------------------------------------------------+
  3. | shadow_table | shadow_algorithm_name |
  4. +--------------+--------------------------------------------------------------------------------+
  5. | t_order_1 | user_id_match_algorithm,simple_note_algorithm_1 |
  6. +--------------+--------------------------------------------------------------------------------+
  7. 1 rows in set (0.01 sec)

SHOW SHADOW ALGORITHMS

  1. mysql> show shadow algorithms;
  2. +-------------------------+--------------------+-------------------------------------------+
  3. | shadow_algorithm_name | type | properties |
  4. +-------------------------+--------------------+-------------------------------------------+
  5. | user_id_match_algorithm | COLUMN_REGEX_MATCH | operation=insert,column=user_id,regex=[1] |
  6. | simple_note_algorithm_1 | SIMPLE_NOTE | shadow=true,foo=bar |
  7. +-------------------------+--------------------+-------------------------------------------+
  8. 2 rows in set (0.01 sec)