summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
* add nullsfirst() / nullslast() to top-level importsLele Gaifax2017-11-162-0/+4
| | | | | Change-Id: Ieefcc4c30c1c17f43f2908d961e00815bae862bb Pull-request: https://github.com/zzzeek/sqlalchemy/pull/378
* Merge "Add baked.Result.with_post_criteria method"mike bayer2017-11-132-15/+56
|\
| * Add baked.Result.with_post_criteria methodMike Bayer2017-11-122-15/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | Added new method :meth:`.baked.Result.with_post_criteria` to baked query system, allowing non-SQL-modifying transformations to take place after the query has been pulled from the cache. Among other things, this method can be used with :class:`.horizontal_shard.ShardedQuery` to set the shard identifier. :class:`.horizontal_shard.ShardedQuery` has also been modified such that its :meth:`.ShardedQuery.get` method interacts correctly with that of :class:`.baked.Result`. Change-Id: I04630c683240abbb4b99f0510a1a3dcb564815b4 Fixes: #4135
* | Propagate kwargs for mysql concat, matchMike Bayer2017-11-131-7/+7
|/ | | | | | | | | | | Fixed bug where the MySQL "concat" and "match" operators failed to propagate kwargs to the left and right expressions, causing compiler options such as "literal_binds" to fail. Also adds non-interpreted **kw for visit_create_index, visit_typeclause Change-Id: Iaf54ac18949cc6a54f50678125f010b4f12c5673 Fixes: #4136
* Fix as many RST parse warnings as possible.Mike Bayer2017-11-036-55/+57
| | | | | | | Still a few I can't get. Also 0.9 is EOL so hide the unreleased notes. Change-Id: If0e44d4a0b3e78e211f32d5c33b51b1a007c9c69
* Add doc note for contains_eager() w/ subclasses.Mike Bayer2017-11-021-1/+13
| | | | | Change-Id: I9634136e1855a081c25b04bb6ae8248f0f94be1c Fixes: #4130
* - cross-link of_type() correctlyMike Bayer2017-11-022-4/+5
| | | | Change-Id: Iaacab5d2fe45b0b87fea922ec914e258dba9e30d
* 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
* - add notes that @comparator and @expression don't go together.Mike Bayer2017-10-301-0/+8
| | | | Change-Id: I3fb366f8b49454453e4b6dada565c24c5ccb975e
* Filter attributes we don't map during a load_scalar_attributesMike Bayer2017-10-282-0/+10
| | | | | | | | | | | | | | Fixed bug where a descriptor that is elsewhere a mapped column or relationship within a hierarchy based on :class:`.AbstractConcreteBase` would be referred towards during a refresh operation, causing an error as the attribute is not mapped as a mapper property. A similar issue can arise for other attributes like the "type" column added by :class:`.AbstractConcreteBase` if the class fails to include "concrete=True" in its mapper, however the check here should also prevent that scenario from causing a problem. Change-Id: I407b07a3a3e2c374da19fc86ed44b987d595dcfa Fixes: #4124
* Merge "Rework autoescape to be a simple boolean; escape the escape character"mike bayer2017-10-262-81/+352
|\
| * Rework autoescape to be a simple boolean; escape the escape characterMike Bayer2017-10-242-81/+352
| | | | | | | | | | | | | | | | | | | | | | | | Reworked the new "autoescape" feature introduced in :ref:`change_2694` in 1.2.0b2 to be fully automatic; the escape character now defaults to a forwards slash ``"/"`` and is applied to percent, underscore, as well as the escape character itself, for fully automatic escaping. The character can also be changed using the "escape" parameter. Change-Id: I74894a2576983c0f6eb89480c9e5727f49fa9c25 Fixes: #2694
* | Fix / consolidate for SQL Server BINARY, VARBINARYBen Shen2017-10-252-7/+26
|/ | | | | | | | | | | | Fixed bug where sqltypes.BINARY and sqltypes.VARBINARY datatypes would not include correct bound-value handlers for pyodbc, which allows the pyodbc.NullParam value to be passed that helps with FreeTDS. Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I6e3c16a69465b4fbc7b17a1927fb5e66acee93cb Pull-request: https://github.com/zzzeek/sqlalchemy/pull/386 Fixes: #4121
* Merge "Resolve AliasedClass when determining owning class of association proxy"mike bayer2017-10-231-1/+12
|\
| * Resolve AliasedClass when determining owning class of association proxyMike Bayer2017-10-201-1/+12
| | | | | | | | | | | | | | | | | | | | Fixed bug where the association proxy would inadvertently link itself to an :class:`.AliasedClass` object if it were called first with the :class:`.AliasedClass` as a parent, causing errors upon subsequent usage. Change-Id: I9161bab67766bb75d73ca54d712ad1cad6de40dc Fixes: #4116
* | Merge "Remove deprecation warnings mysql5 7 20"mike bayer2017-10-231-1/+8
|\ \
| * | Remove deprecation warnings mysql5 7 20Daniel Thorell2017-10-231-1/+8
| |/ | | | | | | | | | | | | | | | | | | | | MySQL 5.7.20 now warns for use of the @tx_isolation variable; a version check is now performed and uses @transaction_isolation instead to prevent this warning. Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com> Fixes: #4120 Change-Id: I4d2e04df760c5351a71dde8b32145cdc69fa6115 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/391
* | Get MariaDB normalized version relative to "MariaDB" tokenMike Bayer2017-10-201-2/+3
|/ | | | | | | | Fixed regression from 1.2.0b3 where "MariaDB" version comparison can fail for some particular MariaDB version strings under Python 3. Change-Id: Iedf49f40c1614ccedf63e0fa26719dd704da104d Fixes: #4115
* Merge branch 'patch-1' of https://github.com/pletnes/sqlalchemyMike Bayer2017-10-201-1/+1
|\
| * Add missing space in repr of the sessionmaker classPaul Anton Letnes2017-10-161-1/+1
| | | | | | The missing space was driving me nuts.
* | Merge "Don't commit failed transaction"mike bayer2017-10-201-1/+5
|\ \
| * | Don't commit failed transactionMike Bayer2017-10-181-1/+5
| |/ | | | | | | | | | | | | | | | | | | The test here commits even though integrityerror was raised due to the fixture. Postgresql seems to allow this even though it's usually strict about this. remove the requirement that a database needs to be able to commit after an integrity error was raised. Change-Id: I437faadb04ff7a9c3f624c68646b4f4f504b504a
* | add order_by clause to make tests stableJan2017-10-171-2/+2
|/ | | | | | | I observed test runs that failed on 'test_bound_in_scalar' due to arbitrary ordering of the result set. The assertion not only tests for the elements to be present, but also for the correct ordering. Hence, the proposal to add an order_by clause to the select statements. Change-Id: If1fbb864761e77dfd2a42ef857801c8aaf893bee Pull-request: https://github.com/zzzeek/sqlalchemy/pull/389
* Version 1.2.0b4 placeholderMike Bayer2017-10-131-1/+1
| | | | Change-Id: I6f0a29360d70851398532e957722ae2a76b76f38
* Disallow all ambiguous boolean values for BooleanMike Bayer2017-10-122-11/+37
| | | | | | | | | | | | | | In release 1.1, the :class:`.Boolean` type was broken in that boolean coercion via ``bool()`` would occur for backends that did not feature "native boolean", but would not occur for native boolean backends, meaning the string ``"0"`` now behaved inconsistently. After a poll, a consensus was reached that non-boolean values should be raising an error, especially in the ambiguous case of string ``"0"``; so the :class:`.Boolean` datatype will now raise ``ValueError`` if an incoming value is not within the range ``None, True, False, 1, 0``. Change-Id: If70c4f79c266f0dd1a0306c0ffe7acb9c66c4cc3 Fixes: #4102
* Add fast execution helper support.Mike Bayer2017-10-101-1/+45
| | | | | | | | | | | | Added a new flag ``use_batch_mode`` to the psycopg2 dialect. This flag enables the use of psycopg2's ``psycopg2.extras.execute_batch`` extension when the :class:`.Engine` calls upon ``cursor.executemany()``. This extension provides a critical performance increase by over an order of magnitude when running INSERT statements in batch. The flag is False by default as it is considered to be experimental for now. Change-Id: Ib88d28bc792958d47109f644ff1d08c897db4ff7 Fixes: #4109
* - add a note how to generate pg10 IDENTITY for nowMike Bayer2017-10-091-2/+36
| | | | Change-Id: I22dbf6ba322904a80c6df46f6a31daa2fcc1f946
* Merge "Don't include SelectBase when searching for surface column elements"mike bayer2017-10-082-4/+9
|\
| * Don't include SelectBase when searching for surface column elementsMike Bayer2017-10-052-4/+9
| | | | | | | | | | | | | | | | | | | | 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
* | 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
* Merge "Add SQL Server TIMESTAMP / ROWVERSION datatypes"mike bayer2017-10-042-3/+79
|\
| * Add SQL Server TIMESTAMP / ROWVERSION datatypesMike Bayer2017-10-042-3/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | SQL Server has an entirely different use for the TIMESTAMP datatype that is unrelated to the SQL standard's version of this type. It is a read-only type that returns an incrementing binary value. The ROWVERSION name will supersede the TIMESTAMP name. Implement datatype objects for both, separate from the base DateTime/TIMESTAMP class hierarchy, and also implement an optional integer coercion feature. Change-Id: Ie2bd43b7aac57760b8ec6ff6e26460e2086a95eb Fixes: #4086
* | Merge "Improve check for overlapping FK targets on sibling classes"mike bayer2017-10-041-0/+15
|\ \ | |/ |/|
| * Improve check for overlapping FK targets on sibling classesMike Bayer2017-10-031-0/+15
| | | | | | | | | | | | | | | | | | | | Fixed bug where ORM relationship would warn against conflicting sync targets (e.g. two relationships would both write to the same column) for sibling classes in an inheritance hierarchy, where the two relationships would never actually conflict during writes. Change-Id: I9367a7978cadc59066e89fc4917d7eb6c78dedee Fixes: #4078
* | PG dialect test fixesMike Bayer2017-10-021-0/+3
|/ | | | | | | | Make sure we clear the plugin registry before testing that the "postgres" name raises. Also move non-backend tests out of MiscTest into a new suite. Change-Id: Icd1bb4745aa07f52d585fcf959f76fcd8bdc7f24
* Support mariadb 10.2Mike Bayer2017-09-282-11/+49
| | | | | | | | | | | | | | | | | Fixed issue where CURRENT_TIMESTAMP would not reflect correctly in the MariaDB 10.2 series due to a syntax change, where the function is now represented as ``current_timestamp()``. Fixes: #4096 MariaDB 10.2 now supports CHECK constraints (warning: use version 10.2.9 or greater due to upstream issues noted in :ticket:`4097`). Reflection now takes these CHECK constraints into account when they are present in the ``SHOW CREATE TABLE`` output. Fixes: #4098 Change-Id: I8666d61814e8145ca12cbecad94019b44af868e3
* Take schema name into account when querying sqlite_masterMike Bayer2017-09-283-6/+61
| | | | | | | | | | | Fixed bug where SQLite CHECK constraint reflection would fail if the referenced table were in a remote schema, e.g. on SQLite a remote database referred to by ATTACH. Also add suite support for general CHECK constraint reflection. Change-Id: I073a72cb47dc4f8c5683000d708768523759332f Fixes: #4099
* Warn for mariadb 10.2 < 9Mike Bayer2017-09-281-0/+15
| | | | | | | | | | There's a few CHECK constraint issues we managed to get resolved as of MariaDB 10.2.8 then 10.2.9. They are pretty severe so warn users for these particular mariadb versions. Change-Id: Ie0899f94fda25960975ebee72f3044370f43eb7c Fixes: #4097
* Merge "Add full list of pyodbc error codes for MSSQL"mike bayer2017-09-282-2/+10
|\
| * Add full list of pyodbc error codes for MSSQLMike Bayer2017-09-282-2/+10
| | | | | | | | | | | | | | | | | | Moved the SQL server error codes out of connnectors/pyodbc.py and into mssql/pyodbc.py. Added complete list of odbc-related disconnect codes. Change-Id: Icd84a920dbfa1f188847f859654ff6f7a48170f1 Fixes: #4095
* | - add more dragons to session.begin() / autocommit docsMike Bayer2017-09-281-11/+26
| | | | | | | | Change-Id: I9e326f353d396321565dfbf53b7a30f18d8c86e9
* | - tweak the handle_error docs a bitMike Bayer2017-09-281-4/+21
| | | | | | | | Change-Id: Iebe5b13b3a568f3aa0f3ab02a55e2a9cbb4545c7
* | Merge "Support method form of any_(), all_()"mike bayer2017-09-272-1/+35
|\ \
| * | 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
* | Merge "Accomodate for multidimensional array in rewriting for COLLATE"mike bayer2017-09-271-2/+4
|\ \
| * | Accomodate for multidimensional array in rewriting for COLLATEMike Bayer2017-09-271-2/+4
| |/ | | | | | | | | | | | | | | | | Made further fixes to the :class:`.ARRAY` class in conjunction with COLLATE, as the fix made in :ticket:`4006` failed to accommodate for a multidimentional array. Change-Id: If3e438f8ce94ebae2196671c88a4914f3b743e60 Fixes: #4006
* | Merge "Don't expire "deferred" attributes in make_transient_to_detached"mike bayer2017-09-272-1/+14
|\ \
| * | Don't expire "deferred" attributes in make_transient_to_detachedMike Bayer2017-09-262-1/+14
| |/ | | | | | | | | | | | | | | | | | | Fixed issue where the :func:`.make_transient_to_detached` function would expire all attributes on the target object, including "deferred" attributes, which has the effect of the attribute being undeferred for the next refesh, causing an unexpected load of the attribute. Change-Id: I82a385e3033e3f3c31569b1e908efb5f258d0f27 Fixes: #4084
* | Merge "Warnings for @declared_attr.cascading"mike bayer2017-09-272-8/+52
|\ \ | |/ |/|
| * Warnings for @declared_attr.cascadingticket_4091Mike Bayer2017-09-262-8/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A warning is emitted if a subclass attempts to override an attribute that was declared on a superclass using ``@declared_attr.cascading`` that the overridden attribute will be ignored. This use case cannot be fully supported down to further subclasses without more complex development efforts, so for consistency the "cascading" is honored all the way down regardless of overriding attributes. A warning is emitted if the ``@declared_attr.cascading`` attribute is used with a special declarative name such as ``__tablename__``, as this has no effect. Ensure that documenation refers to the current inconsistency that __tablename__ can be overridden by subclasses however @declared_attr.cascading cannot. Fixes: #4091 Fixes: #4092 Change-Id: I3aecdb2f99d408e404a1223f5ad86ae3c7fdf036