code: def dialect_class(self, adapter):
          
          if self.dialects.get(adapter):
              return self.dialects[adapter]
          try:
              class_prefix = getattr(
                  __import__('db.' + adapter, globals(), locals(),
                             ['__class_prefix__']), '__class_prefix__')
              driver = self._import_class('db.' + adapter + '.dialect.' +
                                          class_prefix + 'Dialect')
          except ImportError:
              raise DBError("Must install adapter `%s` or doesn't support" %
                            (adapter))
  
          self.dialects[adapter] = driver
          return driver
docs: Get dialect sql class by adapter