summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* - black -l79 updaterel_2_0_oldrel_2_0Mike Bayer2019-07-064-12/+6
| | | | Change-Id: Ie6ebff96f3b21fd35c9ceb22575b9b172373da7b
* negate True/False separately from other elementsMike Bayer2019-07-061-0/+6
| | | | | | | | Fixed issue where double negation of a boolean column wouldn't reset the "NOT" operator. Fixes: #4618 Change-Id: Ica280a0d6b5b0870aa2d05c4d059a1e559e6b12a
* Remove threadlocal engine strategy, engine strategies pool threadlocalMike Bayer2019-07-0623-2016/+706
| | | | Change-Id: I8a351f9fa1f7dfa2a56eec1cd2d1a4b9d65765a2
* Black updatesMike Bayer2019-07-061-1/+1
| | | | | | | Updating for a few black adjustments Change-Id: I9c8abadd1ccd6173e6d68dd62f14cec208cc304a (cherry picked from commit 17413bbf10c3b993d343c28035713a23c745712c)
* Remove lib/ source prefixMike Bayer2019-07-06205-23/+9
| | | | | | | | | | | | | | | | This prefix was a holdover from early days when Python standard practices were not as clear and we had come from a Perl background as far as scripting languages were concerned. Specifically, this document: https://docs.python.org/2/distutils/setupscript.html#listing-whole-packages suggested using lib/ was perhaps still a common thing, and maybe it was. But soon after, it was definitely not. git seems to travel well as far as things like cherry-picks and such (also not a thing we had back then). Change-Id: Id528da1c8ec902b5d50fb360af62db366b03b419
* - version number is also hardcoded in conf.pyMike Bayer2019-07-061-2/+2
| | | | Change-Id: Ia8d0c0c47e2229ac404319328c8b865cde29e12e
* - initial 2.0 setupMike Bayer2019-07-0610-30/+54
| | | | Change-Id: Ib5af75df94b23104eebe0e918adcf979d798ea3b
* class level docstring for SubqueryMike Bayer2019-07-062-12/+27
| | | | | | Remove inherited member doc from most selectables, it's too verbose Change-Id: I1b6635fe73342705846c0fab635b46557e560734
* Merge "SelectBase no longer a FromClause"mike bayer2019-07-0653-1202/+3303
|\
| * SelectBase no longer a FromClauseMike Bayer2019-07-0653-1202/+3303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the SQLAlchemy 2.0 migration project, a conceptual change has been made to the role of the :class:`.SelectBase` class hierarchy, which is the root of all "SELECT" statement constructs, in that they no longer serve directly as FROM clauses, that is, they no longer subclass :class:`.FromClause`. For end users, the change mostly means that any placement of a :func:`.select` construct in the FROM clause of another :func:`.select` requires first that it be wrapped in a subquery first, which historically is through the use of the :meth:`.SelectBase.alias` method, and is now also available through the use of :meth:`.SelectBase.subquery`. This was usually a requirement in any case since several databases don't accept unnamed SELECT subqueries in their FROM clause in any case. See the documentation in this change for lots more detail. Fixes: #4617 Change-Id: I0f6174ee24b9a1a4529168e52e855e12abd60667
* | target issue #4336 at 1.4 releaseMike Bayer2019-07-061-0/+0
|/ | | | Change-Id: I96acdf2285ebec067ca6128b03d47776533caac0
* Repair json example in tutorial to suit non-present sqlite supportMike Bayer2019-07-051-8/+8
| | | | | | | | SQLite on CI doesn't have json functions (centos) so even though SQLAlchemy supports it in this version, use the MySQL compiler for the example. Change-Id: If896273adbab2e3fdb995272f6e55de420aee220
* Adjust JSON verbiage about "implied" datatypeMike Bayer2019-07-051-2/+4
| | | | | | | SQLite and MariaDB (not MySQL) has an "implied" JSON, MySQL has it directly Change-Id: I2e1744de96ac4e241dc647ae2214b63cdad33428
* Rename tutorial section to "Using Aliases and Subqueries"Mike Bayer2019-07-051-11/+13
| | | | | | | | | | add some verbiage to start differentiating a subquery from an alias. Also, get rid of a very strange note to use ``.correlate(None)`` on a non-scalar subquery; this is unnecessary and confusing. Change-Id: I83b2fd1275c719a32bb74060756d61bc51b52892
* Note DBAPIs and dialects that we don't supportMike Bayer2019-07-0510-4/+58
| | | | | | | | | | | | | | Since we have strong CI for the DBAPIs and dialects that are actively supported, this indicates that those DBAPIs that aren't in CI are continuing to fall behind in support, to the point where we can not address issues that may arise. As such, the Sybase and Firebird dialects overall are moving into an explicit "not supported" zone where we would like to eventually remove them. Additionally, a pass is made through legacy MySQL and PostgreSQL DBAPI dialects as well as those which we aren't able to include in CI to note that these DBAPIs aren't actively supported by the project. Change-Id: I61f1515b97b741b7534b54e434e3e47065df7b5d
* Squashed commit of the following:Mike Bayer2019-07-052-2/+2
| | | | | | | | | | | | | | | | commit d4f3bedc74568b7ec543988ee2d43e64c5ace28f Author: Carson Ip <carsonip@users.noreply.github.com> Date: Fri Jul 5 11:20:12 2019 +0800 Fix typo in docstring commit a3e4b05744f51ec5d12a2fee1ad6093de904273e Author: Carson Ip <carsonip@users.noreply.github.com> Date: Fri Jul 5 11:14:57 2019 +0800 Fix typo in docstring Change-Id: Ifa2ebff5629bf970e5fac28bba64d501376cfae9
* Add tutorial section for cast(), type_coerce()Mike Bayer2019-07-042-2/+93
| | | | Change-Id: I49f635f0ad4d07abe8ef2681c9660ec7fcf5f99b
* Rework proxy_cache fix to restore performanceMike Bayer2019-07-023-5/+31
| | | | | | | Adjustment to the fix made in I7fb134cac3604f8fe62e220fb24a0945d0a1c56f. Fixes: #4747 Change-Id: I2f1010b0abc1faa892f5e346e58f9c4a3867622f
* Clear proxy_set cache when creating an annotated columnMike Bayer2019-07-025-8/+50
| | | | | | | | | | | | Fixed an unlikely issue where the "corresponding column" routine for unions and other :class:`.CompoundSelect` objects could return the wrong column in some overlapping column situtations, thus potentially impacting some ORM operations when set operations are in use, if the underlying :func:`.select` constructs were used previously in other similar kinds of routines, due to a cached value not being cleared. Fixes: #4747 Change-Id: I7fb134cac3604f8fe62e220fb24a0945d0a1c56f
* A few doc tweaks for alias / order_by / group_byMike Bayer2019-07-012-11/+62
| | | | Change-Id: Ib3b46b45735529d68ebfb3784de4de5d2d0f4abc
* Merge "CAST bind values against SQL Server sys into NVARCHAR"mike bayer2019-06-283-6/+36
|\
| * CAST bind values against SQL Server sys into NVARCHARMike Bayer2019-06-283-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensured that the queries used to reflect indexes and view definitions will explicitly CAST string parameters into NVARCHAR, as many SQL Server drivers frequently treat string values, particularly those with non-ascii characters or larger string values, as TEXT which often don't compare correctly against VARCHAR characters in SQL Server's information schema tables for some reason. These CAST operations already take place for reflection queries against SQL Server ``information_schema.`` tables but were missing from three additional queries that are against ``sys.`` tables. Fixes: #4745 Change-Id: I3056533bf1a1e8ef17742879d369ab13f8b704ea
* | Merge "Test for _ORMJoin and fix issue"mike bayer2019-06-283-3/+64
|\ \
| * | Test for _ORMJoin and fix issueDenis Kataev2019-06-283-3/+64
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed an issue where the :meth:`.orm._ORMJoin.join` method, which is a not-internally-used ORM-level method that exposes what is normally an internal process of :meth:`.Query.join`, did not propagate the ``full`` and ``outerjoin`` keyword arguments correctly. Pull request courtesy Denis Kataev. Fixes: #4713 Closes: #4744 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4744 Pull-request-sha: ac8870614947259320b5d000a59fadb8c2328a04 Change-Id: If9a30a4ca56c430ddd6fec29ad519556e9001c4b
* | Merge "Add Load.options() for hierchical construction of loader options"mike bayer2019-06-286-49/+506
|\ \ | |/ |/|
| * Add Load.options() for hierchical construction of loader optionsMike Bayer2019-06-276-49/+506
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new loader option method :meth:`.Load.options` which allows loader options to be constructed hierarchically, so that many sub-options can be applied to a particular path without needing to call :func:`.defaultload` many times. Thanks to Alessio Bogon for the idea. Also applies a large pass to the loader option documentation which needed improvement. Fixes: #4736 Change-Id: I93c453e30a20c074f27e87cf7e95b13dd3f2b494
* | Merge "Unwrap TIMESTAMP when doing an isinstance()"mike bayer2019-06-273-5/+31
|\ \
| * | Unwrap TIMESTAMP when doing an isinstance()Mike Bayer2019-06-274-6/+32
| |/ | | | | | | | | | | | | | | | | | | | | | | Fixed bug where the special logic to render "NULL" for the :class:`.TIMESTAMP` datatype when ``nullable=True`` would not work if the column's datatype were a :class:`.TypeDecorator` or a :class:`.Variant`. The logic now ensures that it unwraps down to the original :class:`.TIMESTAMP` so that this special case NULL keyword is correctly rendered when requested. Fixes: #4743 Change-Id: I02b22dfa3db06daea37b044e2206a8569e2e5d22
* | Revert 1ed2f162151 black target versionMike Bayer2019-06-271-1/+1
|/ | | | | | | | | | Unfortunately target version py27 makes Black want to break print functions, even if you put a "from __future__ import print_function" at the top, so it is being inconsistent in its "we've decided this is a python 2 file" logic and basically this thing really needs command line arguments Change-Id: Iefa62df4224b9620e764b16b1c390647f948e85f
* Use an ordered dict for the previous changeMike Bayer2019-06-272-7/+11
| | | | Change-Id: Iaccb0a82ff053bd73fec59a83d2ee07e899cd6d7
* Remove test-within-a-test structureMike Bayer2019-06-271-35/+40
| | | | | | | | These tests in of_type were relying upon generating the polymorphic selectable from the mapper which is proving to be more challenging to correct when that mechanism is changing. Change-Id: I72635fab0f6f3fc7f2b712596db310648f55b04c
* Reflect "NO ACTION" as None; support "RESTRICT"Mike Bayer2019-06-2610-21/+87
| | | | | | | | | | | | | | The "NO ACTION" keyword for foreign key "ON UPDATE" is now considered to be the default cascade for a foreign key on all supporting backends (SQlite, MySQL, PostgreSQL) and when detected is not included in the reflection dictionary; this is already the behavior for PostgreSQL and MySQL for all previous SQLAlchemy versions in any case. The "RESTRICT" keyword is positively stored when detected; PostgreSQL does report on this keyword, and MySQL as of version 8.0 does as well. On earlier MySQL versions, it is not reported by the database. Fixes: #4741 Change-Id: I6becf1f2450605c1991158bb8a04d954dcc7396c
* Disable black auto-version detectionMike Bayer2019-06-241-1/+1
| | | | | | | We're targeting Python 2.7 still so ensure black does not add trailing commas Change-Id: I9896b3a71de855d834f0133fd2d6213aae40fc9d
* Register pytest assertion rewriting on sqlalchemy.testing.assertionsMike Bayer2019-06-211-0/+2
| | | | | | | | Since our various eq_(), ne_() etc. functions use assert, pytest can rewrite this module using its enhanced string reporting. very helpful for comparing SQL strings Change-Id: Ia71328401fd7965bcb14eb1ccea0dc48a8f2c3ea
* Add option for "sparse" backend tests and apply to memusageMike Bayer2019-06-202-7/+31
| | | | | | | | | | | The memusage tests are extremely time and memory intensive, and when CI runs against MySQL or Postgresql there are many database/driver combinations for which the "backend" tests repeatedly run; as these tests are more oriented towards basic dialect interaction, add a new "sparse" backend option that will run the tests only once per base dialect. Change-Id: I312aa0332d7ec1ff4e2faa15f6b189d6f0f68393
* Enable F841Mike Bayer2019-06-2076-710/+435
| | | | | | | | | | | This is a very useful assertion which prevents unused variables from being set up allows code to be more readable and sometimes even more efficient. test suites seem to be where the most problems are and there do not seem to be documentation examples that are using this, or at least the linter is not taking effect within rst blocks. Change-Id: I2b3341d8dd14da34879d8425838e66a4b9f8e27d
* cherry-pick changelog update for 1.3.6Mike Bayer2019-06-171-0/+4
|
* cherry-pick changelog from 1.3.5Mike Bayer2019-06-1710-103/+112
|
* Merge remote-tracking branch 'origin/pr/4734'Mike Bayer2019-06-171-2/+2
|\ | | | | | | Change-Id: Ic3165d61430e9b0edebf80a699e0340e442d69d2
| * Fix typo in documentation examplesEmile Caron2019-06-171-2/+2
| |
* | Merge "Remove unused "time_func""mike bayer2019-06-171-6/+0
|\ \
| * | Remove unused "time_func"Mike Bayer2019-06-171-6/+0
| |/ | | | | | | | | | | | | | | This compat name is not used and is also referring to a deprecated API for the win32 case. Fixes: #4731 Change-Id: I0f2b07347c15455b58c27e29a19fb55e159f332a
* | Merge "PostgreSQL now reflects per-column sort order on indexes."mike bayer2019-06-174-4/+140
|\ \ | |/ |/|
| * PostgreSQL now reflects per-column sort order on indexes.Eli Collins2019-06-174-4/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for column sorting flags when reflecting indexes for PostgreSQL, including ASC, DESC, NULLSFIRST, NULLSLAST. Also adds this facility to the reflection system in general which can be applied to other dialects in future releases. Pull request courtesy Eli Collins. Fixes: #4717 Closes: #4725 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4725 Pull-request-sha: 3cbb067bd46776fdb125553ba0ac192cb45d060c Change-Id: I8b0617d68580cfe4ff79d758a077263f33e852c2
* | Merge "Turn off the is_literal flag when proxying literal_column() to Label"mike bayer2019-06-177-8/+241
|\ \
| * | Turn off the is_literal flag when proxying literal_column() to LabelMike Bayer2019-06-157-8/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a series of quoting issues which all stemmed from the concept of the :func:`.literal_column` construct, which when being "proxied" through a subquery to be referred towards by a label that matches its text, the label would not have quoting rules applied to it, even if the string in the :class:`.Label` were set up as a :class:`.quoted_name` construct. Not applying quoting to the text of the :class:`.Label` is a bug because this text is strictly a SQL identifier name and not a SQL expression, and the string should not have quotes embedded into it already unlike the :func:`.literal_column` which it may be applied towards. The existing behavior of a non-labeled :func:`.literal_column` being propagated as is on the outside of a subquery is maintained in order to help with manual quoting schemes, although it's not clear if valid SQL can be generated for such a construct in any case. Fixes: #4730 Change-Id: I300941f27872fc4298c74a1d1ed65aef1a5cdd82
* | | Consult is_attrbute flag to determine descriptor; enable for assoc proxyMike Bayer2019-06-145-3/+30
|/ / | | | | | | | | | | | | | | | | | | | | | | Fixed bug where the :attr:`.Mapper.all_orm_descriptors` accessor would return an entry for the :class:`.Mapper` itself under the declarative ``__mapper___`` key, when this is not a descriptor. The ``.is_attribute`` flag that's present on all :class:`.InspectionAttr` objects is now consulted, which has also been modified to be ``True`` for an association proxy, as it was erroneously set to False for this object. Fixes: #4729 Change-Id: Ia02388cc25d004e32d337140b62a587f3e5a0b7b
* | Generate Oracle ROWNUM scheme using named subqueriesMike Bayer2019-06-134-80/+205
| | | | | | | | | | | | | | | | | | | | | | The LIMIT / OFFSET scheme used in Oracle now makes use of named subqueries rather than unnamed subqueries when it transparently rewrites a SELECT statement to one that uses a subquery that includes ROWNUM. The change is part of a larger change where unnamed subqueries are no longer directly supported by Core, as well as to modernize the internal use of the select() construct within the Oracle dialect. Change-Id: I27605d7cf16ce79f9d577dbc84e3bd51b7c9b4ae
* | Merge "Reverse Alias nesting concept"mike bayer2019-06-136-33/+114
|\ \ | |/ |/|
| * Reverse Alias nesting conceptMike Bayer2019-06-136-33/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Alias object no longer has "element" and "original", it now has "wrapped" and "element" (the name .original is also left as a descriptor for legacy access by third party dialects). These two data members refer to the dual roles Alias needs to play, where in the Python sense it needs to refer to the thing it was applied against directly, whereas in the SQL sense it needs to refer to the ultimate "non-alias" thing it refers towards. Both are necessary to maintain. However, the change here has each Alias object access the non-Alias object immediately so that the "unwrapping" is simpler and does not need any special logic. In the SQL sense, Alias objects don't nest, the only potential was that of the CTE, however there is no such thing as a nested CTE, see link below. This change is an interim change along the way to breaking Alias into more classes and breaking away Select objects from being FromClause objects. Change-Id: Ie7a0d064226cb074ca745505129b5ec7d879e389 References: https://stackoverflow.com/questions/1413516/can-you-create-nested-with-clauses-for-common-table-expressions