当前位置: 首页>>代码示例>>Python>>正文


Python sql.outparam方法代码示例

本文整理汇总了Python中sqlalchemy.sql.outparam方法的典型用法代码示例。如果您正苦于以下问题:Python sql.outparam方法的具体用法?Python sql.outparam怎么用?Python sql.outparam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sqlalchemy.sql的用法示例。


在下文中一共展示了sql.outparam方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: returning_clause

# 需要导入模块: from sqlalchemy import sql [as 别名]
# 或者: from sqlalchemy.sql import outparam [as 别名]
def returning_clause(self, stmt, returning_cols):
        columns = []
        binds = []
        for i, column in enumerate(
                expression._select_iterables(returning_cols)):
            if column.type._has_column_expression:
                col_expr = column.type.column_expression(column)
            else:
                col_expr = column
            outparam = sql.outparam("ret_%d" % i, type_=column.type)
            self.binds[outparam.key] = outparam
            binds.append(
                self.bindparam_string(self._truncate_bindparam(outparam)))
            columns.append(
                self.process(col_expr, within_columns_clause=False))

            self._add_to_result_map(
                outparam.key, outparam.key,
                (column, getattr(column, 'name', None),
                 getattr(column, 'key', None)),
                column.type
            )

        return 'RETURNING ' + ', '.join(columns) + " INTO " + ", ".join(binds) 
开发者ID:jpush,项目名称:jbox,代码行数:26,代码来源:base.py

示例2: returning_clause

# 需要导入模块: from sqlalchemy import sql [as 别名]
# 或者: from sqlalchemy.sql import outparam [as 别名]
def returning_clause(self, stmt, returning_cols):
        columns = []
        binds = []
        for i, column in enumerate(
                expression._select_iterables(returning_cols)):
            if column.type._has_column_expression:
                col_expr = column.type.column_expression(column)
            else:
                col_expr = column
            outparam = sql.outparam("ret_%d" % i, type_=column.type)
            self.binds[outparam.key] = outparam
            binds.append(
                self.bindparam_string(self._truncate_bindparam(outparam)))
            columns.append(
                self.process(col_expr, within_columns_clause=False))
            self.result_map[outparam.key] = (
                outparam.key,
                (column, getattr(column, 'name', None),
                 getattr(column, 'key', None)),
                column.type
            )

        return 'RETURNING ' + ', '.join(columns) + " INTO " + ", ".join(binds) 
开发者ID:gltn,项目名称:stdm,代码行数:25,代码来源:base.py

示例3: returning_clause

# 需要导入模块: from sqlalchemy import sql [as 别名]
# 或者: from sqlalchemy.sql import outparam [as 别名]
def returning_clause(self, stmt, returning_cols):
        columns = []
        binds = []
        for i, column in enumerate(expression._select_iterables(returning_cols)):
            if column.type._has_column_expression:
                col_expr = column.type.column_expression(column)
            else:
                col_expr = column
            outparam = sql.outparam("ret_%d" % i, type_=column.type)
            self.binds[outparam.key] = outparam
            binds.append(self.bindparam_string(self._truncate_bindparam(outparam)))
            columns.append(self.process(col_expr, within_columns_clause=False))
            self.result_map[outparam.key] = (
                outparam.key,
                (column, getattr(column, 'name', None),
                                        getattr(column, 'key', None)),
                column.type
            )

        return 'RETURNING ' + ', '.join(columns) + " INTO " + ", ".join(binds) 
开发者ID:binhex,项目名称:moviegrabber,代码行数:22,代码来源:base.py

示例4: returning_clause

# 需要导入模块: from sqlalchemy import sql [as 别名]
# 或者: from sqlalchemy.sql import outparam [as 别名]
def returning_clause(self, stmt, returning_cols):
        columns = []
        binds = []

        for i, column in enumerate(
                expression._select_iterables(returning_cols)):
            if column.type._has_column_expression:
                col_expr = column.type.column_expression(column)
            else:
                col_expr = column

            outparam = sql.outparam("ret_%d" % i, type_=column.type)
            self.binds[outparam.key] = outparam
            binds.append(
                self.bindparam_string(self._truncate_bindparam(outparam)))
            columns.append(
                self.process(col_expr, within_columns_clause=False))

            self._add_to_result_map(
                getattr(col_expr, 'name', col_expr.anon_label),
                getattr(col_expr, 'name', col_expr.anon_label),
                (column, getattr(column, 'name', None),
                 getattr(column, 'key', None)),
                column.type
            )

        return 'RETURNING ' + ', '.join(columns) + " INTO " + ", ".join(binds) 
开发者ID:yfauser,项目名称:planespotter,代码行数:29,代码来源:base.py


注:本文中的sqlalchemy.sql.outparam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。