summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/result.py
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed 0.9 regression where the new sortable support for :class:`.RowProxy`Mike Bayer2014-01-281-3/+18
| | | | | | | | | would lead to ``TypeError`` when compared to non-tuple types as it attempted to apply tuple() to the "other" object unconditionally. The full range of Python comparison operators have now been implemented on :class:`.RowProxy`, using an approach that guarantees a comparison system that is equivalent to that of a tuple, and the "other" object is only coerced if it's an instance of RowProxy. [ticket:2924]
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - improve documentation for return_defaults() and returned_defaults. ↵Mike Bayer2013-12-201-1/+9
| | | | [ticket:2852]
* - The :class:`.RowProxy` object is now sortable in Python as a regularMike Bayer2013-11-191-1/+4
| | | | | | tuple is; this is accomplished via ensuring tuple() conversion on both sides within the ``__eq__()`` method as well as the addition of a ``__lt__()`` method. [ticket:2848]
* - The ``version_id_generator`` parameter of ``Mapper`` can now be specifiedMike Bayer2013-08-251-0/+10
| | | | | | | | | | | | | | | | | | | | | to rely upon server generated version identifiers, using triggers or other database-provided versioning features, by passing the value ``False``. The ORM will use RETURNING when available to immediately load the new version identifier, else it will emit a second SELECT. [ticket:2793] - The ``eager_defaults`` flag of :class:`.Mapper` will now allow the newly generated default values to be fetched using an inline RETURNING clause, rather than a second SELECT statement, for backends that support RETURNING. - Added a new variant to :meth:`.ValuesBase.returning` called :meth:`.ValuesBase.return_defaults`; this allows arbitrary columns to be added to the RETURNING clause of the statement without interfering with the compilers usual "implicit returning" feature, which is used to efficiently fetch newly generated primary key values. For supporting backends, a dictionary of all fetched values is present at :attr:`.ResultProxy.returned_defaults`. - add a glossary entry for RETURNING - add documentation for version id generation, [ticket:867]
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.
* do a sweep of some obvious 3kismsMike Bayer2013-05-261-2/+0
|
* - add a test specific to sqlite testing cursor.description encoding (shouldMike Bayer2013-05-261-0/+2
| | | | | probably be one in test_query or test_unicode...) - fix up test_unitofwork
* resultMike Bayer2013-04-281-2/+2
|
* - the raw 2to3 runMike Bayer2013-04-271-19/+19
| | | | - went through examples/ and cleaned out excess list() calls
* Reworked internal exception raises that emitMike Bayer2013-04-181-6/+0
| | | | | | | | | a rollback() before re-raising, so that the stack trace is preserved from sys.exc_info() before entering the rollback. This so that the traceback is preserved when using coroutine frameworks which may have switched contexts before the rollback function returns. [ticket:2703]
* A major fix to the way in which a select() object producesMike Bayer2013-04-111-1/+1
| | | | | | | | | | | | | | | | | | | labeled columns when apply_labels() is used; this mode produces a SELECT where each column is labeled as in <tablename>_<columnname>, to remove column name collisions for a multiple table select. The fix is that if two labels collide when combined with the table name, i.e. "foo.bar_id" and "foo_bar.id", anonymous aliasing will be applied to one of the dupes. This allows the ORM to handle both columns independently; previously, 0.7 would in some cases silently emit a second SELECT for the column that was "duped", and in 0.8 an ambiguous column error would be emitted. The "keys" applied to the .c. collection of the select() will also be deduped, so that the "column being replaced" warning will no longer emit for any select() that specifies use_labels, though the dupe key will be given an anonymous label which isn't generally user-friendly. [ticket:2702]
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* fixing broken links (see #2625)Diana Clarke2012-12-061-5/+5
|
* just a pep8 pass of lib/sqlalchemy/engine/Diana Clarke2012-11-191-0/+2
|
* - [feature] The Query can now load entity/scalar-mixedMike Bayer2012-10-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | "tuple" rows that contain types which aren't hashable, by setting the flag "hashable=False" on the corresponding TypeEngine object in use. Custom types that return unhashable types (typically lists) can set this flag to False. [ticket:2592] - [bug] Applying a column expression to a select statement using a label with or without other modifying constructs will no longer "target" that expression to the underlying Column; this affects ORM operations that rely upon Column targeting in order to retrieve results. That is, a query like query(User.id, User.id.label('foo')) will now track the value of each "User.id" expression separately instead of munging them together. It is not expected that any users will be impacted by this; however, a usage that uses select() in conjunction with query.from_statement() and attempts to load fully composed ORM entities may not function as expected if the select() named Column objects with arbitrary .label() names, as these will no longer target to the Column objects mapped by that entity. [ticket:2591]
* - [feature] Various API tweaks to the "dialect"Mike Bayer2012-10-081-1/+1
| | | | | | | API to better support highly specialized systems such as the Akiban database, including more hooks to allow an execution context to access type processors.
* mssql: - [bug] Fixed bug where reflection of primary key constraintMike Bayer2012-09-301-3/+2
| | | | | | | would double up columns if the same constraint/table existed in multiple schemas. - force returns_rows to False for inserts where we know rows shouldnt be returned; allows post_exec() to use the cursor without issue
* - [bug] Fixed cextension bug whereby theMike Bayer2012-08-221-1/+1
| | | | | | | | | | | | | | | | | | | "ambiguous column error" would fail to function properly if the given index were a Column object and not a string. Note there are still some column-targeting issues here which are fixed in 0.8. [ticket:2553] - find more cases where column targeting is being inaccurate, add more information to result_map to better differentiate "ambiguous" results from "present" or "not present". In particular, result_map is sensitive to dupes, even though no error is raised; the conflicting columns are added to the "obj" member of the tuple so that the two are both directly accessible in the result proxy - handwringing over the damn "name fallback" thing in results. can't really make it perfect yet - fix up oracle returning clause. not sure why its guarding against labels, remove that for now and see what the bot says.
* - break out engine/base.py into base, interfaces, result, util.Mike Bayer2012-08-071-0/+998
- remove deprecated 0.7 engine methods