ddlsession.py 文件源码

python
阅读 67 收藏 0 点赞 0 评论 0

项目:asyncqlio 作者: SunDwarf 项目源码 文件源码
def get_indexes(self, table_name: str = None) \
            -> 'typing.Generator[md_index.Index, None, None]':
        """
        Yields a :class:`.md_index.Index` for each index in the specified table,
        or for each index in the schema if no table is specified.

        These indexes don't point to a :class:`.md_table.Table` since there
        might not be one, but they have a table_name attribute.

        :param table_name: The table to get indexes from, or all tables if omitted
        """
        params = {"table_name": table_name}
        emitter = self.bind.emit_param

        sql = self.bind.dialect.get_index_sql(table_name, emitter=emitter)
        cur = await self.transaction.cursor(sql, params)
        records = await cur.flatten()
        await cur.close()

        return self.bind.dialect.transform_rows_to_indexes(*records, table_name=table_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号