code: def _swap_database(self, query):
          
          database = _query_db(query)
  
          if database == self.database:
              return query
  
          if self._subclassed(peewee.PostgresqlDatabase, database,
                              self.database):
              can_swap = True
          elif self._subclassed(peewee.MySQLDatabase, database,
                                self.database):
              can_swap = True
          else:
              can_swap = False
  
          if can_swap:
              # **Experimental** database swapping!
              query = query.clone()
              query._database = self.database
              return query
  
          assert False, (
              "Error, query's database and manager's database are "
              "different. Query: %s Manager: %s" % (database, self.database)
          )
  
          return None
docs: Swap database for query if swappable. Return **new query**
          with swapped database.
  
          This is experimental feature which allows us to have multiple
          managers configured against different databases for single model
          definition.
  
          The essential limitation though is that database backend have
          to be **the same type** for model and manager!