Commit Graph

2307 Commits

Author SHA1 Message Date
Mike Bayer fa55225471 - Made a small adjustment to the mechanics of lazy loading,
such that it has less chance of interfering with a joinload() in the
very rare circumstance that an object points to itself; in this
scenario, the object refers to itself while loading its attributes
which can cause a mixup between loaders.   The use case of
"object points to itself" is not fully supported, but the fix also
removes some overhead so for now is part of testing.
fixes #3145
2014-08-28 17:57:48 -04:00
Mike Bayer 685a014c64 - A new implementation for :class:.KeyedTuple used by the
:class:`.Query` object offers dramatic speed improvements when
fetching large numbers of column-oriented rows.
fixes #3176
2014-08-28 12:25:21 -04:00
Mike Bayer 00862a29c6 - The behavior of :paramref:.joinedload.innerjoin as well as
:paramref:`.relationship.innerjoin` is now to use "nested"
inner joins, that is, right-nested, as the default behavior when an
inner join joined eager load is chained to an outer join eager load.
fixes #3008
2014-08-26 17:23:23 -04:00
Mike Bayer f44a4b6437 - updates to migration / changelog for 1.0 2014-08-26 14:44:50 -04:00
Mike Bayer 8e84942aa6 - changelog for pr bitbucket:28 2014-08-25 19:14:47 -04:00
Mike Bayer 4c1c9d5ed7 - changelog for pr bitbucket:27 2014-08-25 19:13:25 -04:00
Mike Bayer be2351481f - The "resurrect" ORM event has been removed. This event hook had
no purpose since the old "mutable attribute" system was removed
in 0.8.
fixes #3171
2014-08-25 17:00:21 -04:00
Mike Bayer b1aa0edf81 Merge branch 'pr129'
Conflicts:
	doc/build/changelog/changelog_10.rst
2014-08-23 15:21:54 -04:00
Mike Bayer b490534657 - pep8 formatting for pg table opts feature, tests
- add support for PG INHERITS
- fix mis-named tests
- changelog
fixes #2051
2014-08-23 15:21:16 -04:00
Gunnlaugur Þór Briem 42a65014f8 Add note on begin_nested requiring rollback/commit
Avoid confusion about rollback/commit "must be issued" after
``session.begin_nested()`` --- this might be taken to mean call must be
*added*, but that's only true if not using the return value as a context
manager.
2014-08-21 18:43:07 +00:00
Mike Bayer 71ca494f51 - The INSERT...FROM SELECT construct now implies `inline=True`
on :class:`.Insert`.  This helps to fix a bug where an
INSERT...FROM SELECT construct would inadvertently be compiled
as "implicit returning" on supporting backends, which would
cause breakage in the case of an INSERT that inserts zero rows
(as implicit returning expects a row), as well as arbitrary
return data in the case of an INSERT that inserts multiple
rows (e.g. only the first row of many).
A similar change is also applied to an INSERT..VALUES
with multiple parameter sets; implicit RETURNING will no longer emit
for this statement either.  As both of these constructs deal
with varible numbers of rows, the
:attr:`.ResultProxy.inserted_primary_key` accessor does not
apply.   Previously, there was a documentation note that one
may prefer ``inline=True`` with INSERT..FROM SELECT as some databases
don't support returning and therefore can't do "implicit" returning,
but there's no reason an INSERT...FROM SELECT needs implicit returning
in any case.   Regular explicit :meth:`.Insert.returning` should
be used to return variable numbers of result rows if inserted
data is needed.
fixes #3169
2014-08-20 20:14:20 -04:00
Mike Bayer d233bb3fc9 Merge branch 'master' into ticket_3100 2014-08-20 13:43:22 -04:00
Mike Bayer 92b0ad0fef - Fixed bug in connection pool logging where the "connection checked out"
debug logging message would not emit if the logging were set up using
``logging.setLevel()``, rather than using the ``echo_pool`` flag.
Tests to assert this logging have been added.  This is a
regression that was introduced in 0.9.0.
fixes #3168
2014-08-20 12:01:20 -04:00
Mike Bayer c65ed17bc1 Merge branch 'master' into ticket_3100
Conflicts:
	lib/sqlalchemy/orm/mapper.py
	lib/sqlalchemy/orm/persistence.py
2014-08-18 17:44:35 -04:00
Mike Bayer 530d3f07e0 - Fixed bug where attribute "set" events or columns with
``@validates`` would have events triggered within the flush process,
when those columns were the targets of a "fetch and populate"
operation, such as an autoincremented primary key, a Python side
default, or a server-side default "eagerly" fetched via RETURNING.
fixes #3167
2014-08-17 20:06:16 -04:00
Mike Bayer 589f205d53 - changelog for pullreq github:125
- add pg8000 version detection for the "sane multi rowcount" feature
2014-08-16 13:57:46 -04:00
Mike Bayer 591f2e4ed2 - change to be represented as two very fast bulk_insert() and bulk_update() methods 2014-08-15 15:53:38 -04:00
Mike Bayer 6bc676f56d dev 2014-08-15 15:53:12 -04:00
Mike Bayer 652a24f030 - The :class:.IdentityMap exposed from :class:.Session.identity
now returns lists for ``items()`` and ``values()`` in Py3K.
Early porting to Py3K here had these returning iterators, when
they technically should be "iterable views"..for now, lists are OK.
2014-08-15 15:13:13 -04:00
Mike Bayer bc509dd50d - UPDATE statements can now be batched within an ORM flush
into more performant executemany() call, similarly to how INSERT
statements can be batched; this will be invoked within flush
to the degree that subsequent UPDATE statements for the
same mapping and table involve the identical columns within the
VALUES clause, as well as that no VALUES-level SQL expressions
are embedded.
- some other inlinings within persistence.py
2014-08-14 20:47:49 -04:00
Mike Bayer 6a21f9e328 - The string keys that are used to determine the columns impacted
for an INSERT or UPDATE are now sorted when they contribute towards
the "compiled cache" cache key.   These keys were previously not
deterministically ordered, meaning the same statement could be
cached multiple times on equivalent keys, costing both in terms of
memory as well as performance.
fixes #3165
2014-08-14 20:00:35 -04:00
Mike Bayer 4a4cccfee5 - Removing (or adding) an event listener at the same time that the event
is being run itself, either from inside the listener or from a
concurrent thread, now raises a RuntimeError, as the collection used is
now an instance of ``colletions.deque()`` and does not support changes
while being iterated.  Previously, a plain Python list was used where
removal from inside the event itself would produce silent failures.
fixes #3163
2014-08-14 14:40:28 -04:00
Mike Bayer fe1a09029b on second thought we need to prioritize what really needs to be
here and what's just in changelog
2014-08-14 14:15:46 -04:00
Mike Bayer 6ca694610b - updates 2014-08-14 13:25:09 -04:00
Mike Bayer 7fc08fe89a - The `info` parameter has been added to the constructor for
:class:`.SynonymProperty` and :class:`.ComparableProperty`.
- The ``info`` parameter has been added as a constructor argument
to all schema constructs including :class:`.MetaData`,
:class:`.Index`, :class:`.ForeignKey`, :class:`.ForeignKeyConstraint`,
:class:`.UniqueConstraint`, :class:`.PrimaryKeyConstraint`,
:class:`.CheckConstraint`.

fixes #2963
2014-08-13 19:45:34 -04:00
Mike Bayer ea85c7053d - The :meth:.InspectionAttr.info collection is now moved down to
:class:`.InspectionAttr`, where in addition to being available
on all :class:`.MapperProperty` objects, it is also now available
on hybrid properties, association proxies, when accessed via
:attr:`.Mapper.all_orm_descriptors`.
fixes #2971
2014-08-13 19:20:44 -04:00
Mike Bayer 44d21de457 - rename _InspectionAttr to InspectionAttr 2014-08-13 18:47:52 -04:00
Mike Bayer 190961157d Merge branch 'pr126'
Conflicts:
	doc/build/changelog/changelog_10.rst
2014-08-13 17:50:50 -04:00
Mike Bayer f39767ad72 - public method name is get_enums()
- return a list of dicts like other methods do
- don't combine 'schema' with 'name', leave them separate
- support '*' argument so that we can retrieve cross-schema
if needed
- remove "conn" argument
- use bound parameters for 'schema' in SQL
- order by schema, name, label
- adapt _load_enums changes to column reflection
- changelog
- module docs for get_enums()
- add drop of enums to --dropfirst
2014-08-13 17:42:33 -04:00
Mike Bayer 2c9ff9115c - changelog, fixes #3027 2014-08-09 18:10:38 -04:00
Jack Zhou 9e621d18aa Added documentation about interaction between subqueryload and LIMIT/OFFSET. 2014-08-07 12:08:43 -07:00
Mike Bayer 3c6ff6adae -Fixed bug where Postgresql JSON type was not able to persist or
otherwise render a SQL NULL column value, rather than a JSON-encoded
``'null'``.  To support this case, changes are as follows:

* The value :func:`.null` can now be specified, which will always
  result in a NULL value resulting in the statement.

* A new parameter :paramref:`.JSON.none_as_null` is added, which
  when True indicates that the Python ``None`` value should be
  peristed as SQL NULL, rather than JSON-encoded ``'null'``.

Retrival of NULL as None is also repaired for DBAPIs other than
psycopg2, namely pg8000.

fixes #3159
2014-08-07 10:43:55 -04:00
Mike Bayer b35e6c69b7 - clarify docs that contains_eager() is included in the of_type() system,
fix #2438
2014-08-07 09:59:59 -04:00
Michael White 042131443f fix typo in cascade documentation 2014-08-05 22:47:40 -04:00
Mike Bayer 7c80e521f0 - Fixed bug in CTE where `literal_binds` compiler argument would not
be always be correctly propagated when one CTE referred to another
aliased CTE in a statement.
Fixes #3154
2014-08-02 14:42:57 -04:00
Mike Bayer 32165f5020 - update the literal binds section 2014-07-30 16:08:33 -04:00
Mike Bayer 83326bf44c - The exception wrapping system for DBAPI errors can now accommodate
non-standard DBAPI exceptions, such as the psycopg2
TransactionRollbackError.  These exceptions will now be raised
using the closest available subclass in ``sqlalchemy.exc``, in the
case of TransactionRollbackError, ``sqlalchemy.exc.OperationalError``.
fixes #3075
2014-07-29 14:06:43 -04:00
Mike Bayer 405c223ae5 - Fixed 0.9.7 regression caused by 🎫3067 in conjunction with
a mis-named unit test such that so-called "schema" types like
:class:`.Boolean` and :class:`.Enum` could no longer be pickled.
fixes #3144
2014-07-29 13:32:05 -04:00
Mike Bayer d92177cede - Fixed bug in :class:.postgresql.array object where comparison
to a plain Python list would fail to use the correct array constructor.
Pull request courtesy Andrew.  fixes #3141
2014-07-25 16:08:21 -04:00
Mike Bayer 6b60d3a9e6 - The MySQL dialect will now disable :meth:.ConnectionEvents.handle_error
events from firing for those statements which it uses internally
to detect if a table exists or not.   This is achieved using an
execution option ``skip_user_error_events`` that disables the handle
error event for the scope of that execution.   In this way, user code
that rewrites exceptions doesn't need to worry about the MySQL
dialect or other dialects that occasionally need to catch
SQLAlchemy specific exceptions.
2014-07-25 12:14:22 -04:00
Mike Bayer 0df977ccad - Added a supported :meth:.FunctionElement.alias method to functions,
e.g. the ``func`` construct.  Previously, behavior for this method
was undefined.  The current behavior mimics that of pre-0.9.4,
which is that the function is turned into a single-column FROM
clause with the given alias name, where the column itself is
anonymously named.
fixes #3137
2014-07-24 14:33:50 -04:00
Mike Bayer 07c01b77f1 merge 0.9.8 start 2014-07-24 14:04:23 -04:00
Mike Bayer f2b267043e forwards port 0.9 changelog update 2014-07-22 17:12:17 -04:00
Mike Bayer bcfe30a238 - forwards port 0.8 changelog update 2014-07-22 17:10:33 -04:00
Mike Bayer 15b0cf56ff - missing 0.8 change forwards port 2014-07-22 16:53:46 -04:00
Mike Bayer dba17c8ca6 spelling 2014-07-22 16:36:59 -04:00
Mike Bayer 23f3621d01 - ticket inline 2014-07-22 16:25:58 -04:00
Mike Bayer 63c6aa0104 - update some SQL server tests, support
- add support for IDENTITY INSERT setting for INSERT with inline VALUES
2014-07-22 13:42:38 -04:00
Mike Bayer b7021b698d - fix missing release date 2014-07-21 17:25:13 -04:00
Mike Bayer c02e95ed33 - Fixed bug introduced in 0.9.5 by new pg8000 isolation level feature
where engine-level isolation level parameter would raise an error
on connect. fixes #3134
2014-07-21 11:58:44 -04:00