docs: def refresh_schema(self, exclude_system_tables=True, use_cache=False):
          """
          Pulls your database's schema again and looks for any new tables and
          columns.
          """
  
          col_meta, table_meta = self._get_db_metadata(exclude_system_tables, use_cache)
          tables = self._gen_tables_from_col_tuples(col_meta)
  
          # Three modes for refreshing schema
          # 1. load directly from cache
          # 2. use a single query for getting all key relationships
          # 3. use the naive approach
          if use_cache:
              # generate our Tables, and load them into a TableSet
              self._tables = TableSet([Table(self.con, self._query_templates, table_meta[t]['schema'], t, tables[t],
                                             keys_per_column=self.keys_per_column,
                                             foreign_keys=table_meta[t]['foreign_keys']['columns'],
                                             ref_keys=table_meta[t]['ref_keys']['columns'])
                                       for t in sorted(tables.keys())])
  
          # optimize the foreign/ref key query by doing it one time, database-wide, if query is available
          elif not use_cache and isinstance(self._query_templates.get('system', {}).get('foreign_keys_for_db', None), str):
  
              self.cur.execute(self._query_templates['system']['foreign_keys_for_db'])
              table_db_foreign_keys = defaultdict(list)
              for rel in self.cur:
                  # second value in relationship tuple is the table name
                  table_db_foreign_keys[rel[1]].append(rel)
  
              self.cur.execute(self._query_templates['system']['ref_keys_for_db'])
              table_db_ref_keys = defaultdict(list)
              for rel in self.cur:
                  # second value in relationship tuple is the table name
                  table_db_ref_keys[rel[1]].append(rel)
  
              # generate our Tables, and load them into a TableSet
              self._tables = TableSet([Table(self.con, self._query_templates, tables[t][0].schema, t, tables[t],
                                             keys_per_column=self.keys_per_column,
                                             foreign_keys=table_db_foreign_keys[t], ref_keys=table_db_ref_keys[t])
                                       for t in sorted(tables.keys())])
          elif not use_cache:
              self._tables = TableSet([Table(self.con, self._query_templates, tables[t][0].schema, t, tables[t],
                                             keys_per_column=self.keys_per_column) for t in sorted(tables.keys())])
  
          sys.stderr.write("done!\n")