summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* - add placeholder for 1.1.10Mike Bayer2017-04-061-0/+3
| | | | Change-Id: I068dd3b47dec200740db617891a64798db8f1734
* Support Postgresql INTERVAL fields spec/reflectionMike Bayer2017-04-054-9/+126
| | | | | | | | | | | | | Added support for all possible "fields" identifiers when reflecting the Postgresql ``INTERVAL`` datatype, e.g. "YEAR", "MONTH", "DAY TO MINUTE", etc.. In addition, the :class:`.postgresql.INTERVAL` datatype itself now includes a new parameter :paramref:`.postgresql.INTERVAL.fields` where these qualifiers can be specified; the qualifier is also reflected back into the resulting datatype upon reflection / inspection. Change-Id: I33816e68c533b023e0632db6f4e73fefd2de4721 Fixes: #3959
* Merge "Double percent signs based on paramstyle, not dialect"mike bayer2017-04-0510-61/+156
|\
| * Double percent signs based on paramstyle, not dialectMike Bayer2017-04-0510-61/+156
| | | | | | | | | | | | | | | | | | | | | | | | This patch moves the "doubling" of percent signs into the base compiler and makes it completely a product of whether or not the paramstyle is format/pyformat or not. Without this paramstyle, percent signs are not doubled across text(), literal_column(), and column(). Change-Id: Ie2f278ab1dbb94b5078f85c0096d74dbfa049197 Fixes: #3740
* | Merge "Recognize brackets, quoted_name in SQL Server schema"mike bayer2017-04-047-14/+265
|\ \ | |/ |/|
| * Recognize brackets, quoted_name in SQL Server schemaMike Bayer2017-04-047-14/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | The SQL Server dialect now allows for a database and/or owner name with a dot inside of it, using brackets explicitly in the string around the owner and optionally the database name as well. In addition, sending the :class:`.quoted_name` construct for the schema name will not split on the dot and will deliver the full string as the "owner". :class:`.quoted_name` is also now available from the ``sqlalchemy.sql`` import space. Change-Id: I77491d63ce47638bd23787d903ccde2f35a9d43d Fixes: #2626
* | - 1.1.9 release dateMike Bayer2017-04-041-0/+1
|/ | | | Change-Id: I8d1d55bde6424e4013c5b16bb27d6fc15fa225c2
* Add much more detail to the "unhashable types" changeMike Bayer2017-04-041-2/+35
| | | | | | Change-Id: I34cbf54913b81ef2ae8b2e60f03feb78601460e5 Fixes: 3958 (cherry picked from commit 10a3004f2ca29921c844f58689a5f02ed5f10e03)
* Merge "Apply SQL compilation to sqltext for column-level CHECK constraint"mike bayer2017-04-043-1/+28
|\
| * Apply SQL compilation to sqltext for column-level CHECK constraintMike Bayer2017-04-043-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where a column-level :class:`.CheckConstraint` would fail to compile the SQL expression using the underlying dialect compiler as well as apply proper flags to generate literal values as inline, in the case that the sqltext is a Core expression and not just a plain string. This was long-ago fixed for table-level check constraints in 0.9 as part of :ticket:`2742`, which more commonly feature Core SQL expressions as opposed to plain string expressions. Change-Id: I1301ba4b40063e91bc47726aecc5f4990ffcaeda Fixes: #3957
* | Merge "Ensure we check that SQL expression has an .info attribute"mike bayer2017-04-043-3/+15
|\ \
| * | Ensure we check that SQL expression has an .info attributeMike Bayer2017-04-043-3/+15
| |/ | | | | | | | | | | | | | | | | | | Fixed regression released in 1.1.8 due to :ticket:`3950` where the deeper search for information about column types in the case of a "schema type" or a :class:`.TypeDecorator` would produce an attribute error if the mapping also contained a :obj:`.column_property`. Change-Id: I38254834d3d79c9b339289a8163eb4789ec4c931 Fixes: #3956
* | Fix typo.Bertrand Janin2017-04-041-1/+1
|/
* ResultProxy won't autoclose connection until state flag is setMike Bayer2017-04-036-12/+103
| | | | | | | | | | | | | | Changed the mechanics of :class:`.ResultProxy` to unconditionally delay the "autoclose" step until the :class:`.Connection` is done with the object; in the case where Postgresql ON CONFLICT with RETURNING returns no rows, autoclose was occurring in this previously non-existent use case, causing the usual autocommit behavior that occurs unconditionally upon INSERT/UPDATE/DELETE to fail. Change-Id: I235a25daf4381b31f523331f810ea04450349722 Fixes: #3955 (cherry picked from commit 8ee363e4917b0dcd64a83b6d26e465c9e61e0ea5) (cherry picked from commit f52fb5282a046d26b6ee2778e03b995eb117c2ee)
* - fix version identifierMike Bayer2017-04-031-1/+1
| | | | Change-Id: I63abfb167f54ea2ea2f8bf4ba22ab38b60c5d59c
* Merge "Use consistent method signature for Alias.self_group()"mike bayer2017-04-033-4/+29
|\
| * Use consistent method signature for Alias.self_group()Mike Bayer2017-04-033-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where the use of an :class:`.Alias` object in a column context would raise an argument error when it tried to group itself into a parenthesized expression. Using :class:`.Alias` in this way is not yet a fully supported API, however it applies to some end-user recipes and may have a more prominent role in support of some future Postgresql features. Change-Id: I81717e30416e0350f08d1e022c3d84656e0a9735 Fixes: #3939
* | Return self when Variant.coerce_compared_value would return implMike Bayer2017-04-013-3/+91
|/ | | | | | | | | | | | | 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
* - 1.1.9 placeholderMike Bayer2017-04-011-0/+3
| | | | Change-Id: Ic7897b5e05d7a20b280d4412d3bdf2ebc85905d4
* - 1.1.8 release dateMike Bayer2017-03-311-0/+1
| | | | Change-Id: I6243e620e55ad862e8494d64cc754badce25097d
* Track SchemaEventTarget types in as_mutable()Mike Bayer2017-03-303-1/+76
| | | | | | | | | | | | | | Fixed bug in :mod:`sqlalchemy.ext.mutable` where the :meth:`.Mutable.as_mutable` method would not track a type that had been copied using :meth:`.TypeEngine.copy`. This became more of a regression in 1.1 compared to 1.0 because the :class:`.TypeDecorator` class is now a subclass of :class:`.SchemaEventTarget`, which among other things indicates to the parent :class:`.Column` that the type should be copied when the :class:`.Column` is. These copies are common when using declarative with mixins or abstract classes. Change-Id: Ib04df862c58263185dbae686c548fea3e12c46f1 Fixes: #3950
* Apply type processing to untyped preexec default clauseMike Bayer2017-03-305-62/+76
| | | | | | | | | | | | | | | | Fixed bug where a SQL-oriented Python-side column default could fail to be executed properly upon INSERT in the "pre-execute" codepath, if the SQL itself were an untyped expression, such as plain text. The "pre- execute" codepath is fairly uncommon however can apply to non-integer primary key columns with SQL defaults when RETURNING is not used. Tests exist here to ensure typing is applied to a typed expression for default, but in the case of an untyped SQL value, we know the type from the column, so apply this. Change-Id: I5d8b391611c137b9f700115a50a2bf5b30abfe94 Fixes: #3923
* Add bindparams support for baked Result count() methodMalaclypse The Younger2017-03-303-1/+38
| | | | | | | | | | Added support for bound parameters, e.g. those normally set up via :meth:`.Query.params`, to the :meth:`.baked.Result.count` method. Previously, support for parameters were omitted. Pull request courtesy Pat Deegan. Change-Id: I8c33548cf2a483699767e459731694c8cadebff6 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/350
* Docs/faq/performanceIhor Kalnytskyi2017-03-301-13/+31
| | | | | | | | | | | | Some updates for FAQ/Performance documentation page: * Fix typo in testing script. * Populate testing script with one more way to achieve higher performance. See commit messages for details. Change-Id: Id6fbf328164b14b3b58ca9616b103a35e72f7b8f Pull-request: https://github.com/zzzeek/sqlalchemy/pull/345
* Support Postgresql development version numbersSean McCully2017-03-293-2/+13
| | | | | | | | | Added support for parsing the Postgresql version string for a development version like "PostgreSQL 10devel". Pull request courtesy Sean McCully. Change-Id: I7bc18bc4d290349c23e9796367b7d694d0873096 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/351
* - start changelog for 1.1.8Mike Bayer2017-03-291-0/+3
| | | | Change-Id: I6c23f43ca76aeca469980fc8be228af20c2c700d
* - reorg migration notes a bitMike Bayer2017-03-281-231/+234
| | | | Change-Id: Id2a727a2a13eb84ad104ab049ae37b9e708af6b5
* - update release date for 1.1.7Mike Bayer2017-03-271-0/+1
| | | | Change-Id: I6ce86e2e0c54135194c60d99b433b2f38c467dbd
* Allow aliased() to be passed to Query.select_entity_from().Mike Bayer2017-03-273-47/+108
| | | | | | | | | | | | | | | | | An :func:`.aliased()` construct can now be passed to the :meth:`.Query.select_entity_from` method. Entities will be pulled from the selectable represented by the :func:`.aliased` construct. This allows special options for :func:`.aliased` such as :paramref:`.aliased.adapt_on_names` to be used in conjunction with :meth:`.Query.select_entity_from`. Additionally rewrote the docstring for :meth:`.Query.select_entity_from`, including starting with explicit use of :func:`.aliased` as the usual idiomatic pattern. An example using text().columns() is added as well as the use case from :ticket:`3933` using name matching. Change-Id: If7e182965236993064a2a086e3b6d55a4f097ca8 Fixes: #3933
* Merge "Add safe_reraise() + warnings only to Connection._autorollback"mike bayer2017-03-276-27/+88
|\
| * Add safe_reraise() + warnings only to Connection._autorollbackMike Bayer2017-03-276-27/+88
| | | | | | | | | | | | | | | | | | | | | | | | Added an exception handler that will warn for the "cause" exception on Py2K when the "autorollback" feature of :class:`.Connection` itself raises an exception. In Py3K, the two exceptions are naturally reported by the interpreter as one occurring during the handling of the other. This is continuing with the series of changes for rollback failure handling that were last visited as part of :ticket:`2696` in 1.0.12. Change-Id: I600ba455a14ebaea27c6189889181f97c632f179 Fixes: #3946
* | Merge branch 'patch-1' of https://github.com/tamentis/sqlalchemyMike Bayer2017-03-271-2/+2
|\ \ | |/ |/|
| * Fix a title typoBertrand Janin2017-03-191-2/+2
| | | | | | Utilites -> Utilities
* | Pre-load alias.c within JoinedEagerLoader cached AliasedClassMike Bayer2017-03-252-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a race condition which could occur under threaded environments as a result of the caching added via :ticket:`3915`. An internal collection of ``Column`` objects could be regenerated on an alias object inappropriately, confusing a joined eager loader when it attempts to render SQL and collect results and resulting in an attribute error. The collection is now generated up front before the alias object is cached and shared among threads. Change-Id: I97d5b205992d38af8d2b4307178a15c086ef9993 Fixes: #3947
* | Treat collation names as identifiersMike Bayer2017-03-237-12/+81
| | | | | | | | | | | | | | | | | | | | | | The expression used for COLLATE as rendered by the column-level :func:`.expression.collate` and :meth:`.ColumnOperators.collate` is now quoted as an identifier when the name is case sensitive, e.g. has uppercase characters. Note that this does not impact type-level collation, which is already quoted. Change-Id: I83d5d9cd1e66a4f20b96303bb84c5f360d5d6a1a Fixes: #3785
* | Support hybrids/composites with bulk updatesMike Bayer2017-03-2212-86/+474
| | | | | | | | | | | | | | | | | | | | | | The :meth:`.Query.update` method can now accommodate both hybrid attributes as well as composite attributes as a source of the key to be placed in the SET clause. For hybrids, an additional decorator :meth:`.hybrid_property.update_expression` is supplied for which the user supplies a tuple-returning function. Change-Id: I15e97b02381d553f30b3301308155e19128d2cfb Fixes: #3229
* | Use config.db global opts as defaults for all testing_engine()Mike Bayer2017-03-222-0/+5
| | | | | | | | | | | | | | | | | | | | Some options need to be passed to engines in all cases, such as currently the oracle 12516 workaround. make sure calls to testing_engine also set up the dictionary with defaults even if options is passed. not clear if this affects other backends yet. Change-Id: I5a1f7634e4ce5af6fe55dc21a24db6afacd19bb7
* | Raise on flag_modified() for non-present attributeMike Bayer2017-03-216-16/+141
| | | | | | | | | | | | | | | | | | | | | | | | The :func:`.attributes.flag_modified` function now raises :class:`.InvalidRequestError` if the named attribute key is not present within the object, as this is assumed to be present in the flush process. To mark an object "dirty" for a flush without referring to any specific attribute, the :func:`.attributes.flag_dirty` function may be used. Change-Id: I6c64e4d253c239e38632f38c27bb16e68fe8dfbe Fixes: #3753
* | Allow reuse of hybrid_property across subclassesDiana Clarke2017-03-214-21/+383
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The :class:`sqlalchemy.ext.hybrid.hybrid_property` class now supports calling mutators like ``@setter``, ``@expression`` etc. multiple times across subclasses, and now provides a ``@getter`` mutator, so that a particular hybrid can be repurposed across subclasses or other classes. This now matches the behavior of ``@property`` in standard Python. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Fixes: #3911 Fixes: #3912 Change-Id: Iff033d8ccaae20ded9289cbfa789c376759381f5
* | Integrate "pre-ping" into connection pool.Mike Bayer2017-03-2010-103/+446
|/ | | | | | | | | | | | | | | Added native "pessimistic disconnection" handling to the :class:`.Pool` object. The new parameter :paramref:`.Pool.pre_ping`, available from the engine as :paramref:`.create_engine.pool_pre_ping`, applies an efficient form of the "pre-ping" recipe featured in the pooling documentation, which upon each connection check out, emits a simple statement, typically "SELECT 1", to test the connection for liveness. If the existing connection is no longer able to respond to commands, the connection is transparently recycled, and all other connections made prior to the current timestamp are invalidated. Change-Id: I89700d0075e60abd2250e54b9bd14daf03c71c00 Fixes: #3919
* Merge branch 'master' of https://bitbucket.org/jalessio/sqlalchemyMike Bayer2017-03-183-4/+4
|\
| * Fix typos ('expicit' -> 'explicit')Jamie Alessio2017-03-143-4/+4
| |
* | fix pep8 errors in association examplePaul Brown2017-03-184-20/+33
| | | | | | | | (cherry picked from commit 6aad7fb4217ef294f68f693be5b3137c28184949)
* | fix pep8 errors in adjacency_list examplePaul Brown2017-03-182-30/+30
| | | | | | | | (cherry picked from commit ff230f1862892eb2b479ed85e6858a82159b435f)
* | New features from python 2.7Катаев Денис2017-03-1723-43/+41
| | | | | | | | | | | | | | After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax. Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347
* | Merge "Implement comments for tables, columns"mike bayer2017-03-1719-46/+408
|\ \
| * | Implement comments for tables, columnsFrazer McLean2017-03-1719-46/+408
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for SQL comments on :class:`.Table` and :class:`.Column` objects, via the new :paramref:`.Table.comment` and :paramref:`.Column.comment` arguments. The comments are included as part of DDL on table creation, either inline or via an appropriate ALTER statement, and are also reflected back within table reflection, as well as via the :class:`.Inspector`. Supported backends currently include MySQL, Postgresql, and Oracle. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Fixes: #1546 Change-Id: Ib90683850805a2b4ee198e420dc294f32f15d35d
* | | Add bulk_replace event, integrate with @validatesMike Bayer2017-03-167-19/+282
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new attribute event :meth:`.AttributeEvents.bulk_replace`. This event is triggered when a collection is assigned to a relationship, before the incoming collection is compared with the existing one. This early event allows for conversion of incoming non-ORM objects as well. The event is integrated with the ``@validates`` decorator. The ``@validates`` decorator now allows the decorated method to receive objects from a "bulk collection set" operation that have not yet been compared to the existing collection. This allows incoming values to be converted to compatible ORM objects as is already allowed from an "append" event. Note that this means that the ``@validates`` method is called for **all** values during a collection assignment, rather than just the ones that are new. Change-Id: I27f59db008d9e521d31a3e30143d7cd997e4b7b3 Fixes: #3896
* | Annotate parentmapper in primaryjoin / secondaryjoinMike Bayer2017-03-164-17/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch applies the "parentmapper" annotation to the columns in the primaryjoin/secondaryjoin, but more dramatically, also removes all the "deannotate" steps that were historically applied to the relationship primaryjoin/secondaryjoin. These deannotation steps were left over from the initial implementations of annotations where the behaviors were not as reliable. By ensuring these annotations are present, the evaluator no longer needs to do a name-based lookup when it sees a column that has no "parentmapper", because it can be assured this is not a mapped column. This fixes the issue where the expression were based on a relationship primaryjoin but the name of a column in the join condition didn't match the attribute name. Change-Id: I8c1d4594116d4109fef314a87c96a24d2efa0058 Fixes: #3366
* | Don't mutate old collection on bulk replaceMike Bayer2017-03-156-10/+61
| | | | | | | | | | | | | | | | | | | | | | | | For a bulk replace, assume the old collection is no longer useful to the attribute system and only send the removal events, not actually mutated the collection. this changes behavior significantly and also means that dispose_collection now receives the old collection intact. Change-Id: Ic2685c85438191f07797d9ef97833a2cfdc4fcc2 Fixes: #3913