'Parse a KEY or CONSTRAINT line.
:param line: A line of SHOW CREATE TABLE output'

def _parse_constraints(self, line):

    m = self._re_key.match(line)
    if m:
        spec = m.groupdict()
        spec['columns'] = self._parse_keyexprs(spec['columns'])
        return ('key', spec)
    m = self._re_constraint.match(line)
    if m:
        spec = m.groupdict()
        spec['table'] = self.preparer.unformat_identifiers(spec['table'])
        spec['local'] = [c[0] for c in self._parse_keyexprs(spec['local'])]
        spec['foreign'] = [c[0] for c in self._parse_keyexprs(spec['foreign'])]
        return ('constraint', spec)
    m = self._re_partition.match(line)
    if m:
        return ('partition', line)
    return (None, line)
