def rds_to_xlab_type()

in src/ab/plugins/db/rds.py [0:0]


    def rds_to_xlab_type(_type: str):
        ''' 把rds的类型转换成xlab的类型表示'''
        _type = _type.lower()
        if any(string_type in _type for string_type in ['char', 'text', 'json', 'enum']):
            return 'String'
        elif 'tinyint(1)' in _type:
            return 'Boolean'
        elif 'int' in _type:
            return 'Long'
        elif any(float_type in _type for float_type in ['float', 'double', 'decimal']):
            return 'Double'
        elif any(date_type in _type for date_type in ['date', 'time', 'year']):
            return 'Date'
        else:
            raise TypeError('不支持的rds数据类型: {_type}'.format(_type=_type))