Commit Graph

10240 Commits

Author SHA1 Message Date
Mike Bayer dfb5707dae - rework the entire approach to #3076. As we need to catch all exceptions
in all cases unconditionally, the number of use cases that go beyond what
dbapi_error() is expecting has gone too far for an 0.9 release.
Additionally, the number of things we'd like to track is really a lot
more than the five arguments here, and ExecutionContext is really not
suitable as totally public API for this.   So restore dbapi_error
to its old version, deprecate, and build out handle_error instead.
This is a lot more extensible and doesn't get in the way of anything
compatibility-wise.
2014-07-04 15:40:47 -04:00
Mike Bayer c60eb86a91 - Added new attributes :attr:.ExecutionContext.exception and
:attr:`.ExecutionContext.is_disconnect` which are meaningful within
the :meth:`.ConnectionEvents.dbapi_error` handler to see both the
original DBAPI error as well as whether or not it represents
a disconnect.
2014-07-03 21:49:37 -04:00
Mike Bayer e0a9b94abb - The mechanics of the :meth:.ConnectionEvents.dbapi_error handler
have been enhanced such that the function handler is now capable
of raising or returning a new exception object, which will replace
the exception normally being thrown by SQLAlchemy.
fixes #3076
2014-07-03 17:30:49 -04:00
Mike Bayer 3e4286079c - add link to dialect docs for SQLite autoincrement from column autoincrement,
fixes #3110
2014-07-03 11:34:51 -04:00
Mike Bayer 2ef224a5ba - ensure ACID set up on this table for MySQL 2014-07-01 15:28:16 -04:00
Mike Bayer 427ee3a61e - Fixed bug where items that were persisted, deleted, or had a
primary key change within a savepoint block would not
participate in being restored to their former state (not in
session, in session, previous PK) after the outer transaction
were rolled back. fixes #3108
2014-07-01 12:12:51 -04:00
Damian Dimmich ceeee81017 jsonb support for <@, ?| and ?& added.
need to see if equality already works.
2014-07-01 13:24:30 +04:00
Mike Bayer 2d8d1dcf60 - repair the _enable_single_crit method, it was named the same
as the attribute and probably just replaced itself, so that is
now _set_enable_single_crit
- as a side effect of the main issue fixed here, correct the case in
adjust_for_single_inheritance where the same mapper appears more
than once in mapper_adapter_map; run through a set() for uniqueness.
- Fixed bug in subquery eager loading in conjunction with
:func:`.with_polymorphic`, the targeting of entities and columns
in the subquery load has been made more accurate with respect
to this type of entity and others. Fixes #3106
2014-06-30 20:25:04 -04:00
Mike Bayer 4b6d6d5f80 - add new section Working with Raw DBAPI Connections, fixes #2218. 2014-06-30 11:08:05 -04:00
Mike Bayer 992e06412c - attach the ResultMetaData to the Compiled object, when we detect that
the compiled cache is used.  That allows us to cache the whole metadata
and save on creating it at result time, when compiled cache is used.
2014-06-29 00:10:59 -04:00
Mike Bayer 3be078425f - cut out some calls by inlining the calls to get_history() 2014-06-28 23:34:05 -04:00
Damian Dimmich 7f402761d9 it's OK to pass a dict in - it does the right thing, no need to quote it
in the tests.
2014-06-28 23:24:36 +04:00
Damian Dimmich 4eca136e09 minor cleanup of the jsonb - had extraneous operators that where copied
from hstore that don't apply.

Add tests for ? and @> operators.
2014-06-28 23:11:03 +04:00
Damian Dimmich 4e5fcee975 add has_key & contains operators for jsonb (ported over from hstore) 2014-06-28 22:47:20 +04:00
Damian Dimmich f509260202 and tests for JSONB - as this is a superset of JSON i've subclassed
the JSON tests as all of these should be applicable as well.
2014-06-28 20:02:24 +04:00
Priit Laes 68a72ee0c4 typo: s/thbe/the 2014-06-28 12:47:19 +03:00
Priit Laes eb5f398a01 typo: s/tranasction/transaction 2014-06-28 12:46:46 +03:00
Priit Laes 8c33709985 typo: s/founds/found 2014-06-28 12:45:50 +03:00
Mike Bayer 01215cdaef - Fixed a bug within the custom operator plus :meth:.TypeEngine.with_variant
system, whereby using a :class:`.TypeDecorator` in conjunction with
variant would fail with an MRO error when a comparison operator was used.
fixes #3102
2014-06-27 16:08:42 -04:00
Mike Bayer 3d7cd1741b wrong version number 2014-06-27 16:07:05 -04:00
Mike Bayer 3ea154fbf5 - MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes #3101
2014-06-27 15:52:40 -04:00
Mike Bayer f2cf62090c - Fixed bug involving dynamic attributes, that was again a regression
of 🎫`3060` from verision 0.9.5.  A self-referential relationship
with lazy='dynamic' would raise a TypeError within a flush operation.
fixes #3099
2014-06-26 14:58:42 -04:00
Mike Bayer feda84e5b2 add missing release date 2014-06-25 14:31:18 -04:00
Mike Bayer ca58fa5d93 - Fixed bug when the declarative `__abstract__` flag was not being
distinguished for when it was actually the value ``False``.
The ``__abstract__`` flag needs to acutally evaluate to a True
value at the level being tested.
fixes #3097
2014-06-25 14:30:25 -04:00
Mike Bayer 89a6e34803 - add a test to confirm #3096, we definitely get a timedelta 2014-06-25 14:23:27 -04:00
Mike Bayer 725ed1b29f Merged in uralbash/sqlalchemy/uralbash/fix-pullreq-link-in-changelog_09rst-edit-1403586718274 (pull request #23)
fix pullreq link in changelog_09.rst edited online with Bitbucket
2014-06-24 12:27:01 -04:00
Mike Bayer 02b0af4f7c - write some really complete docs on MSSQL autoincrement, fixes #3094 2014-06-24 12:25:28 -04:00
Thomas Herve e36fb9e87c Return the assigned value in MultableDict.setdefault 2014-06-24 09:55:53 +02:00
Damian Dimmich 01cc8fbacc initial support for JSONB - this only allows you to define the JSONB
datatype - this does not add any of the additional support for
querying/indexing yet.
2014-06-24 11:23:21 +04:00
uralbash 3be189e5d1 fix pullreq link in changelog_09.rst edited online with Bitbucket 2014-06-24 05:12:14 +00:00
Mike Bayer f10eb28d90 - reverse course in #3061 so that we instead no longer set None in the attribute
when we do a get; we return the None as always but we leave the dict blank
and the loader callable still in place.  The case for this implicit get on a pending object is not
super common and there really should be no change in state at all when this
operation proceeds.   This change is more dramatic as it reverses
a behavior SQLA has had since the first release.
fixes #3061
2014-06-23 19:50:23 -04:00
Mike Bayer 7e7447db1f - Reverted the change for 🎫3060 - this is a unit of work
fix that is updated more comprehensively in 1.0 via 🎫`3061`.
The fix in 🎫`3060` unfortunately produces a new issue whereby
an eager load of a many-to-one attribute can produce an event
that is interpreted into an attribute change.
2014-06-23 18:42:54 -04:00
Tony Locke fe66ddb572 PEP8 tidy of test/sql/test_types.py 2014-06-23 22:34:01 +01:00
Tony Locke a88169c501 pg8000 passing test/sql/test_types.py
Opened up two tests that now pass with pg8000. Also, rewrote two tests
to use actual tables rather than having a round trip in a single select
statement. This is necessary for pg8000 because it sends strings to the
server with type 'unknown' and lets the server work out the type.
2014-06-23 20:45:16 +01:00
Mike Bayer ea54b635d6 0.9.5 released date 2014-06-23 11:30:36 -04:00
Mike Bayer 179a3551bd fix changelog 2014-06-23 11:12:47 -04:00
Mike Bayer 20e64ad6b8 - use new Or() directive to test for both SQL variants here, which can vary
based on hash ordering of the ClassManager
2014-06-21 20:27:19 -04:00
Mike Bayer 650403ee64 - fix test failures 2014-06-21 18:11:04 -04:00
Mike Bayer a1bbf3a005 - Additional checks have been added for the case where an inheriting
mapper is implicitly combining one of its column-based attributes
with that of the parent, where those columns normally don't necessarily
share the same value.  This is an extension of an existing check that
was added via 🎫`1892`; however this new check emits only a
warning, instead of an exception, to allow for applications that may
be relying upon the existing behavior.
fixes #3042
2014-06-20 18:47:28 -04:00
Mike Bayer d7f467fcd5 additional version notes 2014-06-20 18:06:15 -04:00
Mike Bayer 018ac859dc add missing version markers 2014-06-20 18:04:26 -04:00
Mike Bayer bd56485f4c - The :paramref:.Column.nullable flag is implicitly set to `False`
when that :class:`.Column` is referred to in an explicit
:class:`.PrimaryKeyConstraint` for that table.  This behavior now
matches that of when the :class:`.Column` itself has the
:paramref:`.Column.primary_key` flag set to ``True``, which is
intended to be an exactly equivalent case.
fixes #3023
2014-06-20 18:03:28 -04:00
Mike Bayer 42bbb7163a - Added a new type :class:.postgresql.OID to the Postgresql dialect.
While "oid" is generally a private type within PG that is not exposed
in modern versions, there are some PG use cases such as large object
support where these types might be exposed, as well as within some
user-reported schema reflection use cases.
fixes #3002
2014-06-20 17:58:06 -04:00
Mike Bayer a46932422b - Fixed bug where column names added to `mysql_length` parameter
on an index needed to have the same quoting for quoted names in
order to be recognized.  The fix makes the quotes optional but
also provides the old behavior for backwards compatibility with those
using the workaround.
fixes #3085
2014-06-18 10:56:23 -04:00
Albert Cervin ed20c151cb - Fixed support for multivalue inserts for MS SQL 2008 since it is actually supported. 2014-06-16 11:13:18 +02:00
Mike Bayer 33cb84945f - Modified the behavior of :func:.orm.load_only such that primary key
columns are always added to the list of columns to be "undeferred";
otherwise, the ORM can't load the row's identity.   Apparently,
one can defer the mapped primary keys and the ORM will fail, that
hasn't been changed.  But as load_only is essentially saying
"defer all but X", it's more critical that PK cols not be part of this
deferral. fixes #3080
2014-06-12 11:47:50 -04:00
Mike Bayer bd9c325852 - changelog 2014-06-08 18:03:07 -04:00
Mike Bayer cbd2103087 Merged in univerio/sqlalchemy/materialized_paths (pull request #21)
Materialized paths example
2014-06-08 18:01:46 -04:00
BY-jk 8b105cd5e4 Update compiler.py
Moved initialization into else block
Conflicts:
	lib/sqlalchemy/sql/compiler.py
2014-06-08 17:57:18 -04:00
Mike Bayer 15bfeb48cb changelog 2014-06-08 17:54:48 -04:00