當前位置: 首頁>>代碼示例>>Python>>正文


Python expression._select_iterables方法代碼示例

本文整理匯總了Python中sqlalchemy.sql.expression._select_iterables方法的典型用法代碼示例。如果您正苦於以下問題:Python expression._select_iterables方法的具體用法?Python expression._select_iterables怎麽用?Python expression._select_iterables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sqlalchemy.sql.expression的用法示例。


在下文中一共展示了expression._select_iterables方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [as 別名]
def returning_clause(self, stmt, returning_cols):
        self.returning_cols = list(
            expression._select_iterables(returning_cols))

        # within_columns_clause=False so that labels (foo AS bar) don't render
        columns = [self.process(c, within_columns_clause=False)
                   for c in self.returning_cols]

        if not hasattr(self, 'returning_parameters'):
            self.returning_parameters = []

        binds = []
        for i, col in enumerate(self.returning_cols):
            dbtype = col.type.dialect_impl(
                self.dialect).get_dbapi_type(self.dialect.dbapi)
            self.returning_parameters.append((i + 1, dbtype))

            bindparam = sql.bindparam(
                "ret_%d" % i, value=ReturningParam(dbtype))
            self.binds[bindparam.key] = bindparam
            binds.append(
                self.bindparam_string(self._truncate_bindparam(bindparam)))

        return 'RETURNING ' + ', '.join(columns) + " INTO " + ", ".join(binds) 
開發者ID:jpush,項目名稱:jbox,代碼行數:26,代碼來源:zxjdbc.py

示例2: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [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

示例3: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [as 別名]
def returning_clause(self, stmt, returning_cols):
        self.returning_cols = list(
            expression._select_iterables(returning_cols))

        # within_columns_clause=False so that labels (foo AS bar) don't render
        columns = [self.process(c, within_columns_clause=False,
                                result_map=self.result_map)
                   for c in self.returning_cols]

        if not hasattr(self, 'returning_parameters'):
            self.returning_parameters = []

        binds = []
        for i, col in enumerate(self.returning_cols):
            dbtype = col.type.dialect_impl(
                self.dialect).get_dbapi_type(self.dialect.dbapi)
            self.returning_parameters.append((i + 1, dbtype))

            bindparam = sql.bindparam(
                "ret_%d" % i, value=ReturningParam(dbtype))
            self.binds[bindparam.key] = bindparam
            binds.append(
                self.bindparam_string(self._truncate_bindparam(bindparam)))

        return 'RETURNING ' + ', '.join(columns) + " INTO " + ", ".join(binds) 
開發者ID:gltn,項目名稱:stdm,代碼行數:27,代碼來源:zxjdbc.py

示例4: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [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

示例5: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [as 別名]
def returning_clause(self, stmt, returning_cols):
        self.returning_cols = list(expression._select_iterables(returning_cols))

        # within_columns_clause=False so that labels (foo AS bar) don't render
        columns = [self.process(c, within_columns_clause=False, result_map=self.result_map)
                   for c in self.returning_cols]

        if not hasattr(self, 'returning_parameters'):
            self.returning_parameters = []

        binds = []
        for i, col in enumerate(self.returning_cols):
            dbtype = col.type.dialect_impl(self.dialect).get_dbapi_type(self.dialect.dbapi)
            self.returning_parameters.append((i + 1, dbtype))

            bindparam = sql.bindparam("ret_%d" % i, value=ReturningParam(dbtype))
            self.binds[bindparam.key] = bindparam
            binds.append(self.bindparam_string(self._truncate_bindparam(bindparam)))

        return 'RETURNING ' + ', '.join(columns) + " INTO " + ", ".join(binds) 
開發者ID:binhex,項目名稱:moviegrabber,代碼行數:22,代碼來源:zxjdbc.py

示例6: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [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

示例7: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [as 別名]
def returning_clause(self, stmt, returning_cols):
        columns = [
            self._label_select_column(None, c, True, False, {})
            for c in expression._select_iterables(returning_cols)
        ]

        return 'RETURNING ' + ', '.join(columns) 
開發者ID:jpush,項目名稱:jbox,代碼行數:9,代碼來源:base.py

示例8: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [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

示例9: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [as 別名]
def returning_clause(self, stmt, returning_cols):
        columns = [
            self._label_select_column(None, c, True, False, {})
            for c in expression._select_iterables(returning_cols)
        ]

        return "RETURNING " + ", ".join(columns) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:9,代碼來源:base.py

示例10: returning_clause

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _select_iterables [as 別名]
def returning_clause(self, stmt, returning_cols):
        columns = [
                self._label_select_column(None, c, True, False, {})
                for c in expression._select_iterables(returning_cols)
            ]

        return 'RETURNING ' + ', '.join(columns) 
開發者ID:binhex,項目名稱:moviegrabber,代碼行數:9,代碼來源:base.py


注:本文中的sqlalchemy.sql.expression._select_iterables方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。