summaryrefslogtreecommitdiff
path: root/examples/versioned_history
Commit message (Collapse)AuthorAgeFilesLines
* Rename py.test to pytestGord Thompson2020-04-161-3/+3
| | | | Change-Id: I431e1ef41e26d490343204a75a5c097768749768
* Simplified module pre-loading strategy and made it linter friendlyFederico Caselli2020-03-071-1/+1
| | | | | | | | | | | | | | | | | Introduced a modules registry to register modules that should be lazily loaded in the package init. This ensures that they are in the system module cache, avoiding potential thread safety issues as when importing them directly in the function that uses them. The module registry is used to obtain these modules directly, ensuring that the all the lazily loaded modules are resolved at the proper time This replaces dependency_for decorator and the dependencies decorator logic, removing the need to pass the resolved modules as arguments of the decodated functions and removes possible errors caused by linters. Fixes: #4689 Fixes: #4656 Change-Id: I2e291eba4297867fc0ddb5d875b9f7af34751d01
* Integrate mapper-level version_id_col with versioned_historyMike Bayer2020-01-103-2/+26
| | | | | | | | | | | | as the versioned_history example supplies an integer version counter for the purposes of generating an audit trail, this counter is also suited to be used for optimistic concurrency detection using the version_id_col feature. Build upon the test that was first added in ac54ba0f2d8df5a76b6852841b6b3321c0e6c0e2 to provide a flag and some basic documentation. Fixes: #2861 Change-Id: I50236beae4c49b33ada8fdcc4c524273b4e21c75
* Fix typosMin ho Kim2019-07-211-1/+1
|
* Use py.test for versioned_history tests, nose no longer runsMike Bayer2019-05-251-3/+6
| | | | | | | without warnings under python 3 Fixes: #4697 Change-Id: I46d395d3b6642acd9317e27d6a5723ae5201e877
* Post black reformattingMike Bayer2019-01-063-30/+40
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-063-234/+278
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* - modernize versioning examplesMike Bayer2018-05-051-0/+3
| | | | | | - add new example versioned_rows_w_versionid Change-Id: I592cd5eb7db50162b4c4ad6191813d9def2b6d7c
* Set autoincrement to False; use sqlite_autoincrement in versioned_historyCarlos GarcĂ­a Montoro2017-01-092-1/+50
| | | | | | | | | | | | Ensure that the history table sets autoincrement=False, since these values are copied in all cases; the flag will emit an error as of 1.1 if the primary key is composite. Additionally, use the sqlite_autoincrement flag so that SQLite uses unique primary key identifiers for new rows even if some rows have been deleted. Fixes: #3872 Change-Id: I65912eb394b3b69d7f4e3c098f4f948b0a7a5374 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/93
* - Fixed two issues in the "history_meta" example where history trackingMike Bayer2015-08-242-4/+69
| | | | | | could encounter empty history, and where a column keyed to an alternate attribute name would fail to track properly. Fixes courtesy Alex Fraser.
* - Updated the :ref:`examples_versioned_history` example such thatMike Bayer2014-11-262-21/+97
| | | | | | | | | | mapped columns are re-mapped to match column names as well as grouping of columns; in particular, this allows columns that are explicitly grouped in a same-column-named joined inheritance scenario to be mapped in the same way in the history mappings, avoiding warnings added in the 0.9 series regarding this pattern and allowing the same view of attribute keys.
* - formattingMike Bayer2014-11-262-53/+106
|
* - Support has been added for pytest to run tests. This runnerMike Bayer2014-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | is currently being supported in addition to nose, and will likely be preferred to nose going forward. The nose plugin system used by SQLAlchemy has been split out so that it works under pytest as well. There are no plans to drop support for nose at the moment and we hope that the test suite itself can continue to remain as agnostic of testing platform as possible. See the file README.unittests.rst for updated information on running tests with pytest. The test plugin system has also been enhanced to support running tests against mutiple database URLs at once, by specifying the ``--db`` and/or ``--dburi`` flags multiple times. This does not run the entire test suite for each database, but instead allows test cases that are specific to certain backends make use of that backend as the test is run. When using pytest as the test runner, the system will also run specific test suites multiple times, once for each database, particularly those tests within the "dialect suite". The plan is that the enhanced system will also be used by Alembic, and allow Alembic to run migration operation tests against multiple backends in one run, including third-party backends not included within Alembic itself. Third party dialects and extensions are also encouraged to standardize on SQLAlchemy's test suite as a basis; see the file README.dialects.rst for background on building out from SQLAlchemy's test platform.
* - Fixed bug in the versioned_history example where column-level INSERTMike Bayer2014-02-242-5/+38
| | | | defaults would prevent history values of NULL from being written.
* - use column.info to detect those cols part of "versioning"Mike Bayer2014-02-162-28/+56
| | | | | | | - pep8 cleanup - fix tests for "changed" column - document that "changed" is optional - changelog
* Merge branch 'patch-1' of https://github.com/jplaverdure/sqlalchemy into tMike Bayer2014-02-161-3/+5
|
* - Added a tweak to the "history_meta" example where the check forMike Bayer2014-02-021-1/+2
| | | | | "history" on a relationship-bound attribute will now no longer emit any SQL if the relationship is unloaded.
* - start reworking examples to include more code from the wiki.Mike Bayer2013-11-293-0/+737
- add the other versioning examples from the wiki - modernize the dictlike examples