def get_tables(self, schema, echo=True):
    'Get metadata for tables.'
    schemas = (schema if isinstance(schema, list) else [schema])

    def get_tables_for(schema):

        def get_rec(table):
            self._fields = ['schema', 'table']
            return tuple([schema, table])
            Rec = namedtuple('Table', 'schema table')
            self._fields = Rec._fields
            r_dict = dict(schema=schema, table=table)
            return Rec(**r_dict)
        sql_tmpl = self._template('metadata.tables')
        if sql_tmpl:
            tables = self.query(sql_tmpl.format(schema=schema))
            if hasattr(self, '_std_get_tables'):
                tables = self._std_get_tables(schema, tables)
        else:
            self.get_engine(echo=echo)
            tables = self.engine_inspect.get_table_names(schema)
        return [get_rec(v) for v in sorted(tables)]
    rows = []
    for schema in schemas:
        for row in get_tables_for(schema):
            rows.append(row)
    return rows
Get metadata for tables.
def get_tables(self, schema, echo=True):
    
    schemas = (schema if isinstance(schema, list) else [schema])

    def get_tables_for(schema):

        def get_rec(table):
            self._fields = ['schema', 'table']
            return tuple([schema, table])
            Rec = namedtuple('Table', 'schema table')
            self._fields = Rec._fields
            r_dict = dict(schema=schema, table=table)
            return Rec(**r_dict)
        sql_tmpl = self._template('metadata.tables')
        if sql_tmpl:
            tables = self.query(sql_tmpl.format(schema=schema))
            if hasattr(self, '_std_get_tables'):
                tables = self._std_get_tables(schema, tables)
        else:
            self.get_engine(echo=echo)
            tables = self.engine_inspect.get_table_names(schema)
        return [get_rec(v) for v in sorted(tables)]
    rows = []
    for schema in schemas:
        for row in get_tables_for(schema):
            rows.append(row)
    return rows