summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* Fix almost all read-level sphinx warningsMike Bayer2020-04-111-1/+3
| | | | | | | | | | Partial backport of 43bcb0de1ecc1dc2abd7e7c3eb0c39f3eab9adc0. Also enables sphinx multiprocess. Change-Id: I49b1959b9a5fe84fb4c74366da2724284a804936 (cherry picked from commit d56887bcb63808ff6b42e4370ec082a8ef5a41a0) (cherry picked from commit 17feac57cde73bda9fb5b335fa9b3e62aa5cadad)
* fix typo in PickleType documentationFederico Caselli2020-03-041-1/+1
| | | | (cherry picked from commit f9753f5c8f7c4427fa7b21076d3f46177afbfcd0)
* Fix test failures from func doc fixMike Bayer2019-10-171-1/+1
| | | | | | | | The doc edits in e45878bf4f9cdfb714dce8b2a4d705178947674d triggered a doctest and a pep8 failure. Change-Id: I41c6cba9bab2d3721d9c6280be47eec32f4b4736 (cherry picked from commit d25c03310fd3523392d37b88c23c48cf26836248)
* fix func docsMike Bayer2019-10-171-69/+108
| | | | | | | | | sphinx is not generating the docs for func. cross-copy __doc__ and also add more links. Fixes: #4922 Change-Id: I5512111d726b6fcf9821be730c9e29adc73c95cb (cherry picked from commit e45878bf4f9cdfb714dce8b2a4d705178947674d)
* Document visitors moduleMike Bayer2019-09-121-20/+148
| | | | | | | | | As we are going to be adding a lot of new features to the visitors module which may impact end-user custom constructs, start documenting the package for now. Change-Id: Ibae471c2cb861f6280f601b7b2382d61968825cd (cherry picked from commit ed02d924dd0bd1bce56b40bea74e1d382c352833)
* - shore up TypeDecorator docs a bit to not render tons ofMike Bayer2019-08-101-0/+9
| | | | | | | comparator methods Change-Id: I8f434b18b2bd632a0db0db1376262944272d2198 (cherry picked from commit 731a20049b372ee2e0c7408519623363e22a4db4)
* Small text error in json field docDenis Kataev2019-07-171-1/+1
| | | | | | Small fix json field doc (cherry picked from commit 7b8ff3c335938532b70e6ffff212bd8f67c56add)
* Convert most "See also" phrases into .. seealso::Mike Bayer2019-01-153-10/+10
| | | | | Change-Id: Ie32598b895c1c5f5bce7c8e1573abbcfe9d434a8 (cherry picked from commit e81d3815abb36c52b0019dee6e4f67990e3d1c7d)
* Remove version directives for 0.6, 0.7, 0.8Mike Bayer2019-01-159-110/+0
| | | | | | | | | | | - fix a few "seealso"s - ComparableProprerty's "superseded in 0.7" becomes deprecated in 0.7 Backport to currently maintained doc versions 1.2, 1.1 Change-Id: Ib1fcb2df8673dbe5c4ffc47f3896a60d1dfcb4b2 (cherry picked from commit 885f15a306efc4c907ca82fa13871992ee556466) (cherry picked from commit 996eb2d4bf7dcff57e4d47d467e8252ced5fe13d)
* use ..deprecated directive w/ version in all casesMike Bayer2019-01-127-100/+181
| | | | | | | | | | | | These changes should be ported from 1.3 back to 1.0 or possibly 0.9 to the extent they are relevant in each version. In 1.3 we hope to turn all deprecation documentation into warnings. (cherry picked from commit 77e9534673d58f2f4c33d16c0ed4e8671cea48b6) (cherry picked from commit dcfe5a3f8929a11fd8d89b3b34449e1894bb2a3b) Change-Id: I205186cde161af9389af513a425c62ce90dd54d8
* commit 1b774808c926665047bf353222ecd191679a95d1Lele Gaifax2018-12-301-4/+4
| | | | | | | | | | | | | | | | | Author: Lele Gaifax <lele@metapensiero.it> Date: Tue Dec 25 12:35:41 2018 +0100 Consistently use "PostgreSQL", fixing also a few doc glitches commit 0e382aaee4427193926f0dc10ad29056bc12c85e Author: Lele Gaifax <lele@metapensiero.it> Date: Tue Dec 25 12:08:49 2018 +0100 Remove duplicated words Change-Id: Iaa586b9412f46a50fe6ff3bbb92e07d6cb1905c8 (cherry picked from commit c0f9708fde39175c8695fdd87873464f516fdf98) (cherry picked from commit 7ec092063a7defe2b60d8f01b2eb3cda9dd28c90)
* Rewrite the convert_unicode docs and add tons of dragonsMike Bayer2018-12-211-22/+36
| | | | | | | | These flags will all be going away as Python 3 has solved all of this. Change-Id: I4f581d8dd7826dd823b671d0d8e72250284236c8 (cherry picked from commit 7f12f63c3a8c77715135126aac88ac6055b279c0)
* typoRaphael2018-11-301-1/+1
| | | | | | typo (cherry picked from commit 0a0b36686d5da0e7d04974c8df0ece574b71f3cb)
* happy new yearMike Bayer2018-01-1219-19/+19
| | | | | Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f (cherry picked from commit 699272e4dcb9aa71ebbc0d9487fb6de82d3abc2b)
* `ValuesBase.values` inconsistency fixAubrey Stark-Toller2018-01-121-17/+22
| | | | | | | | | | | Fixed bug in :meth:`.Insert.values` where using the "multi-values" format in combination with :class:`.Column` objects as keys rather than strings would fail. Pull request courtesy Aubrey Stark-Toller. Change-Id: I9d3b40b5950df8f5bfdc8b1d22f9c3afb277f17f Pull-request: https://github.com/zzzeek/sqlalchemy/pull/412 Fixes: #4162 (cherry picked from commit ab2165e6d6e9b33f772e9eb3668b3e32175093c4)
* add nullsfirst() / nullslast() to top-level importsLele Gaifax2017-11-161-0/+2
| | | | | | Change-Id: Ieefcc4c30c1c17f43f2908d961e00815bae862bb Pull-request: https://github.com/zzzeek/sqlalchemy/pull/378 (cherry picked from commit d507ea00a9523cf5dc00a7c663ed4a44d1fdddcf)
* Accommodate tuples for ColumnDefault.__repr__Nicolas CANIART2017-10-311-1/+1
| | | | | | | | | | Fixed bug where ``__repr__`` of :class:`.ColumnDefault` would fail if the argument were a tuple. Pull request courtesy Nicolas Caniart. Change-Id: I08aa2448ef91054c43d6068ac54cedbdf7a83d64 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/1 Fixes: #4126 (cherry picked from commit 5acc9b149a4f7c44b8e7fbe926c0c5de8f13b2c4)
* Merge "Don't include SelectBase when searching for surface column elements" ↵mike bayer2017-10-101-3/+7
|\ | | | | | | into rel_1_1
| * Don't include SelectBase when searching for surface column elementsMike Bayer2017-10-051-3/+7
| | | | | | | | | | | | | | | | | | | | | | Fixed bug where correlated select used against single-table inheritance entity would fail to render correctly in the outer query, due to adjustment for single inheritance discriminator criteria inappropriately re-applying the criteria to the outer query. Change-Id: I38df21f1392af1843e10119682fa0635d346e2a8 Fixes: #4103 (cherry picked from commit 1281e6e6c41ad3d7240fe50f4fecab4083b79975)
* | Fix array_agg to accommodate ARRAY argumentsMike Bayer2017-10-061-1/+8
|/ | | | | | | | | | | Fixed bug in :func:`.array_agg` function where passing an argument that is already of type :class:`.ARRAY`, such as a Postgresql :obj:`.postgresql.array` construct, would produce a ``ValueError``, due to the function attempting to nest the arrays. Change-Id: Ibe5f6275d90e4868e6ef8a733de05acd44c05d78 Fixes: #4107 (cherry picked from commit 4bb8397ae3a9d65bd18eb1d7c951bf5121ea280a)
* Support method form of any_(), all_()Mike Bayer2017-09-272-1/+35
| | | | | | | | | | | | | Fixed bug where the recently added :meth:`.ColumnOperators.any_` and :meth:`.ColumnOperators.all_` methods didn't work when called as methods, as opposed to using the standalone functions :func:`~.expression.any_` and :func:`~.expression.all_`. Also added documentation examples for these relatively unintuitive SQL operators. Change-Id: I3e56b463e9fd146a077b9970624f50cba27f9811 Fixes: #4093 (cherry picked from commit 944c662d8add498577d6359251d4b94cd84d4011)
* Allow for multiple FOLLOWING/PRECEDING in a window rangeMike Bayer2017-08-252-25/+26
| | | | | | | | | | | | Altered the range specification for window functions to allow for two of the same PRECEDING or FOLLOWING keywords in a range by allowing for the left side of the range to be positive and for the right to be negative, e.g. (1, 3) is "1 FOLLOWING AND 3 FOLLOWING". Change-Id: I7d3a6c641151bb49219104968d18dac2266f3db8 Fixes: #4053 (cherry picked from commit 3a5bbe4cbe12d180fba2b942d0467b46be705bea)
* Add support for CACHE and ORDER to sequencesDavid Moore2017-07-052-2/+21
| | | | | | | | | | | | Added new keywords :paramref:`.Sequence.cache` and :paramref:`.Sequence.order` to :class:`.Sequence`, to allow rendering of the CACHE parameter understood by Oracle and PostgreSQL, and the ORDER parameter understood by Oracle. Pull request courtesy David Moore. Change-Id: I082c3f8ef56ef89dbaad5da9d5695be5313b0614 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/96 (cherry picked from commit faa6609dac2ce6e55e0f690df3ba88c13133ec5c)
* Repair WithinGroup.get_children()Mike Bayer2017-06-161-1/+1
| | | | | | | | | Fixed AttributeError which would occur in :class:`.WithinGroup` construct during an iteration of the structure. Change-Id: I563882d93c8c32292463a605b636aa60c77e9406 Fixes: #4012 (cherry picked from commit 3a314fcea8539133947d5ec8e42a6c86e30fdf9a)
* Fix a few doc typosLele Gaifax2017-06-021-4/+4
| | | | | | (cherry picked from commit 4779ddd865d693f4c3521fbe200a96b88ed67186) Change-Id: Ib3caafad523fac408475a2557c30be9ff39b0a65
* Raise if ForeignKeyConstraint created with different numbers ofMike Bayer2017-05-251-0/+16
| | | | | | | | | | | | | | | | | | | local and remote columns. An :class:`.ArgumentError` is now raised if a :class:`.ForeignKeyConstraint` object is created with a mismatched number of "local" and "remote" columns, which otherwise causes the internal state of the constraint to be incorrect. Note that this also impacts the condition where a dialect's reflection process produces a mismatched set of columns for a foreign key constraint. Downstream DB2 dialect has been reported as potentially causing this scenario. Change-Id: Id51c34a6c43749bb582639f9c1dc28723482f0e5 Fixes: #3949 References: #3998 (cherry picked from commit a78718b9340e9840a470300932af178ce57c0f7d)
* - Document the most transparent way to set JSON.NULL forMike Bayer2017-05-181-0/+16
| | | | | | | | | | | | | | | | a column default. The JSON.NULL value is special in that while it is a Python-side value, it represents "do this special behavior", and is not at all like any other Python-side value for which normally, that's exactly the type of data we want back. So in this case, encourage the user to use a SQL expression that is exact, so in the ORM context, you get back what was actually persisted in the column. There's some variants of this such as literal(JSON.NULL, JSON) but text("'null'") is simpler. Change-Id: I0339fafdc03e4b2f533d53970b2f74c774f2687b Fixes: #3923 (cherry picked from commit 4d4ea792e7ea7945de9c9b1e005ce09b2feb45b5)
* Add links to with_only_columns to Select.column, append_columnMike Bayer2017-05-121-19/+16
| | | | | | | | | | | | Provide a brief example for these two methods indicating that typically a table-bound (or other selectable) column is appended here, then link to with_only_columns documentation which has in-depth guidelines already including that one should not append columns from the current select to itself. Change-Id: I0742405a7f3c41450d337b9c633519d9cc101dfb Fixes: #3987 (cherry picked from commit 4352e220ac04d09e120c441e79b1ac12c7ca2c45)
* - big rewrite of the Sequence documentation:Mike Bayer2017-05-051-20/+28
| | | | | | | | | | | | | 1. Sequence should be associated with MetaData always, except in the really weird case someone is sharing a Sequence among multiple metadatas. Make this a "best practice", end the confusion of #3951, #3979 2. "optional" is not a thing people use, trim this way down 3. remove confusing language Change-Id: Iab5aec319da2582092fe2615ee50430f76441aff
* - add another note re: 339e2c13b0fc8e95a47d00c0f8fc5afc4b6dff9aMike Bayer2017-05-051-0/+12
| | | | | | | | | which clarifies that ForeignKey circumvents this logic as a "convenience". issue #3978 is updated to address trying to make this consistent. Change-Id: I089acaa89f11b7a6310c2bf32916e26eb62ab9c0 (cherry picked from commit 8f830d78ba1d68ea3e10006e10e65ddb571f45ee)
* - add a note to MetaData.schema indicating that the TableMike Bayer2017-05-051-0/+13
| | | | | | | | will be cataloged in the .tables collection with its fully qualified name. Fixes #3978 Change-Id: I65fa063918efc22658e93c39a0680cb83553dec8 (cherry picked from commit 339e2c13b0fc8e95a47d00c0f8fc5afc4b6dff9a)
* Return self when Variant.coerce_compared_value would return implMike Bayer2017-04-011-1/+5
| | | | | | | | | | | | | | Fixed regression released in 1.1.5 due to :ticket:`3859` where adjustments to the "right-hand-side" evaluation of an expression based on :class:`.Variant` to honor the underlying type's "right-hand-side" rules caused the :class:`.Variant` type to be inappropriately lost, in those cases when we *do* want the left-hand side type to be transferred directly to the right hand side so that bind-level rules can be applied to the expression's argument. Change-Id: Ia54dbbb19398549d654b74668753c4152599d900 Fixes: #3952 (cherry picked from commit 6d7d48af0dec6325f87ce497f769827107ad5035)
* Fix typos ('expicit' -> 'explicit')Jamie Alessio2017-03-181-2/+2
| | | | (cherry picked from commit 3771af0af45c2a7ea79a055b953c32f23c53e256)
* - add a note as to why we have this very complicated AnnotatedMike Bayer2017-03-091-0/+7
| | | | | | system Change-Id: I7d4048b92fcd3a7c7630c43aa9390d983f447c0a
* Allow SchemaType and Variant to work togetherMike Bayer2017-03-072-11/+79
| | | | | | | | | | | | | | Added support for the :class:`.Variant` and the :class:`.SchemaType` objects to be compatible with each other. That is, a variant can be created against a type like :class:`.Enum`, and the instructions to create constraints and/or database-specific type objects will propagate correctly as per the variant's dialect mapping. Also added testing for some potential double-event scenarios on TypeDecorator but it seems usually this doesn't occur. Change-Id: I4a7e7c26b4133cd14e870f5bc34a1b2f0f19a14a Fixes: #2892
* - document ForeignKeyConstraint columns / elements, fixes #2904Mike Bayer2017-03-071-0/+22
| | | | Change-Id: Ia50a3100d1bd88020c30224932b16aeadd7f4c75
* Don't cache savepoint identifiersMike Bayer2017-03-061-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Fixed bug in compiler where the string identifier of a savepoint would be cached in the identifier quoting dictionary; as these identifiers are arbitrary, a small memory leak could occur if a single :class:`.Connection` had an unbounded number of savepoints used, as well as if the savepoint clause constructs were used directly with an unbounded umber of savepoint names. The memory leak does **not** impact the vast majority of cases as normally the :class:`.Connection`, which renders savepoint names with a simple counter starting at "1", is used on a per-transaction or per-fixed-number-of-transactions basis before being discarded. The savepoint name in virtually all cases does not require quoting at all, however to support potential third party use cases the "check for quotes needed" logic is retained, at a small performance cost. Uncondtionally quoting the name is another option, but this would turn the name into a case sensitive name which runs the risk of poor interactions with existing deployments that may be looking at these names in other contexts. Change-Id: I6b53c96abf7fdf1840592bbca5da81347911844c Fixes: #3931
* Only use schema_translate_map on SchemaItem subclassesMike Bayer2017-02-283-1/+11
| | | | | | | | | | | | | Fixed bug in new "schema translate" feature where the translated schema name would be invoked in terms of an alias name when rendered along with a column expression; occurred only when the source translate name was "None". The "schema translate" feature now only takes effect for :class:`.SchemaItem` and :class:`.SchemaType` subclasses, that is, objects that correspond to a DDL-creatable structure in a database. Change-Id: Ie8cb35aeaba2c67efec8c8c57c219e4dd346e44a Fixes: #3924
* - add a note referring to the enum value as not currently persisted,Mike Bayer2017-02-011-3/+8
| | | | | | reference #3906 Change-Id: I2274c356cc88cd011c5a34a69e75a2548a93e87a
* - clarify Enum validation rules, fixes #3904Mike Bayer2017-02-011-6/+15
| | | | Change-Id: I221f161ae77ee1b9487329330bc520ab65e97611
* - correctly document LIKE / ILIKE, fixes #3890Mike Bayer2017-01-161-6/+16
| | | | Change-Id: Ie59e61f53d7c59a4777ab9e6e75a43c71d67523b
* Better hide engine passwordValery Yundin2017-01-161-2/+2
| | | | | | | | | | Avoid putting engine password in the exception message in `MetaData.reflect` (since exception messages often appear in logs). Use the same redacted `__repr__` implementation in `TLEngine` as in its base class `Engine` Change-Id: Ic0a7baea917a9c8d87dffdd82ef566673ab08e02 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/327
* Merge "Support python3.6"mike bayer2017-01-1310-89/+89
|\
| * Support python3.6Mike Bayer2017-01-1310-89/+89
| | | | | | | | | | | | | | | | | | | | | | Corrects some warnings and adds tox config. Adds DeprecationWarning to the error category. Large sweep for string literals w/ backslashes as this is common in docstrings Co-authored-by: Andrii Soldatenko Fixes: #3886 Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337
* | Pass **kw to bound params in multi valuesMike Bayer2017-01-091-1/+1
|/ | | | | | | | | Fixed bug where literal_binds compiler flag was not honored by the :class:`.Insert` construct for the "multiple values" feature; the subsequent values are now rendered as literals. Change-Id: I81ac358fd59995885d482e7571620090210865d2 Fixes: #3880
* Merge "Tighten rules for order_by(Label) resolution"mike bayer2017-01-092-8/+9
|\
| * Tighten rules for order_by(Label) resolutionMike Bayer2017-01-062-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fixed bug originally introduced in 0.9 via :ticket:`1068` where order_by(<some Label()>) would order by the label name based on name alone, that is, even if the labeled expression were not at all the same expression otherwise present, implicitly or explicitly, in the selectable. The logic that orders by label now ensures that the labeled expression is related to the one that resolves to that name before ordering by the label name; additionally, the name has to resolve to an actual label explicit in the expression elsewhere, not just a column name. This logic is carefully kept separate from the order by(textual name) feature that has a slightly different purpose. Change-Id: I44fc36dab34380cc238c1e79ecbe23f1628d588a Fixes: #3882
* | update for 2017 copyrightMike Bayer2017-01-0419-19/+19
|/ | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* Correct any_, all_ spellingMike Bayer2016-12-281-1/+1
| | | | | | | | | - Fixed 1.1 regression where "import *" would not work for sqlalchemy.sql.expression, due to mis-spelled "any_" and "all_" functions. Change-Id: I25d1cd34c9239dbdcdb1889c5cda2474557e1418 Fixes: #3878
* Call nextval() on sequence when doing INSERT from SELECTMike Bayer2016-12-211-1/+1
| | | | | | | | Fixed bug where an INSERT from SELECT where the source table contains an autoincrementing Sequence would fail to compile correctly. Change-Id: I41eb9f65789a4007712ae61ed5fa23a9839a5128 Fixes: #3877