# sqlalchemy 2.1.9 (MIT), harvested by tools/harvest_corpus.py
=== input
Merge a cursor.description with compiled result column information.

        There are at least four separate strategies used here, selected
        depending on the type of SQL construct used to start with.

        The most common case is that of the compiled SQL expression construct,
        which generated the column names present in the raw SQL string and
        which has the identical number of columns as were reported by
        cursor.description.  In this case, we assume a 1-1 positional mapping
        between the entries in cursor.description and the compiled object.
        This is also the most performant case as we disregard extracting /
        decoding the column names present in cursor.description since we
        already have the desired name we generated in the compiled SQL
        construct.

        The next common case is that of the completely raw string SQL,
        such as passed to connection.execute().  In this case we have no
        compiled construct to work with, so we extract and decode the
        names from cursor.description and index those as the primary
        result row target keys.

        The remaining fairly common case is that of the textual SQL
        that includes at least partial column information; this is when
        we use a :class:`_expression.TextualSelect` construct.
        This construct may have
        unordered or ordered column information.  In the ordered case, we
        merge the cursor.description and the compiled construct's information
        positionally, and warn if there are additional description names
        present, however we still decode the names in cursor.description
        as we don't have a guarantee that the names in the columns match
        on these.   In the unordered case, we match names in cursor.description
        to that of the compiled construct based on name matching.
        In both of these cases, the cursor.description names and the column
        expression objects and names are indexed as result row target keys.

        The final case is much less common, where we have a compiled
        non-textual SQL expression construct, but the number of columns
        in cursor.description doesn't match what's in the compiled
        construct.  We make the guess here that there might be textual
        column expressions in the compiled construct that themselves include
        a comma in them causing them to split.  We do the same name-matching
        as with textual non-ordered columns.

        The name-matched system of merging is the same as that used by
        SQLAlchemy for all cases up through the 0.9 series.   Positional
        matching for compiled SQL expressions was introduced in 1.0 as a
        major performance feature, and positional matching for textual
        :class:`_expression.TextualSelect` objects in 1.1.
        As name matching is no longer
        a common case, it was acceptable to factor it into smaller generator-
        oriented methods that are easier to understand, but incur slightly
        more performance overhead.

        
=== parse rest
short_description: 'Merge a cursor.description with compiled result column information.'
long_description: |
  There are at least four separate strategies used here, selected
  depending on the type of SQL construct used to start with.
  
  The most common case is that of the compiled SQL expression construct,
  which generated the column names present in the raw SQL string and
  which has the identical number of columns as were reported by
  cursor.description.  In this case, we assume a 1-1 positional mapping
  between the entries in cursor.description and the compiled object.
  This is also the most performant case as we disregard extracting /
  decoding the column names present in cursor.description since we
  already have the desired name we generated in the compiled SQL
  construct.
  
  The next common case is that of the completely raw string SQL,
  such as passed to connection.execute().  In this case we have no
  compiled construct to work with, so we extract and decode the
  names from cursor.description and index those as the primary
  result row target keys.
  
  The remaining fairly common case is that of the textual SQL
  that includes at least partial column information; this is when
  we use a :class:`_expression.TextualSelect` construct.
  This construct may have
  unordered or ordered column information.  In the ordered case, we
  merge the cursor.description and the compiled construct's information
  positionally, and warn if there are additional description names
  present, however we still decode the names in cursor.description
  as we don't have a guarantee that the names in the columns match
  on these.   In the unordered case, we match names in cursor.description
  to that of the compiled construct based on name matching.
  In both of these cases, the cursor.description names and the column
  expression objects and names are indexed as result row target keys.
  
  The final case is much less common, where we have a compiled
  non-textual SQL expression construct, but the number of columns
  in cursor.description doesn't match what's in the compiled
  construct.  We make the guess here that there might be textual
  column expressions in the compiled construct that themselves include
  a comma in them causing them to split.  We do the same name-matching
  as with textual non-ordered columns.
  
  The name-matched system of merging is the same as that used by
  SQLAlchemy for all cases up through the 0.9 series.   Positional
  matching for compiled SQL expressions was introduced in 1.0 as a
  major performance feature, and positional matching for textual
  :class:`_expression.TextualSelect` objects in 1.1.
  As name matching is no longer
  a common case, it was acceptable to factor it into smaller generator-
  oriented methods that are easier to understand, but incur slightly
  more performance overhead.
blank_after_short_description: True
blank_after_long_description: False
style: rest
=== detect
rest
=== compose rest
Merge a cursor.description with compiled result column information.

There are at least four separate strategies used here, selected
depending on the type of SQL construct used to start with.

The most common case is that of the compiled SQL expression construct,
which generated the column names present in the raw SQL string and
which has the identical number of columns as were reported by
cursor.description.  In this case, we assume a 1-1 positional mapping
between the entries in cursor.description and the compiled object.
This is also the most performant case as we disregard extracting /
decoding the column names present in cursor.description since we
already have the desired name we generated in the compiled SQL
construct.

The next common case is that of the completely raw string SQL,
such as passed to connection.execute().  In this case we have no
compiled construct to work with, so we extract and decode the
names from cursor.description and index those as the primary
result row target keys.

The remaining fairly common case is that of the textual SQL
that includes at least partial column information; this is when
we use a :class:`_expression.TextualSelect` construct.
This construct may have
unordered or ordered column information.  In the ordered case, we
merge the cursor.description and the compiled construct's information
positionally, and warn if there are additional description names
present, however we still decode the names in cursor.description
as we don't have a guarantee that the names in the columns match
on these.   In the unordered case, we match names in cursor.description
to that of the compiled construct based on name matching.
In both of these cases, the cursor.description names and the column
expression objects and names are indexed as result row target keys.

The final case is much less common, where we have a compiled
non-textual SQL expression construct, but the number of columns
in cursor.description doesn't match what's in the compiled
construct.  We make the guess here that there might be textual
column expressions in the compiled construct that themselves include
a comma in them causing them to split.  We do the same name-matching
as with textual non-ordered columns.

The name-matched system of merging is the same as that used by
SQLAlchemy for all cases up through the 0.9 series.   Positional
matching for compiled SQL expressions was introduced in 1.0 as a
major performance feature, and positional matching for textual
:class:`_expression.TextualSelect` objects in 1.1.
As name matching is no longer
a common case, it was acceptable to factor it into smaller generator-
oriented methods that are easier to understand, but incur slightly
more performance overhead.
