summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
...
* - do ten attempts to create databaseMike Bayer2017-08-191-1/+1
| | | | Change-Id: I14a5dd920d14096aa4401cb8b9d71f47d3915879
* Merge "First level repair for cx_Oracle 6.0 test regressions"mike bayer2017-08-191-1/+3
|\
| * First level repair for cx_Oracle 6.0 test regressionsMike Bayer2017-08-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixed more regressions caused by cx_Oracle 6.0; at the moment, the only behavioral change for users is disconnect detection now detects for cx_Oracle.DatabaseError in addition to cx_Oracle.InterfaceError, as this behavior seems to have changed. Other issues regarding numeric precision and uncloseable connections are pending with the upstream cx_Oracle issue tracker. Change-Id: Id61f1e33b21c155a598396340dfdecd28ff4066b Fixes: #4045
* | - correct server side cursor assertion for driver namesMike Bayer2017-08-191-5/+5
|/ | | | Change-Id: Id8156f6af15a36f7d5653dff56f68e81431692a6
* Merge "Enable uuid for pg8000"mike bayer2017-08-171-2/+26
|\
| * Enable uuid for pg8000Mike Bayer2017-08-081-2/+26
| | | | | | | | | | | | | | | | | | Enabled UUID support for the pg8000 driver, which supports native Python uuid round trips for this datatype. Arrays of UUID are still not supported, however. Change-Id: I44ca323c5d9f2cd87327210233bc36a3556eb050 Fixes: #4016
* | Merge "Ensure Oracle index w/ col DESC etc. is reflected"mike bayer2017-08-145-23/+83
|\ \
| * | Ensure Oracle index w/ col DESC etc. is reflectedMike Bayer2017-08-145-23/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where an index reflected under Oracle with an expression like "column DESC" would not be returned, if the table also had no primary key, as a result of logic that attempts to filter out the index implicitly added by Oracle onto the primary key columns. Reworked the "filter out the primary key index" logic in oracle get_indexes() to be clearer. This changeset also adds an internal check to ColumnCollection to accomodate for the case of a column being added twice, as well as adding a private _table argument to Index such that reflection can specify the Table explicitly. The _table argument can become part of public API in a later revision or release if needed. Change-Id: I745711e03b3e450b7f31185fc70e10d3823063fa Fixes: #4042
* | | Isolate memory tests in forksMike Bayer2017-08-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Swing the biggest hammer, run multiprocessing.Process() for each memusage test individually so that they are fully isolated from the parent process and any side effects of pytest-xdist Also add --nomemory as a shortcut to exclude_tags=memory-intensive and add this to the setup.py test runner as the memory tests should not be running for quick runs Change-Id: I3c16c781e21b33deb939a64e77a6e0e41fb86922
* | | Restore original test namesMike Bayer2017-08-141-4/+3
|/ / | | | | | | | | | | | | | | | | | | | | The change in de1f8f8345ecd6af0ec1177703465e9471cfe862 modified how test classes are named, breaking logic that extracts the class name for the profiling suite. Add a new variable _sa_orig_cls_name if we've modified the name so that the profiling logic doesn't need to guess the original class name. Change-Id: Ica15a97408b9e0749a78c87f62749c15c1627009
* | Merge branch 'master--typos' of https://github.com/nphilipp/sqlalchemyMike Bayer2017-08-091-2/+2
|\ \ | |/ |/|
| * fix "constrast" typosNils Philippsen2017-08-051-2/+2
| |
* | Add quoted_name to pg8000 py_typesMike Bayer2017-08-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | Fixed bug where the pg8000 driver would fail if using :meth:`.MetaData.reflect` with a schema name, since the schema name would be sent as a "quoted_name" object that's a string subclass, which pg8000 doesn't recognize. The quoted_name type is added to pg8000's py_types collection on connect. Change-Id: Id0f838320cb66563685e094e4eae2d5116100d27 Fixes: #4041
* | Enable multi-level selectin polymorphic loadingMike Bayer2017-08-077-44/+109
| | | | | | | | | | Change-Id: Icc742bbeecdb7448ce84caccd63e086af16e81c1 Fixes: #4026
* | - modernize orm.reconstructor documentation a bitMike Bayer2017-08-052-0/+11
|/ | | | Change-Id: Ied786e8f9ad78f524be03a382d002dada7dd218b
* Allow multiple versions of single backendMike Bayer2017-08-043-9/+17
| | | | | | | | | | Improve screen output to illustrate which server version is running for a particular database config, and additionally allow full overriding for the backend-specific targets in tox.ini via environment variables, so that CI can inject multiple server urls for a particular database such as MySQL/MariaDB. Change-Id: Ibf443bb9fb82e4563efd1bb66058fa9989aa2fda
* Revert cx_Oracle WITH_UNICODE change under > 5.0Mike Bayer2017-07-281-4/+13
| | | | | | | | | | | | | | | | Fixed performance regression caused by the fix for :ticket:`3937` where cx_Oracle as of version 5.3 dropped the ``.UNICODE`` symbol from its namespace, which was interpreted as cx_Oracle's "WITH_UNICODE" mode being turned on unconditionally, which invokes functions on the SQLAlchemy side which convert all strings to unicode unconditionally and causing a performance impact. In fact, per cx_Oracle's author the "WITH_UNICODE" mode has been removed entirely as of 5.1, so the expensive unicode conversion functions are no longer necessary and are disabled if cx_Oracle 5.1 or greater is detected under Python 2. The warning against "WITH_UNICODE" mode that was removed under :ticket:`3937` is also restored. Change-Id: Iddd38d81a5adb27c953a5ee2eae5529a21da16e1 Fixes: #4035
* - 1.2.0b3 prepMike Bayer2017-07-251-1/+1
| | | | Change-Id: I9aa6e891ca896b90b97fbd0e52f0ad73494e38d7
* Merge "Ensure we check for boolean condition when we inspect __exit__()"mike bayer2017-07-241-1/+1
|\
| * Ensure we check for boolean condition when we inspect __exit__()Mike Bayer2017-07-241-1/+1
| | | | | | | | | | | | | | | | Fixed issue in testing fixtures which was incompatible with a change made as of Python 3.6.2 involving context managers. Change-Id: I0f12aa6cc15cba89153f7e4888ac347e7ce599c7 Fixes: #4034
* | Guard all indexed access in WeakInstanceDictMike Bayer2017-07-241-15/+38
|/ | | | | | | | | | | | Added ``KeyError`` checks to all methods within :class:`.WeakInstanceDict` where a check for ``key in dict`` is followed by indexed access to that key, to guard against a race against garbage collection that under load can remove the key from the dict after the code assumes its present, leading to very infrequent ``KeyError`` raises. Change-Id: I881cc2899f7961d29a0549f44149a2615ae7a4ea Fixes: #4030
* Merge "Check for column object in eval_none, not propkey"mike bayer2017-07-192-2/+2
|\
| * Check for column object in eval_none, not propkeyMike Bayer2017-07-182-2/+2
| | | | | | | | | | | | | | | | | | | | Fixed bug involving JSON NULL evaluation logic added in 1.1 as part of :ticket:`3514` where the logic would not accommodate ORM mapped attributes named differently from the :class:`.Column` that was mapped. Change-Id: I1848afcfb63ad7f074f315d8d3097666069b42be Fixes: #4031
* | Check for non-entity when inspecting for subqueryloadMike Bayer2017-07-181-0/+1
|/ | | | | | | | | | Fixed issue where adding additional non-entity columns to a query that includes an entity with subqueryload relationships would fail, due to an inspection added in 1.1.11 as a result of :ticket:`4011`. Change-Id: I8ef082be649125bdc07b428cb9b0a77a65d73671 Fixes: #4033
* - 1.2.0b2 placeholderMike Bayer2017-07-141-1/+1
| | | | Change-Id: I95ff7f4bb0048b363987344d359f252469b23b79
* Merge "Add support for CACHE and ORDER to sequences"mike bayer2017-07-063-3/+22
|\
| * Add support for CACHE and ORDER to sequencesDavid Moore2017-07-053-3/+22
| | | | | | | | | | | | | | | | | | | | | | 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
* | Add .autocommit to scoped_sessionBen Fagin2017-07-051-1/+2
|/ | | | | | | | | | Added ``.autocommit`` attribute to :class:`.scoped_session`, proxying the ``.autocommit`` attribute of the underling :class:`.Session` currently assigned to the thread. Pull request courtesy Ben Fagin. Change-Id: Iff741978bd67762f4c7375a23cc151b26192042b Pull-request: https://github.com/zzzeek/sqlalchemy/pull/372
* Implement MySQL's ON DUPLICATE KEY UPDATEMichael Doronin2017-07-033-0/+200
| | | | | | | | | | | Added support for MySQL's ON DUPLICATE KEY UPDATE MySQL-specific :class:`.mysql.dml.Insert` object. Pull request courtesy Michael Doronin. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Resolves: #4009 Change-Id: Ic71424f3c88af6082b48a910a2efb7fbfc0a7eb4 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/365
* Include missing import in exampleMichael Stewart2017-06-301-0/+1
|
* Coerce to float for Float with all native decimal backendsMike Bayer2017-06-262-1/+2
| | | | | | | | | | | | | The result processor for the :class:`.Float` type now unconditionally runs values through the ``float()`` processor if the dialect specifies that it also supports "native decimal" mode. While most backends will deliver Python ``float`` objects for a floating point datatype, the MySQL backends in some cases lack the typing information in order to provide this and return ``Decimal`` unless the float conversion is done. Change-Id: I638f1480fb00a507036efaf0e0080f26893d98ad Fixes: #4020
* Merge "Support state expiration for with_expression(); rename ↵mike bayer2017-06-265-13/+27
|\ | | | | | | deferred_expression"
| * Support state expiration for with_expression(); rename deferred_expressionMike Bayer2017-06-265-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attributeimpl for a deferred_expression does not support a scalar loader, add new configurability so that the impl can have this flag turned off. Document that the with_expression() system currently does not offer any deferred loading. To eliminate confusion over "deferred", which refers to lazy loading of column attributes, and "with_expression", which refers to an attribute that is explicitly at query time only, rename deferred_expression to query_expression. Change-Id: I07c4a050ed68c79ccbde9492e9de1630b7470d74
* | Return given type when it matches the adaptationMike Bayer2017-06-261-38/+32
|/ | | | | | | | | | | | | The rules for type coercion between :class:`.Numeric`, :class:`.Integer`, and date-related types now include additional logic that will attempt to preserve the settings of the incoming type on the "resolved" type. Currently the target for this is the ``asdecimal`` flag, so that a math operation between :class:`.Numeric` or :class:`.Float` and :class:`.Integer` will preserve the "asdecimal" flag as well as if the type should be the :class:`.Float` subclass. Change-Id: Idfaba17220d6db21ca1ca4dcb4c19834cd397817 Fixes: #4018
* Merge "Coerce float Python type to Float; ensure Python float coming back"mike bayer2017-06-262-1/+19
|\
| * Coerce float Python type to Float; ensure Python float coming backMike Bayer2017-06-262-1/+19
| | | | | | | | | | | | | | | | | | | | | | Added some extra strictness to the handling of Python "float" values passed to SQL statements. A "float" value will be associated with the :class:`.Float` datatype and not the Decimal-coercing :class:`.Numeric` datatype as was the case before, eliminating a confusing warning emitted on SQLite as well as unecessary coercion to Decimal. Change-Id: I1bb1810ff1d198c0d929ccba5656e55401d74119 Fixes: #4017
* | Don't erase reflected comment in _init_existingEloy Felix2017-06-201-2/+3
|/ | | | | Change-Id: Ie0b78c79367933486528ca0ba686d4a9f16922b1 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/370
* Add ad-hoc mapped expressionsMike Bayer2017-06-193-0/+106
| | | | | | | | | | Added a new feature :func:`.orm.with_expression` that allows an ad-hoc SQL expression to be added to a specific entity in a query at result time. This is an alternative to the SQL expression being delivered as a separate element in the result tuple. Change-Id: Id8c479f7489fb02e09427837c59d1eabb2a6c014 Fixes: #3058
* Merge "Handle SHOW VARIABLES returning no row"mike bayer2017-06-161-11/+27
|\
| * Handle SHOW VARIABLES returning no rowMike Bayer2017-06-161-11/+27
| | | | | | | | | | | | | | | | | | | | | | MySQL 5.7 has introduced permission limiting for the "SHOW VARIABLES" command; the MySQL dialect will now handle when SHOW returns no row, in particular for the initial fetch of SQL_MODE, and will emit a warning that user permissions should be modified to allow the row to be present. Change-Id: I98e7a69230da397b17eae07b7e9d024fa7aeeb26 Fixes: #4007
* | Merge "Add all versioning logic to _post_update()"mike bayer2017-06-161-17/+93
|\ \
| * | Add all versioning logic to _post_update()Mike Bayer2017-06-151-17/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An UPDATE emitted as a result of the :paramref:`.relationship.post_update` feature will now integrate with the versioning feature to both bump the version id of the row as well as assert that the existing version number was matched. Fixes: #3496 Change-Id: I865405dd6069f1c1e3b0d27a4980e9374e059f97
* | | Set complete FROM list for subquery eagerload's orig queryMike Bayer2017-06-161-8/+15
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of checking that the "orig_entity" we receive applies as a correct FROM element for the subquery we're building, set the FROM clause of the query to exactly what it already is based on column_descriptions (assuming there is no FROM list already), thereby ensuring that the FROM list will remain intact, regardless of what orig_entity turns out to be and what the target_cols ultimately refer towards. Fixed issue with subquery eagerloading which continues on from the series of issues fixed in :ticket:`2699`, :ticket:`3106`, :ticket:`3893` involving that the "subquery" contains the correct FROM clause when beginning from a joined inheritance subclass and then subquery eager loading onto a relationship from the base class, while the query also includes criteria against the subclass. The fix in the previous tickets did not accommodate for additional subqueryload operations loading more deeply from the first level, so the fix has been further generalized. Change-Id: Ic909590814f71e577d8266b1dbc4c393dc48e019 Fixes: #4011
* | 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
* Repair regression to pathing for subclassesMike Bayer2017-06-151-2/+7
| | | | | | | | | Issue #3963's initial commit narrowed the "current path" match rules too much such that a path that matches current path on subclass would no longer match. Change-Id: I8c9a0db91a09d789cfb8666288a913f8bbcdb2e9 Fixes: #3963
* Refinements for unitofwork internalsMike Bayer2017-06-142-51/+66
| | | | | | | | | | | * remove "mapper" argument from SaveUpdateState, DeleteState * use __slots__ for all uow action classes * rename ".delete" to ".isdelete" * rename issue_post_update to register_post_update since this doesn't actually issue the UPDATE * rename IssuePostUpdate to PostUpdateAll Change-Id: Ia6263b80d6a86eab1e8ed38df1421b1d0f249797
* Support AssociationProxy any() / has() / contains() to another AssociationProxyMike Bayer2017-06-121-36/+68
| | | | | | | | | | | | | | | | | | | The :meth:`.AssociationProxy.any`, :meth:`.AssociationProxy.has` and :meth:`.AssociationProxy.contains` comparison methods now support linkage to an attribute that is itself also an :class:`.AssociationProxy`, recursively. After some initial attempts it's clear that the any() / has() of AssociationProxy needed to be reworked into a generic _criterion_exists() to allow this to work recursively without excess complexity. For the case of the multi-linked associationproxy, the usual checks of "any()" / "has()" correctness simply don't take place; for a single-link association proxy the error checking logic that takes place in relationship() has been ported to the local any() / has() methods. Change-Id: Ic5aed2a4e910b8138a737d215430113c31cce856 Fixes: #3769
* Render ARRAY index embedded between type and COLLATEMike Bayer2017-06-081-3/+9
| | | | | | | | | | | | | | | | Fixed bug where using :class:`.ARRAY` with a string type that features a collation would fail to produce the correct syntax within CREATE TABLE. The "COLLATE" must appear to the right of the array dimensions, so we are using regexp substitution to insert the brackets in the appropriate place. A more heavyweight solution would be that datatypes know how to split up their base type vs. modifiers, but as this is so specific to Postgresql ARRAY it's better to handle these cases more locally. Change-Id: I394c3c673eb60689e51b5301e51651972cfdb4c0 Fixes: #4006
* Parse for Postgresql version w/ "beta"Mike Bayer2017-06-071-1/+1
| | | | | | | | | | | | | Continuing with the fix that correctly handles Postgresql version string "10devel" released in 1.1.8, an additional regexp bump to handle version strings of the form "10beta1". While Postgresql now offers better ways to get this information, we are sticking w/ the regexp at least through 1.1.x for the least amount of risk to compatibility w/ older or alternate Postgresql databases. Change-Id: I12ddb06465f7dcf80563c27632441ef5963f60d4 Fixes: #4005
* - assert passive_deletes='all' does not affect collection/scalarMike Bayer2017-06-061-7/+8
| | | | | | | | | | | | membership removal in issue #3844 we hypotheized that passive_deletes='all' was broken because it sets to NULL a foreign key attribute when the child object is removed or replaced. However, not doing the NULL set means that nothing happens at all and the operation silently fails. Change-Id: I11834e7e324349e172dc797bac62731008b6b95a