summaryrefslogtreecommitdiff
path: root/test/orm/test_versioning.py
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed bug where :meth:`.Session.bulk_update_mappings` and relatedMike Bayer2015-12-141-0/+37
| | | | | | | | would not bump a version id counter when in use. The experience here is still a little rough as the original version id is required in the given dictionaries and there's not clean error reporting on that yet. fixes #3610
* - Fixed bug in :meth:`.Update.return_defaults` which would cause allMike Bayer2015-12-141-3/+16
| | | | | | | | | | | | | | insert-default holding columns not otherwise included in the SET clause (such as primary key cols) to get rendered into the RETURNING even though this is an UPDATE. - Major fixes to the :paramref:`.Mapper.eager_defaults` flag, this flag would not be honored correctly in the case that multiple UPDATE statements were to be emitted, either as part of a flush or a bulk update operation. Additionally, RETURNING would be emitted unnecessarily within update statements. fixes #3609
* - Fixed regression in 1.0 where new feature of using "executemany"Mike Bayer2015-10-191-0/+88
| | | | | | | | | for UPDATE statements in the ORM (e.g. :ref:`feature_updatemany`) would break on Postgresql and other RETURNING backends when using server-side version generation schemes, as the server side value is retrieved via RETURNING which is not supported with executemany. fixes #3556
* - add autoinc marker for oracleMike Bayer2015-06-251-2/+6
|
* - Fixed a major regression in the 1.0 series where the version_id_counterMike Bayer2015-06-241-0/+134
| | | | | | | | | | | | | feature would cause an object's version counter to be incremented when there was no net change to the object's row, but instead an object related to it via relationship (e.g. typically many-to-one) were associated or de-associated with it, resulting in an UPDATE statement that updates the object's version counter and nothing else. In the use case where the relatively recent "server side" and/or "programmatic/conditional" version counter feature were used (e.g. setting version_id_generator to False), the bug could cause an UPDATE without a valid SET clause to be emitted. fixes #3465
* - further fixes and even better tests for this blockMike Bayer2015-01-191-1/+27
|
* - continue moving things out that don't need to be thereMike Bayer2014-08-301-0/+14
| | | | | | - an existing state shouldn't need its load_options/load_path updated; it should maintain those from its original Query source. there's no tests that check this behavior
* - fix whitespaceMike Bayer2014-07-251-2/+2
|
* PEP8 tidy for test/orm/test_versioning.pyTony Locke2014-07-191-148/+179
|
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-1/+1
| | | | Found using: https://github.com/intgr/topy
* - fix the uuid routine here to not run out of uuidsMike Bayer2014-03-241-20/+2
|
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-241-0/+7
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* - modify what we did in [ticket:2793] so that we can also set theMike Bayer2013-09-061-0/+86
| | | | | version id programmatically outside of the generator. using this system, we can also leave the version id alone.
* - ensure rowcount is returned for an UPDATE with no implicit returningMike Bayer2013-08-251-1/+1
| | | | | - modernize test for that - use py3k compatible next() in test_returning/test_versioning
* - The ``version_id_generator`` parameter of ``Mapper`` can now be specifiedMike Bayer2013-08-251-4/+191
| | | | | | | | | | | | | | | | | | | | | 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]
* getting everything to pass againMike Bayer2012-09-271-1/+2
|
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-5/+5
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* - [bug] Fixed bug where incorrect type informationMike Bayer2012-09-161-2/+8
| | | | | | would be passed when the ORM would bind the "version" column, when using the "version" feature. Tests courtesy Daniel Miller. [ticket:2539]
* Added test and fix for version_id_col bug.Daniel Miller2012-09-121-1/+36
|
* -whitespace bonanza, contdMike Bayer2012-07-281-14/+14
|
* wrap another StaleDataError detection in supports_sane_row_countPhilip Jenvey2011-05-111-6/+8
|
* update warnings per zxjdbcPhilip Jenvey2011-04-231-2/+11
|
* - move all the comments that got shoved below the fixture grabs back upMike Bayer2011-03-271-5/+9
|
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-12/+13
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* - move all the setup_classes(cls) and setup_mappers(cls) to use aMike Bayer2011-03-271-6/+6
| | | | | local cls.Basic, cls.Comparable base class so that there is no ambiguity or hash identity behaviors getting in the way of class registration.
* - remove @testing.resolve_artifact_names, replace with direct attributeMike Bayer2011-03-261-22/+62
| | | | | | | access to the cls/self.tables/classes registries - express orm/_base.py ORMTest in terms of engine/_base.py TablesTest, factor out common steps into TablesTest, remove AltEngineTest as a separate class. will further consolidate these base classes
* - fix oracle testsMike Bayer2011-01-251-1/+1
| | | | - fix some obnoxious type adaption issues resulting from the "adapt must copy" change
* - Session.merge() will check the version id of the incomingMike Bayer2011-01-181-28/+86
| | | | | | | state against that of the database, assuming the mapping uses version ids and incoming state has a version_id assigned, and raise StaleDataError if they don't match. [ticket:2027]
* - whitespace removal bonanzaMike Bayer2011-01-021-25/+24
|
* - merge rfc0b9df5d9e0 from 0.6 branchMike Bayer2010-12-281-3/+91
|
* - move sqlalchemy.test to test.libMike Bayer2010-11-151-3/+3
|
* - The name ConcurrentModificationError has beenMike Bayer2010-08-011-12/+34
| | | | | | | | | | changed to StaleDataError, and descriptive error messages have been revised to reflect exactly what the issue is. Both names will remain available for the forseeable future for schemes that may be specifying ConcurrentModificationError in an "except:" clause.
* - The value of version_id_col can be changedMike Bayer2010-07-241-3/+41
| | | | | | | | | | | | | manually, and this will result in an UPDATE of the row. Versioned UPDATEs and DELETEs now use the "committed" value of the version_id_col in the WHERE clause and not the pending changed value. The version generator is also bypassed if manual changes are present on the attribute. [ticket:1857] - ensure before_update/after_update called on parent for collection change
* - apparently [ticket:1761] was covered in tests already.Mike Bayer2010-04-041-1/+1
| | | | | | | | | - Usage of version_id_col on a backend that supports cursor.rowcount for execute() but not executemany() now works when a delete is issued (already worked for saves, since those don't use executemany()). For a backend that doesn't support cursor.rowcount at all, a warning is emitted the same as with saves. [ticket:1761]
* - Session.refresh() now does an equivalent expire()Mike Bayer2010-03-291-10/+32
| | | | | | | | | | | | | | | | on the given instance first, so that the "refresh-expire" cascade is propagated. Previously, refresh() was not affected in any way by the presence of "refresh-expire" cascade. This is a change in behavior versus that of 0.6beta2, where the "lockmode" flag passed to refresh() would cause a version check to occur. Since the instance is first expired, refresh() always upgrades the object to the most recent version. - The 'refresh-expire' cascade, when reaching a pending object, will expunge the object if the cascade also includes "delete-orphan", or will simply detach it otherwise. [ticket:1754]
* - added "lockmode" kw argument to Session.refresh(), willMike Bayer2010-03-191-1/+14
| | | | | | pass through the string value to Query the same as in with_lockmode(), will also do version check for a version_id_col-enabled mapping.
* - The official name for the relation() function is nowMike Bayer2010-03-171-3/+3
| | | | | | relationship(), to eliminate confusion over the relational algebra term. relation() however will remain available in equal capacity for the foreseeable future. [ticket:1740]
* - Fixed bug which caused "row switch" logic, that is anMike Bayer2010-03-161-0/+307
INSERT and DELETE replaced by an UPDATE, to fail when version_id_col was in use. [ticket:1692] - Added "version_id_generator" argument to Mapper, this is a callable that, given the current value of the "version_id_col", returns the next version number. Can be used for alternate versioning schemes such as uuid, timestamps. [ticket:1692]