def _get_index_columns(self, tbl_name):
ixs = sql.read_sql_query(
"SHOW INDEX IN %s" % tbl_name, self.conn)
ix_cols = {}
for ix_name, ix_col in zip(ixs.Key_name, ixs.Column_name):
if ix_name not in ix_cols:
ix_cols[ix_name] = []
ix_cols[ix_name].append(ix_col)
return list(ix_cols.values())
# TODO: cruft?
# def test_to_sql_save_index(self):
# self._to_sql_save_index()
# for ix_name, ix_col in zip(ixs.Key_name, ixs.Column_name):
# if ix_name not in ix_cols:
# ix_cols[ix_name] = []
# ix_cols[ix_name].append(ix_col)
# return ix_cols.values()
test_sql.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录