// AddRule adds a rule into table router
AddRule adds a rule into table router
// AddRule adds a rule into table router
func (r *Table) AddRule(rule *TableRule) error {
	err := rule.Valid()
	if err != nil {
		return errors.Trace(err)
	}
	err = r.Insert(rule.SchemaPattern, rule.TablePattern, rule, false)
	if err != nil {
		return errors.Annotatef(err, "add rule %+v into table router", rule)
	}
	return nil
}
func ( r * Table ) AddRule ( rule * TableRule ) error { err := rule . Valid ( ) if err != nil { return errors . Trace ( err ) } err = r . Insert ( rule . SchemaPattern , rule . TablePattern , rule , false ) if err != nil { return errors . Annotatef ( err , " " , rule ) } return nil }
AddRule adds a rule into table router
AddRule adds a rule into table router