manager.py 文件源码

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

项目:ldap2pg 作者: dalibo 项目源码 文件源码
def pg_fetch(self, psql, sql, processor=None):
        # Implement common management of customizable queries

        # Disabled inspection
        if sql is None:
            return []

        try:
            if isinstance(sql, list):
                # Static inspection
                rows = sql[:]
            else:
                rows = psql(sql)

            if processor:
                rows = processor(rows)
            if not isinstance(rows, list):
                rows = list(rows)
            return rows
        except psycopg2.ProgrammingError as e:
            # Consider the query as user defined
            raise UserError(str(e))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号