summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Integrate new Result into ORM queryMike Bayer2020-05-025-93/+117
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The next step in the 2.0 ORM changes is to have the ORM integrate with the new Result object fully. this patch uses Result to represent ORM objects rather than lists. public API to get at this Result is not added yet. dogpile.cache and horizontal sharding recipe/extensions have small adjustments to accommodate this change. Callcounts have fluctuated, some slightly better and some slightly worse. A few have gone up by a bit, however as the codebase is still in flux it is anticipated there will be some performance gains later on as ORM fetching is refined to no longer need to accommodate for extensive aliasing. The addition of caching will then change the entire story. References: #5087 References: #4395 Change-Id: If1a23824ffb77d8d58cf2338cf35dd6b5963b17f
* | | Merge "Capitalize documentation for relationship params"mike bayer2020-05-021-21/+21
|\ \ \
| * | | Capitalize documentation for relationship paramsFederico Caselli2020-04-281-21/+21
| | | | | | | | | | | | | | | | Change-Id: Iec1f0afcc57177a7463d8238f1c5d6bb8b86bbb3
* | | | Merge "Handle non-string, non column expression in index for deferred attach"mike bayer2020-05-021-2/+3
|\ \ \ \
| * | | | Handle non-string, non column expression in index for deferred attachMike Bayer2020-05-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where an :class:`.Index` that is deferred in being associated with a table, such as as when it contains a :class:`.Column` that is not associated with any :class:`.Table` yet, would fail to attach correctly if it also contained a non table-oriented expession. Fixes: #5298 Change-Id: I0111c400f6bd4a9f31bf00a9957816c7a3fac783
* | | | | Documentation updates for ResultProxy -> ResultMike Bayer2020-05-0120-47/+111
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based off of I8091919d45421e3f53029b8660427f844fee0228 and includes all documentation-only changes as a separate merge, once the parent is merged. Change-Id: I711adea23df0f9f0b1fe7c76210bd2de6d31842d
* | | | Merge "Propose Result as immediate replacement for ResultProxy"mike bayer2020-05-0118-1919/+2752
|\ \ \ \ | |_|_|/ |/| | |
| * | | Propose Result as immediate replacement for ResultProxyMike Bayer2020-05-0118-1919/+2752
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As progress is made on the _future.Result, including breaking it out such that DBAPI behaviors are local to specific implementations, it becomes apparent that the Result object is a functional superset of ResultProxy and that basic operations like fetchone(), fetchall(), and fetchmany() behave pretty much exactly the same way on the new object. Reorganize things so that ResultProxy is now referred to as LegacyCursorResult, which subclasses CursorResult that represents the DBAPI-cursor version of Result, making use of a multiple inheritance pattern so that the functionality of Result is also available in non-DBAPI contexts, as will be necessary for some ORM patterns. Additionally propose the composition system for Result that will form the basis for ORM-alternative result systems such as horizontal sharding and dogpile cache. As ORM results will soon be coming directly from instances of Result, these extensions will instead build their own ResultFetchStrategies that perform the special steps to create composed or cached result sets. Also considering at the moment not emitting deprecation warnings for fetchXYZ() methods; the immediate issue is Keystone tests are calling upon it, but as the implementations here are proving to be not in any kind of conflict with how Result works, there's not too much issue leaving them around and deprecating at some later point. References: #5087 References: #4395 Fixes: #4959 Change-Id: I8091919d45421e3f53029b8660427f844fee0228
* | | | Merge "Enable loading of external Firebird dialect, if available"Gord Thompson2020-05-011-1/+8
|\ \ \ \ | |/ / / |/| | |
| * | | Enable loading of external Firebird dialect, if availableGord Thompson2020-04-301-1/+8
| | |/ | |/| | | | | | | | | | Fixes: #5278 Change-Id: I1660abb11c02656fbf388f2f9c4257075111be58
* | | Deprecate unsupported dialects and dbapiFederico Caselli2020-04-2913-94/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Deprecate dialects firebird and sybase. - Deprecate DBAPI - mxODBC for mssql - oursql for mysql - pygresql and py-postgresql for postgresql - Removed adodbapi DBAPI for mssql Fixes: #5189 Change-Id: Id9025f4f4de7e97d65aacd0eb4b0c21beb9a67b5
* | | Restore a line break that is needed for a clean mergeMike Bayer2020-04-291-0/+1
| |/ |/| | | | | Change-Id: Ib433920080ba159a1478c48d2f837bc71bf5bbbc
* | Alias the onclause if ORM join is to same polymorphic selectableMike Bayer2020-04-272-2/+4
|/ | | | | | | | | | Fixed bug where using :func:`.with_polymorphic` as the target of a join via :meth:`.RelationshipComparator.of_type` on a mapper that already has a subquery-based with_polymorphic setting that's equivalent to the one requested would not correctly alias the ON clause in the join. Fixes: #5288 Change-Id: I0212a990ee67a344c87fe21833bf47fdb72ca0cc
* Merge "Fix regression when reflecting tables in MSSQL"mike bayer2020-04-221-12/+29
|\
| * Fix regression when reflecting tables in MSSQLFederico Caselli2020-04-221-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | Fix a regression introduced by the reflection of computed column in MSSQL when using SQL server versions before 2012, which does not support the ``concat`` function and when using the legacy TDS version 4.2. The dialect will try to detect the protocol version of first connect and run in compatibility mode if it cannot detect it. Fixes: #5255 Fixes: #5271 Change-Id: I7b33f7889ac0784cd8ae5385cbd50bc8c862398a
* | Merge "Add ColumnProperty.Comparator.expressions"mike bayer2020-04-211-1/+29
|\ \
| * | Add ColumnProperty.Comparator.expressionsMike Bayer2020-04-201-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added an accessor :attr:`.ColumnProperty.Comparator.expressions` which provides access to the group of columns mapped under a multi-column :class:`.ColumnProperty` attribute. Fixes: #5262 Change-Id: I44cf53ff0e6cf76a0c90eee4638ca96da3df8088
* | | Fix typo in pymssql documentation; minor clarificationGord Thompson2020-04-201-2/+3
| |/ |/| | | | | Change-Id: I4aaf0627d2f1ccae82c2eb41db9ec219d73ce4ea
* | Merge "Deprecate ``DISTINCT ON`` when not targeting PostgreSQL"mike bayer2020-04-2010-22/+54
|\ \
| * | Deprecate ``DISTINCT ON`` when not targeting PostgreSQLFederico Caselli2020-04-2010-22/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate usage of ``DISTINCT ON`` in dialect other than PostgreSQL. Previously this was silently ignored. Deprecate old usage of string distinct in MySQL dialect Fixes: #4002 Change-Id: I38fc64aef75e77748083c11d388ec831f161c9c9
* | | Merge "Support `ARRAY` of `Enum`, `JSON` or `JSONB`"mike bayer2020-04-205-54/+91
|\ \ \ | |_|/ |/| |
| * | Support `ARRAY` of `Enum`, `JSON` or `JSONB`Federico Caselli2020-04-205-54/+91
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for columns or type :class:`.ARRAY` of :class:`.Enum`, :class:`.JSON` or :class:`_postgresql.JSONB` in PostgreSQL. Previously a workaround was required in these use cases. Raise an explicit :class:`.exc.CompileError` when adding a table with a column of type :class:`.ARRAY` of :class:`.Enum` configured with :paramref:`.Enum.native_enum` set to ``False`` when :paramref:`.Enum.create_constraint` is not set to ``False`` Fixes: #5265 Fixes: #5266 Change-Id: I83a2d20a599232b7066d0839f3e55ff8b78cd8fc
* | Merge "Raise informative error when non-object m2o comparison used"mike bayer2020-04-201-1/+12
|\ \
| * | Raise informative error when non-object m2o comparison usedMike Bayer2020-04-191-1/+12
| |/ | | | | | | | | | | | | | | | | | | | | An informative error message is raised when an ORM many-to-one comparison is attempted against an object that is not an actual mapped instance. Comparisons such as those to scalar subqueries aren't supported; generalized comparison with subqueries is better achieved using :meth:`~.RelationshipProperty.Comparator.has`. Fixes: #5269 Change-Id: I2e23178eb59728c39241a46bfa7411239a87492e
* | Merge "Update pymssql information for mssql dialect"mike bayer2020-04-201-5/+18
|\ \
| * | Update pymssql information for mssql dialectGord Thompson2020-04-201-5/+18
| |/ | | | | | | Change-Id: I94cf63299a094b53e7078b282311f7d0faa256a6
* | Merge "Rename py.test to pytest"mike bayer2020-04-205-7/+7
|\ \
| * | Rename py.test to pytestGord Thompson2020-04-165-7/+7
| |/ | | | | | | Change-Id: I431e1ef41e26d490343204a75a5c097768749768
* | Add @requirements.schemas to test_create_table_schemaGord Thompson2020-04-181-0/+1
|/ | | | | | Prevent test_create_table_schema from failing for databases that do not support schemas. Change-Id: I0f5f129c313ee6023be2e6d84610355afc48c05c
* Create initial 2.0 engine implementationMike Bayer2020-04-1631-209/+1225
| | | | | | | | | | | | | | | | | | | Implemented the SQLAlchemy 2 :func:`.future.create_engine` function which is used for forwards compatibility with SQLAlchemy 2. This engine features always-transactional behavior with autobegin. Allow execution options per statement execution. This includes that the before_execute() and after_execute() events now accept an additional dictionary with these options, empty if not passed; a legacy event decorator is added for backwards compatibility which now also emits a deprecation warning. Add some basic tests for execution, transactions, and the new result object. Build out on a new testing fixture that swaps in the future engine completely to start with. Change-Id: I70e7338bb3f0ce22d2f702537d94bb249bd9fb0a Fixes: #4644
* Merge "Pass connection to TablesTest.insert_data()"mike bayer2020-04-157-161/+145
|\
| * Pass connection to TablesTest.insert_data()Mike Bayer2020-04-157-161/+145
| | | | | | | | | | | | | | | | | | | | towards the goal of reducing verbosity and repetition in test fixtures as well as that we are moving to connection only for execution, move the insert_data() classmethod to accept a connection and adjust all fixtures to use it. Change-Id: I3bf534acca0d5f4cda1d4da8ae91f1155b829b09
* | Set up absolute references for create_engine and relatedMike Bayer2020-04-1434-189/+248
| | | | | | | | | | | | | | includes more replacements for create_engine(), Connection, disambiguation of Result from future/baked Change-Id: Icb60a79ee7a6c45ea9056c211ffd1be110da3b5e
* | Merge "Run search and replace of symbolic module names"mike bayer2020-04-1477-2702/+3643
|\ \ | |/ |/|
| * Run search and replace of symbolic module namesMike Bayer2020-04-1477-2702/+3643
| | | | | | | | | | | | | | | | Replaces a wide array of Sphinx-relative doc references with an abbreviated absolute form now supported by zzzeeksphinx. Change-Id: I94bffcc3f37885ffdde6238767224296339698a2
* | Merge "Clean up .execute calls in test_results.py"mike bayer2020-04-141-39/+38
|\ \
| * | Clean up .execute calls in test_results.pyGord Thompson2020-04-111-39/+38
| | | | | | | | | | | | Change-Id: I08b9046a48270f664ea8b8ba38d8be7763973a40
* | | Merge "Clean up .execute calls in test_select.py"mike bayer2020-04-141-87/+101
|\ \ \
| * | | Clean up .execute calls in test_select.pyGord Thompson2020-04-111-87/+101
| |/ / | | | | | | | | | Change-Id: I97dfb59d13a7c27c79c3dbcbcb5ba61948569e46
* | | Merge "Clean up .execute calls in remaining suite tests"mike bayer2020-04-145-65/+82
|\ \ \
| * | | Clean up .execute calls in remaining suite testsGord Thompson2020-04-125-65/+82
| |/ / | | | | | | | | | Change-Id: Ib5c7f46067bcf5b162060476cc323bf671db101a
* | | Merge "Clean up .execute calls in test_sequence.py"mike bayer2020-04-141-36/+36
|\ \ \
| * | | Clean up .execute calls in test_sequence.pyGord Thompson2020-04-121-36/+36
| |/ / | | | | | | | | | Change-Id: If92353297fc1b4bc843f6ec74cb29079b52c611b
* | | Merge "Clean up .execute calls in test_insert.py"mike bayer2020-04-141-52/+48
|\ \ \ | |_|/ |/| |
| * | Clean up .execute calls in test_insert.pyGord Thompson2020-04-111-52/+48
| | | | | | | | | | | | Change-Id: I87e144d00577b53baab203c675caeaf8ad46cb5c
* | | Enable zzzeeksphinx module prefixesMike Bayer2020-04-1413-60/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zzzeeksphinx 1.1.2 in git can now convert short prefix names in a configured lookup to fully qualified module names, so that we can have succinct and portable pyrefs that still resolve absolutely. It also includes a formatter that will format all pyrefs in a fully consistent way regardless of the package path, by unconditionally removing all package tokens but always leaving class names in place including for methods, which means we no longer have to deal with tildes in pyrefs. The most immediate goal of the absolute prefixes is that we have lots of "ambiguous" names that appear in muliple places, like select(), ARRAY, ENUM etc. With the incoming future packages there is going to be lots of name overlap so it is necessary that all names eventually use absolute package paths when Sphinx receives them. In multiple stages, pyrefs will be converted using the zzzeeksphinx tools/fix_xrefs.py tool so that doclinks can be made absolute using symbolic prefixes. For this review, the actual search and replace of symbols is not performed, instead some general cleanup to prepare the docs as well as a lookup file used by the tool to do the conversion. this relatively small patch will be backported with appropriate changes to 1.3, 1.2, 1.1 and the tool can then be run on each branch individually. We are shooting for almost no warnings at all for master (still a handful I can't figure out which don't seem to have any impact) , very few for 1.3, and for 1.2 / 1.1 we hope for a significant reduction in warnings. Overall for all versions pyrefs should always point to the correct target, if they are in fact hyperlinked. it's better for a ref to go nowhere and be plain text than go to the wrong thing. Right now, hundreds of API links are pointing to the wrong thing as they are ambiguous names such as refresh(), insert(), update(), select(), join(), JSON etc. and Sphinx sends these all to essesntially random destinations among as many as five or six possible choices per symbol. A shorthand system that allows us to use absolute refs without having to type out a full blown absoulte module is the only way this is going to work, and we should ultimately seek to abandon any use of prefix dot for lookups. Everything should be on an underscore token so at the very least the module spaces can be reorganized without having to search and replace the entire documentation every time. Change-Id: I484a7329034af275fcdb322b62b6255dfeea9151
* | | Merge "Repair find tables"mike bayer2020-04-131-1/+3
|\ \ \
| * | | Repair find tablesMike Bayer2020-04-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recipe given out on the ML for improving ABC fails in 1.4 due to find_tables() missing out on subqueries, which is due to the refactor of Alias into multiple sub-types. Change-Id: Idd2803b26a84b28db28e0b8c328b8f24550577e4
* | | | Merge "Add ``comment`` attribute to :class:`.Column` ``__repr__`` method."mike bayer2020-04-131-0/+2
|\ \ \ \
| * | | | Add ``comment`` attribute to :class:`.Column` ``__repr__`` method.Federico Caselli2020-04-111-0/+2
| | |_|/ | |/| | | | | | | | | | | | | | | | | | Fixes #4138 Change-Id: Ia93f7d7b1d2f38509421725fbe152a2ff163d5f3