Skip to content

Commit

Permalink
Merge pull request #1315 from cpzt/master
Browse files Browse the repository at this point in the history
Redis hgetall结果不展示
  • Loading branch information
hhyo authored Jan 4, 2022
2 parents f588e8b + c2137b4 commit af13722
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sql/engines/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def query(self, db_name=None, sql='', limit_num=0, close_conn=True, **kwargs):
else:
result_set.rows = tuple([row] for row in rows)
result_set.affected_rows = len(rows)
elif isinstance(rows, dict):
result_set.column_list = ["field", "value"]
result_set.rows = tuple([[k, v] for k, v in rows.items()])
result_set.affected_rows = len(result_set.rows)
else:
result_set.rows = tuple([[rows]])
result_set.affected_rows = 1 if rows else 0
Expand Down

0 comments on commit af13722

Please sign in to comment.