select.py 文件源码

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

项目:stackstorm-mysql 作者: StackStorm-Exchange 项目源码 文件源码
def select(self, query, data, key):
        q = query
        if data:
            values = self._list_to_string(data)
            q = q.format(values)

        c = self.db.cursor()
        try:
            c.execute(q)
            output = self._format_results(c)
            if key is not None:
                client = Client(base_url='http://localhost')
                client.keys.update(KeyValuePair(name=key, value=str(output)))
                return key
            else:
                return output
        except MySQLdb.Error, e:  # pylint: disable=no-member
            raise Exception(e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号