Logo
Shadow

Shadow #

Syntax #

SHOW SHADOW shadowRule | RULES [FROM databaseName]

SHOW SHADOW TABLE RULES [FROM databaseName]

SHOW SHADOW ALGORITHMS [FROM databaseName]

shadowRule: 
    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
propsShadow algorithm properties
is_defaultDefault

Example #

SHOW SHADOW RULES

mysql> SHOW SHADOW RULES;
+--------------------+-------------+-------------+--------------+
| rule_name          | source_name | shadow_name | shadow_table |
+--------------------+-------------+-------------+--------------+
| shadow_rule_1      | ds_1        | ds_shadow_1 | t_order      |
| shadow_rule_2      | ds_2        | ds_shadow_2 | t_order_item |
+--------------------+-------------+-------------+--------------+
2 rows in set (0.02 sec)

SHOW SHADOW RULE ruleName

mysql> SHOW SHADOW RULE shadow_rule_1;
+------------------+-------------+-------------+--------------+
| rule_name        | source_name | shadow_name | shadow_table |
+------------------+-------------+-------------+--------------+
| shadow_rule_1    | ds_1        | ds_shadow_1 | t_order      |
+------------------+-------------+-------------+--------------+
1 rows in set (0.01 sec)

SHOW SHADOW TABLE RULES

mysql> SHOW SHADOW TABLE RULES;
+--------------+--------------------------------------------------------------------------------+
| shadow_table | shadow_algorithm_name                                                          |
+--------------+--------------------------------------------------------------------------------+
| t_order_1    | user_id_match_algorithm,simple_hint_algorithm_1                                |  
+--------------+--------------------------------------------------------------------------------+
1 rows in set (0.01 sec)

SHOW SHADOW ALGORITHMS

mysql> SHOW SHADOW ALGORITHMS;
+-------------------------+--------------------+-------------------------------------------+----------------+
| shadow_algorithm_name   | type               | props                                     | is_default     |
+-------------------------+--------------------+-------------------------------------------+----------------+
| user_id_match_algorithm | REGEX_MATCH        | operation=insert,column=user_id,regex=[1] | false          |
| simple_hint_algorithm_1 | SIMPLE_HINT        | shadow=true,foo=bar                       | false          |
+-------------------------+--------------------+-------------------------------------------+----------------+
2 rows in set (0.01 sec)