Retro Eye care Haitian Deep Dark Default

MASK

Storage unit Operation

REGISTER STORAGE UNIT ds_0 (
    HOST="127.0.0.1",
    PORT=3306,
    DB="ds_0",
    USER="root",
    PASSWORD="root"
);

Rule Operation

  • Create mask rule
CREATE MASK RULE t_mask (
    COLUMNS(
        (NAME=phone_number,TYPE(NAME='MASK_FROM_X_TO_Y', PROPERTIES("from-x"=1, "to-y"=2, "replace-char"="*"))),
        (NAME=address,TYPE(NAME='MD5'))
));
  • Create mask table
CREATE TABLE `t_mask` (
    `id` int(11) NOT NULL,
    `user_id` varchar(45) DEFAULT NULL,
    `phone_number` varchar(45) DEFAULT NULL,
    `address` varchar(45) DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  • Alter mask rule
ALTER MASK RULE t_mask (
    COLUMNS(
        (NAME=user_id,TYPE(NAME='MD5'))
));
  • Drop mask rule
DROP MASK RULE t_mask;
  • Unregister storage unit
UNREGISTER STORAGE UNIT ds_0;
  • Drop distributed database
DROP DATABASE mask_db;