summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
* Fixed the persistent_to_deleted eventpr/309Diogo Dutra2016-09-291-1/+2
| | | | Got a reference of the deleted instance before remove it from state. The old code always send a None instead the instance.
* Enable include_table for ON CONFLICT whereclausesMike Bayer2016-09-281-2/+1
| | | | | | | | | Fixed issue in new PG "on conflict" construct where columns including those of the "excluded" namespace would not be table-qualified in the WHERE clauses in the statement. Change-Id: Idfefc93e7e7b0d84805e23d5436d822d606f6a0a Fixes: #3807
* Merge "Handle BaseException in all _handle_dbapi_error"mike bayer2016-09-265-30/+50
|\
| * Handle BaseException in all _handle_dbapi_errorMike Bayer2016-09-215-30/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests illustrate that exceptions like GreenletExit and even KeyboardInterrupt can corrupt the state of a DBAPI connection like that of pymysql and mysqlclient. Intercept BaseException errors within the handle_error scheme and invalidate just the connection alone in this case, but not the whole pool. The change is backwards-incompatible with a program that currently intercepts ctrl-C within a database transaction and wants to continue working on that transaction. Ensure the event hook can be used to reverse this behavior. Change-Id: Ifaa013c13826d123eef34e32b7e79fff74f1b21b Fixes: #3803
* | - improve documentation for SessionTransaction re: parentMike Bayer2016-09-242-10/+111
| | | | | | | | | | | | | | | | | | | | and nested attributes and what these mean - improve linking for after_transaction_create() / after_transaction_end() events - add public .parent attribute to detect top-level transaction within these events Change-Id: Ie7382bc8fe5de226160dcb6a5019e19fcc5af38e
* | - clarify documentation on timezone flag, since Oracle has bothMike Bayer2016-09-221-5/+36
| | | | | | | | | | | | | | DATE / TIMESTAMP separately the timezone flag will not bump the type to TIMESTAMP WITH TIMEZONE on that backend. Change-Id: I185992093472e1620b8cf84872631a4d48f8edc3
* | Ensure mapper.polymorphic_on is polymorphic_prop.columns[0]Mike Bayer2016-09-211-11/+8
|/ | | | | | | | | Fixed bug where joined eager loading would fail for a polymorphically- loaded mapper, where the polymorphic_on was set to an un-mapped expression such as a CASE expression. Change-Id: Iffe68196aaac592165c89684f09f4c06cd78ce54 Fixes: #3800
* Merge "Add exclude_tablespaces argument to Oracle"mike bayer2016-09-201-12/+47
|\
| * Add exclude_tablespaces argument to OracleDavid Fraser2016-09-201-12/+47
| | | | | | | | | | | | | | | | | | Allows the SYSTEM and SYSAUX tablespaces to be only conditionally omitted when doing get_table_names() and get_temp_table_names(). Change-Id: Ie6995873f05163f2ce473a6a9c2d958a30681b44 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/292
* | Merge "Add the "triggering mapper" to the configure_mappers error message."mike bayer2016-09-201-2/+3
|\ \ | |/ |/|
| * Add the "triggering mapper" to the configure_mappers error message.John Perkins2016-09-201-2/+3
| | | | | | | | | | | | | | | | | | | | There are cases where the originating mapper name is not present in the exception message, such as relationship initialization against an unmapped class. Ensure the originating mapper is named in the string output. Pull-request: https://github.com/zzzeek/sqlalchemy/pull/298 Change-Id: I9f23bfa90b26dde9229ab7ec812eec9ceae48153
* | Merge "Allow SQL expressions to be set on PK columns"mike bayer2016-09-201-9/+19
|\ \
| * | Allow SQL expressions to be set on PK columnsMike Bayer2016-09-201-9/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Removes an unnecessary transfer of modified PK column value to the params dictionary, so that if the modified PK column is already present in value_params, this remains in effect. Also propagate a new flag through to _emit_update_statements() that will trip "return_defaults()" across the board if a PK col w/ SQL expression change is present, and pull this PK value in _postfetch as well assuming we're an UPDATE. Change-Id: I9ae87f964df9ba8faea8e25e96b8327f968e5d1b Fixes: #3801
* | Merge "Exclude eq and ne from associative operators"mike bayer2016-09-201-1/+1
|\ \
| * | Exclude eq and ne from associative operatorsJohn Passaro2016-09-191-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | The "eq" and "ne" operators are no longer part of the list of "associative" operators, while they remain considered to be "commutative". This allows an expression like ``(x == y) == z`` to be maintained at the SQL level with parenthesis. Pull request courtesy John Passaro. Fixes: #3799 Change-Id: I3759d8987b35649d7418b6524316c9e70c857e68 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/308
* | Merge "Support bindparam() with callable for primaryjoin"mike bayer2016-09-202-2/+3
|\ \
| * | Support bindparam() with callable for primaryjoinMike Bayer2016-09-192-2/+3
| |/ | | | | | | | | | | | | | | | | | | | | Fixes the comparison of bindparam() objects based on the "callable" parameter being present which helps to correctly detect use_get, and also checks for "callable" when detecting parameters for value substitution and will not impact the object if present. Change-Id: I4c93ee5d404d2648dd9835beeae0c5fb67e37d19 Fixes: #3767
* | Merge "Fix ArgumentError access in Session._add_bind"mike bayer2016-09-191-6/+4
|\ \
| * | Fix ArgumentError access in Session._add_bindMike Bayer2016-09-191-6/+4
| |/ | | | | | | | | | | Fixes: #3798 Change-Id: Ib4e6344b599e871f9d46d36a5aeb7ba3104dc99b Pull-request: https://github.com/zzzeek/sqlalchemy/pull/293
* | Merge "Additions to support HAAlchemy plugin"mike bayer2016-09-198-21/+154
|\ \ | |/ |/|
| * Additions to support HAAlchemy pluginMike Bayer2016-09-168-21/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add a connect=True key to connection record to support pre-loading of _ConnectionRecord objects - ensure _ConnectionRecord.close() leaves the record in a good state for reopening - add _ConnectionRecord.record_info for persistent storage - add "in_use" accessor based on fairy_ref being present or not - allow for the exclusions system and SuiteRequirements to be usable without the full plugin_base setup. - move some Python-env requirements to the importable requirements.py module. - allow starttime to be queried - add additional events for engine plugins - have "dialect" be a first-class parameter to the pool, ensure the engine strategy supplies it up front Change-Id: Ibf549f7a1766e49d335cd6f5e26bacfaef9a8229
* | Add "message 20017" (unexpected EOF from the server) to mssql.Ken Robbins2016-09-191-0/+1
|/ | | | | | Fixes: #3791 Change-Id: I0dade4fe0ecbb53b4a66881594f362986ba73ae8 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/89
* Repair foreign_keys population for Join._refresh_for_new_columnMike Bayer2016-09-151-1/+1
| | | | | | | | | | Fixed bug where setting up a single-table inh subclass of a joined-table subclass which included an extra column would corrupt the foreign keys collection of the mapped table, thereby interfering with the initialization of relationships. Change-Id: I04a0cf98fd456d12d5a5b9e77a46a01246969a63 Fixes: #3797
* Merge branch 'keeyipchan/fix-typo-in-comment-1473614966363' of ↵Mike Bayer2016-09-131-2/+2
|\ | | | | | | https://bitbucket.org/keeyipchan/sqlalchemy
| * Fix typo in commentkeeyip chan2016-09-111-2/+2
| |
* | - also caveats for update() / delete() regarding singleMike Bayer2016-09-121-0/+10
| | | | | | | | | | | | | | table inheritance Change-Id: If1511812a22a53537409f902f73e2e52ae3e4a3d (cherry picked from commit 992344334328dba385fe6aa7694cfe3c13adc9d6)
* | - add caveat for bulk deletes that they are generally not feasibleMike Bayer2016-09-121-0/+26
|/ | | | | | for joined inheritance Change-Id: I043a5842401d586aa3ff96d05e06b443ff03fa60
* Merge "Allow stringify compiler to render unnamed column"mike bayer2016-09-021-3/+8
|\
| * Allow stringify compiler to render unnamed columnMike Bayer2016-09-021-3/+8
| | | | | | | | | | | | | | | | | | | | Stringify of expression with unnamed :class:`.Column` objects, as occurs in lots of situations including ORM error reporting, will now render the name in string context as "<name unknown>" rather than raising a compile error. Change-Id: I76f637c5eb4cfdb1b526964cb001565b97e296da Fixes: #3789
* | Repair clauselist comparison to account for clause orderingMike Bayer2016-09-023-6/+25
|/ | | | | | | | | | | | | | | | Fixed bug where the "simple many-to-one" condition that allows lazy loading to use get() from identity map would fail to be invoked if the primaryjoin of the relationship had multiple clauses separated by AND which were not in the same order as that of the primary key columns being compared in each clause. This ordering difference occurs for a composite foreign key where the table-bound columns on the referencing side were not in the same order in the .c collection as the primary key columns on the referenced side....which in turn occurs a lot if one is using declarative mixins and/or declared_attr to set up columns. Change-Id: I66cce74f614c04ed693dc0d58ac8c952b2f8ae54 Fixes: #3788
* Support all MySQL/Connector int/bool argumentsMike Bayer2016-09-011-0/+14
| | | | | | | | | | | Added support for parsing MySQL/Connector boolean and integer arguments within the URL query string: connection_timeout, connect_timeout, pool_size, get_warnings, raise_on_warnings, raw, consume_results, ssl_verify_cert, force_ipv6, pool_reset_session, compress, allow_local_infile, use_pure. Change-Id: I2a1a17d13d47d56871bff32e94fdbed8bc003ad7 Fixes: #3787
* Check for supports_execution at ClauseElement baseMike Bayer2016-08-316-10/+29
| | | | | | | | | | Raise a more descriptive exception / message when ClauseElement or non-SQLAlchemy objects that are not "executable" are erroneously passed to ``.execute()``; a new exception ObjectNotExecutableError is raised consistently in all cases. Change-Id: I2dd393121e2c7e5b6b9e40286a2f25670876e8e4 Fixes: #3786
* Merge remote-tracking branch 'origin/pr/304'Mike Bayer2016-08-281-2/+7
|\
| * Provide more informative error when joining with no entitiespr/304Michael Williamson2016-08-281-2/+7
| |
* | Merge remote-tracking branch 'origin/pr/303'Mike Bayer2016-08-281-1/+1
|\ \
| * | Fix table reference in PostgreSQL documentationpr/303Michael Williamson2016-08-281-1/+1
| |/
* | Fixed example of upsert in the HasCTE.cte docstring bypr/302Vladimir Magamedov2016-08-271-18/+28
|/ | | | replacing it with more concrete and working example.
* Raise when two validators conflictMike Bayer2016-08-261-0/+5
| | | | | | | | Two @validates decorators that make use of the same name is not supported. Raise an exception. Change-Id: Ia3e89ffdc9ef345a0de258e2ac0ac5e0bd421c61 Fixes: #3776
* Merge "Add docstring to declarative_base"mike bayer2016-08-221-0/+6
|\
| * Add docstring to declarative_baseFrazer McLean2016-08-061-0/+6
| | | | | | | | | | Change-Id: I5ad44362515908592f1e8b1e6254a5270d43234a Pull-request: https://github.com/zzzeek/sqlalchemy/pull/295
* | Merge remote-tracking branch 'origin/pr/299'Mike Bayer2016-08-166-7/+7
|\ \
| * | Spelling fixespr/299Ville Skyttä2016-08-086-7/+7
| |/
* | Rework _apply_joins(), _prep_for_joins() totallyMike Bayer2016-08-151-43/+47
| | | | | | | | | | | | | | | | | | | | | | | | The approach here is still error prone and hard to follow. Reorganize the whole thing to take a pretty blunt approach to the structure of to_join(). Also fix some never-called code (!) in _prep_for_joins() and ensure we re-use an aliased object. Fixes: #3774 Change-Id: Ie6319415ae7213b4a33eac2ab70803ad2880d340
* | Ensure final link in subqueryload join is correctMike Bayer2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | Fixed bug in subquery eager loading where a subqueryload of an "of_type()" object linked to a second subqueryload of a plain mapped class would fail to link the joins correctly. Change-Id: I4be89e6f5e492438464a2ded01eb9c84d7ff7d4e Fixes: #3773
* | - small updates to polymorphic eager loading, cross-link fromMike Bayer2016-08-111-5/+5
|/ | | | | | loading documentation Change-Id: I3ce7e2cc521c4dd155195819a919017d4cc63b3c
* Build string/int processors for JSONIndexType, JSONPathTypeMike Bayer2016-08-045-25/+109
| | | | | | | | | | | | Fixed regression in JSON datatypes where the "literal processor" for a JSON index value, that needs to take effect for example within DDL, would not be invoked for the value. The native String and Integer datatypes are now called upon from within the JSONIndexType and JSONPathType. This is applied to the generic, Postgresql, and MySQL JSON types. Change-Id: Ifa5f2acfeee57a79d01d7fc85d265a37bd27c716 Fixes: #3765
* Propagate kwargs to all MySQL CAST pathsMike Bayer2016-08-041-4/+4
| | | | | Change-Id: I23a6abb26bbbe3d118887d043ce761fc4572d8d2 Fixes: #3766
* Merge branch 'declarative-constructor-reference' of ↵Mike Bayer2016-08-021-1/+1
|\ | | | | | | https://bitbucket.org/michaelwilliamson/sqlalchemy
| * Fix reference to _declarative_constructor in docstringMichael Williamson2016-07-251-1/+1
| |
* | Ensure post-__clause_element__() expression are used in IndexMike Bayer2016-07-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | The change in Index for 1.1 combined with the fix for ref #3763 still fails to deliver the correct object resolved by __clause_element__() to the list of expressions for compilation. Make sure we use the expression that's been unwrapped from __clause_element__(). Change-Id: Ie1df8db5090de665048331786f0024d52851923f Fixes: #3763