Commit Graph

10194 Commits

Author SHA1 Message Date
Mike Bayer 4fcd93afb8 - close the session 2015-11-29 21:50:50 -05:00
Mike Bayer b0308a7b3a - Fixed an issue in baked queries where the .get() method, used either
directly or within lazy loads, didn't consider the mapper's "get clause"
as part of the cache key, causing bound parameter mismatches if the
clause got re-generated.  This clause is cached by mappers
on the fly but in highly concurrent scenarios may be generated more
than once when first accessed.
fixes #3597
2015-11-29 11:42:55 -05:00
Mike Bayer c90f0a49f3 - Added support for parameter-ordered SET clauses in an UPDATE
statement.  This feature is available by passing the
:paramref:`~.sqlalchemy.sql.expression.update.preserve_parameter_order`
flag either to the core :class:`.Update` construct or alternatively
adding it to the :paramref:`.Query.update.update_args` dictionary at
the ORM-level, also passing the parameters themselves as a list of 2-tuples.
Thanks to Gorka Eguileor for implementation and tests.
adapted from pullreq github:200
2015-11-28 14:30:05 -05:00
Mike Bayer 1202e140b9 - Fixed bug which is actually a regression that occurred between
versions 0.8.0 and 0.8.1, due 🎫`2714`.  The case where
joined eager loading needs to join out over a subclass-bound
relationship when "with_polymorphic" were also used would fail
to join from the correct entity.
fixes #3593
2015-11-25 15:29:04 -05:00
Mike Bayer 2a2be6a2ce - support declarativemappedtest with per-test setup 2015-11-25 15:15:35 -05:00
Mike Bayer 2743b674f5 - add an ignore for N806 2015-11-25 14:31:58 -05:00
Bas van den Heuvel 054b22c786 - Change "expr" to "entity" for example illustrating an event
that intercepts a query and adds entity-oriented criteria
2015-11-24 14:10:51 -05:00
Mike Bayer f7943db2f3 - add py35 2015-11-22 16:04:04 -05:00
Mike Bayer f9679710f1 - set explicit encoding settings for default mysql driver 2015-11-21 17:01:25 -05:00
Mike Bayer 60c36ca841 - Fixed joinedload bug which would occur when a. the query includes
limit/offset criteria that forces a subquery b. the relationship
uses "secondary" c. the primaryjoin of the relationship refers to
a column that is either not part of the primary key, or is a PK
col in a joined-inheritance subclass table that is under a different
attribute name than the parent table's primary key column d. the
query defers the columns that are present in the primaryjoin, typically
via not being included in load_only(); the necessary column(s) would
not be present in the subquery and produce invalid SQL.
fixes #3592
2015-11-21 16:36:50 -05:00
Mike Bayer 068d37035a - don't create tables on compile-only tests 2015-11-21 16:20:25 -05:00
Mike Bayer ef9a4cb60b - try to get this to skip for oracle 2015-11-20 18:19:33 -05:00
Mike Bayer a6fe4dc0c8 - A rare case which occurs when a :meth:.Session.rollback fails in the
scope of a :meth:`.Session.flush` operation that's raising an
exception, as has been observed in some MySQL SAVEPOINT cases, prevents
the original  database exception from being observed when it was
emitted during  flush, but only on Py2K because Py2K does not support
exception  chaining; on Py3K the originating exception is chained.  As
a workaround, a warning is emitted in this specific case showing at
least the string message of the original database error before we
proceed to raise  the rollback-originating exception.
fixes #2696
2015-11-19 15:45:17 -05:00
Mike Bayer 1dc805dd4d - add documentation that describes, then proceeds to warn about
the many caveats and confusing effects of, the popular approach
of using contains_eager() to alter the natural result of a
related collection.  I'm not a fan of this technique as it changes
the semantics of a relationship in such a way that the rest of the
ORM isn't aware of and it also can be undone very easily; hence the
section needs as much text for warnings as for describing the
technique itself.   fixes #3563
2015-11-19 15:24:22 -05:00
Mike Bayer 9ed36c2eed - Fixed the `.python_type attribute of :class:.postgresql.INTERVAL`
to return ``datetime.timedelta`` in the same way as that of
:obj:`.types.Interval.python_type`, rather than raising
``NotImplementedError``.
fixes #3571

(cherry picked from commit 29d6f6e19b)
2015-11-19 15:11:37 -05:00
Mike Bayer c7f9aa2818 - rewrite the docs and add a test for the bake_queries=True
relationship flag; this flag *does* have an effect when the baked
lazy loader plugin has been invoked.  clarify the intent of this
flag as an "opt out" but only has an effect when the baked system
is loaded anyway.  fixes #3572
2015-11-19 14:23:08 -05:00
Mike Bayer 14498364f8 - Added support for reflecting the source of materialized views
to the Postgresql version of the :meth:`.Inspector.get_view_definition`
method.
fixes #3587
2015-11-18 09:06:33 -05:00
Mike Bayer 0847097c29 - extend pullreq github:213 to also include DATETIMEOFFSET and TIME,
which also accept zero precision
- extend test case here to include a backend-agnostic suite
- changelog for MSSQL date fix
2015-11-14 12:38:45 -05:00
Mike Bayer ac9ded338f Merge remote-tracking branch 'origin/pr/213' into pr213 2015-11-14 11:39:58 -05:00
Jacobo de Vera 80ce23f6fd Pass precision value to mssql.DATETIME2 when it is 0
The simple check on the precision results in DATETIME2(0) generating a
DATETIME2 column, with default precision, which is 7.
2015-11-13 20:51:05 +01:00
Mike Bayer 37565d2ce2 - fix missing argument in TypeDecorator.copy(), fixes #3584, references #2919 2015-11-13 11:01:49 -05:00
Mike Bayer 3370cbde50 - correct the commit from ref #3582 to refer to the correct sub-element 2015-11-11 14:21:02 -05:00
Mike Bayer 33c378f768 - Fixed bug where the "single table inheritance" criteria would be
added onto the end of a query in some inappropriate situations, such
as when querying from an exists() of a single-inheritance subclass.

fixes #3582
2015-11-11 12:57:32 -05:00
Mike Bayer d51a36397e Merge branch 'jeffwidman/update-links-in-sqlalchemy-docs-that-poi-1446667164356' of https://bitbucket.org/jeffwidman/sqlalchemy 2015-11-10 13:00:03 -05:00
Mike Bayer 1dbd3a0706 Merge branch 'jeffwidman/fix-typo-foriegn-foreign-1446862160653' of https://bitbucket.org/jeffwidman/sqlalchemy-1 into typos 2015-11-10 12:56:01 -05:00
Sven Schliesing 887edc431a fix typo: Explcitly -> Explicitly 2015-11-10 08:25:27 +01:00
Mike Bayer 5d8bb1f4a6 - fix ambiguous documentation re: after_flush_postexec(), the
looping nature of it only occurs within the context of a commit.
2015-11-09 16:48:58 -05:00
Mike Bayer 2d54e3819f - fix broken link to loader behavior 2015-11-07 14:24:12 -05:00
Jeff Widman 8660883e1a Fix typo: foriegn --> foreign 2015-11-07 02:09:28 +00:00
Jeff Widman a2e83dbd2a Updated PostgreSQL links to point to "current" rather than hardcoded version 2015-11-05 23:34:27 +00:00
Jeff Widman 0d3ab3198a Update links in SQLAlchemy docs that point to postgres docs to use 'devel' rather than hardcoded version 2015-11-04 19:59:28 +00:00
Mike Bayer 07a199d929 - cross-linking for pool recycle feature 2015-10-30 11:47:32 -04:00
Mike Bayer 382950b701 Merge branch 'pr204' 2015-10-29 14:38:34 -04:00
Mike Bayer e31211c578 - convert wrap_callable() to a general purpose update_wrapper-like
function; the caller still passes in the "wrapper"
- move tests for wrap_callable() to be generic util tests
- changelog for pullreq github:204
2015-10-29 14:28:00 -04:00
Mike Bayer 98c1dcc6bc - add a JSON warning for coerce_compared_value 2015-10-28 11:22:55 -04:00
Mike Bayer c2c4fc14d5 Merge remote-tracking branch 'origin/pr/196' into pr196 2015-10-22 17:27:44 -04:00
Mike Bayer 2daaacef04 - update the pool pessimistic invalidation recipe to refer to the
engine_connect event, allowing easy detection of disconnects
and full invalidation of the pool
2015-10-22 11:58:25 -04:00
Mike Bayer 8a4a1fd70a - release date for 1.0.9 2015-10-20 18:14:26 -04:00
Mike Bayer 13278d1108 - try to make this language more succinct and fix links
(cherry picked from commit 3ffe8569fb)
2015-10-20 18:13:16 -04:00
Mike Bayer 5bc5adb627 - use is_() here to more clearly show what's going wrong
on occasional pypy test runs
2015-10-19 18:48:58 -04:00
Mike Bayer 8e9a81a19e - adjust 4f54607923 where we still allow_multirow as long
as versioning isn't needed, fixes test_unitofworkv2->test_update_multi_missing_broken_multi_rowcount
2015-10-19 14:22:31 -04:00
Mike Bayer 1e0afd584c - Fixed regression in 1.0 where new feature of using "executemany"
for UPDATE statements in the ORM (e.g. :ref:`feature_updatemany`)
would break on Postgresql and other RETURNING backends
when using server-side version generation
schemes, as the server side value is retrieved via RETURNING which
is not supported with executemany.
fixes #3556
2015-10-19 12:17:37 -04:00
Martin J. Hsu c7d04beeac - wrap ColumnDefault empty arg callables like functools.wraps, setting __name__, __doc__, and __module__ 2015-10-15 10:46:33 +08:00
Mike Bayer 322f8f18f5 - exclude this from unpredictable gc 2015-10-11 12:44:29 -04:00
Mike Bayer affcfd1e52 - modernize some very old global-engine tests w/ bad teardowns 2015-10-11 12:26:45 -04:00
Mike Bayer e6779d8437 - repair flake8 issues 2015-10-11 12:08:53 -04:00
Mike Bayer 2a8a06e33a - repair laziness about setting time zone here, which is leaking
out depending on connection pool state
2015-10-11 12:00:39 -04:00
Mike Bayer 9d08c6abc2 - Added the :paramref:.AssociationProxy.info parameter to the
:class:`.AssociationProxy` constructor, to suit the
:attr:`.AssociationProxy.info` accessor that was added in
🎫`2971`.  This is possible because :class:`.AssociationProxy`
is constructed explicitly, unlike a hybrid which is constructed
implicitly via the decorator syntax.
fixes #3551
2015-10-09 18:01:43 -04:00
Mike Bayer 78a7bbdb3b Merge remote-tracking branch 'origin/pr/203' 2015-10-09 17:11:56 -04:00
Mike Bayer a47e863dc5 - this was supposed to be client-side SQL default not server side 2015-10-09 17:10:08 -04:00