code: def db_type(cls, dtype):
          
          if isinstance(dtype, ExtensionDtype):
              return cls.type_map.get(dtype.kind)
          elif hasattr(dtype, 'char'):
              return cls.type_map.get(dtype.char)
docs: Given a numpy dtype, Returns a generic database type