Commit Graph

6784 Commits

Author SHA1 Message Date
Mike Bayer c19ea20875 Merge remote-tracking branch 'origin/pr/164' into pr164 2015-04-03 17:48:19 -04:00
Mike Bayer 359f471a12 - Fixed bug where the state tracking within multiple, nested
:meth:`.Session.begin_nested` operations would fail to propagate
the "dirty" flag for an object that had been updated within
the inner savepoint, such that if the enclosing savepoint were
rolled back, the object would not be part of the state that was
expired and therefore reverted to its database state.
fixes #3352
2015-04-02 12:19:15 -04:00
Mike Bayer fe19227641 - :class:.Query doesn't support joins, subselects, or special
FROM clauses when using the :meth:`.Query.update` or
:meth:`.Query.delete` methods; instead of silently ignoring these
fields if methods like :meth:`.Query.join` or
:meth:`.Query.select_from` has been called, an error is raised.
In 0.9.10 this only emits a warning.
fixes #3349
- don't needlessly call _compile_context() and build up a
whole statement that we never need.  Construct QueryContext
as it's part of the event contract, but don't actually call upon
mapper attributes; use more direct systems of determining the
update or delete table.
- don't realy need _no_select_modifiers anymore
2015-04-01 19:37:43 -04:00
Mike Bayer 59816435da - Added a list() call around a weak dictionary used within the
commit phase of the session, which without it could cause
a "dictionary changed size during iter" error if garbage collection
interacted within the process.   Change was introduced by
2015-04-01 16:55:58 -04:00
Mike Bayer 4b16493548 - Fixed bug where updated PG index reflection as a result of
🎫`3184` would cause index operations to fail on Postgresql
versions 8.4 and earlier.  The enhancements are now
disabled when using an older version of Postgresql.
fixes #3343
2015-04-01 16:50:32 -04:00
Mike Bayer 5ed49f38c3 - The warning emitted by the unicode type for a non-unicode type
has been liberalized to warn for values that aren't even string
values, such as integers; previously, the updated warning system
of 1.0 made use of string formatting operations which
would raise an internal TypeError.   While these cases should ideally
raise totally, some backends like SQLite and MySQL do accept them
and are potentially in use by legacy code, not to mention that they
will always pass through if unicode conversion is turned off
for the target backend.
fixes #3346
2015-03-31 15:10:42 -04:00
Mike Bayer dedc85ba9d - further fixes for #3347; track the mappers we're joining
between fully and match on those, rather than trying to
compare selectables; fixes #3347
2015-03-31 13:29:10 -04:00
Mike Bayer 1a56177c21 - Fixed a bug related to "nested" inner join eager loading, which
exists in 0.9 as well but is more of a regression in 1.0 due to
🎫`3008` which turns on "nested" by default, such that
a joined eager load that travels across sibling paths from a common
ancestor using innerjoin=True will correctly splice each "innerjoin"
sibling into the appropriate part of the join, when a series of
inner/outer joins are mixed together.
fixes #3347
2015-03-30 17:49:39 -04:00
Mike Bayer a15b2ac0a1 call this 1.0.0b5 for the moment 2015-03-30 17:15:48 -04:00
Ernest Walzel a518b31f3b Fix typos
agaisnt -> against
'a Alias' -> 'an Alias'
2015-03-26 18:28:11 +00:00
Mike Bayer 4c17337da6 - fix this for pg8000 of all backends... 2015-03-24 17:11:22 -04:00
Mike Bayer 50b7e818c2 - also add this to Oracle, and defensively to firebird and sybase 2015-03-24 12:35:30 -04:00
Mike Bayer 86cebccc4c - Turned off the "simple order by" flag on the MSSQL dialect; this
is the flag that per 🎫`2992` causes an order by or group by
an expression that's also in the columns clause to be copied by
label, even if referenced as the expression object.   The behavior
for MSSQL is now the old behavior that copies the whole expression
in by default, as MSSQL can be picky on these particularly in
GROUP BY expressions.
fixes #3338
- Add a test that includes a composed label in a GROUP BY
2015-03-24 12:28:19 -04:00
Mike Bayer bdcaa0f6ca - The "auto-attach" feature of constraints such as :class:.UniqueConstraint
and :class:`.CheckConstraint` has been further enhanced such that
when the constraint is associated with non-table-bound :class:`.Column`
objects, the constraint will set up event listeners with the
columns themselves such that the constraint auto attaches at the
same time the columns are associated with the table.  This in particular
helps in some edge cases in declarative but is also of general use.
fixes #3341
2015-03-24 10:55:29 -04:00
Mike Bayer 04545727d4 - Fixed bug in new "label resolution" feature of 🎫2992 where
a label that was anonymous, then labeled again with a name, would
fail to be locatable via a textual label.  This situation occurs
naturally when a mapped :func:`.column_property` is given an
explicit label in a query.
fixes #3340
2015-03-23 12:33:48 -04:00
Mike Bayer db853306c4 - Fixed unicode support for PyMySQL when using an "executemany"
operation with unicode parameters.  SQLAlchemy now passes both
the statement as well as the bound parameters as unicode
objects, as PyMySQL generally uses string interpolation
internally to produce the final statement, and in the case of
executemany does the "encode" step only on the final statement.
fixes #3337
2015-03-22 19:25:13 -04:00
Mike Bayer ddab2d2351 - more updates to the unicode mess to frame this in
as up-to-date recommendations as possible
2015-03-22 19:25:10 -04:00
Mike Bayer b1146821aa some doc defenses 2015-03-21 15:18:36 -04:00
Mike Bayer c09c21c9f3 - Fixed bug in new "label resolution" feature of 🎫2992 where
the string label placed in the order_by() or group_by() of a statement
would place higher priority on the name as found
inside the FROM clause instead of a more locally available name
inside the columns clause.
fixes #3335
2015-03-21 13:12:15 -04:00
Mike Bayer 3ae00fea90 - Repaired the commit for issue #2771 which was inadvertently commented
out.
- add __backend__ to the dialect suite so that it runs on CI.
- will be 1.0.0b3
2015-03-20 19:53:12 -04:00
Amir Sadoughi 3365a4f78e Allow kwargs to be passed through update()
This is useful to be able to pass in mysql_limit=1 from using the
ORM.
2015-03-20 17:04:29 -05:00
Mike Bayer 824e901379 Merge branch 'mysqlclient' of https://bitbucket.org/methane/sqlalchemy into pr48
Conflicts:
	lib/sqlalchemy/dialects/mysql/mysqldb.py
2015-03-20 15:17:07 -04:00
Mike Bayer ffddfe1b17 - add a note that we aren't really doing zxjdbc right now even though
these files are present.
2015-03-20 15:10:52 -04:00
Mike Bayer 3971690731 - reorganize MySQL docs re: unicode, other cleanup and updates 2015-03-20 15:08:35 -04:00
Mike Bayer 834973092c Merge branch 'support-emoji-on-mysql' of https://bitbucket.org/graingert/sqlalchemy into pr49 2015-03-20 12:07:00 -04:00
Mike Bayer 1d7ce71d24 Merge remote-tracking branch 'origin/pr/158' into pr158 2015-03-20 11:19:35 -04:00
Mike Bayer cd076470ba - Loosened some restrictions that were added to `@declared_attr`
objects, such that they were prevented from being called outside
of the declarative process; this is related to the enhancements
of #3150 which allow ``@declared_attr`` to return a value that is
cached based on the current class as it's being configured.
The exception raise has been removed, and the behavior changed
so that outside of the declarative process, the function decorated by
``@declared_attr`` is called every time just like a regular
``@property``, without using any caching, as none is available
at this stage.
fixes #3331
2015-03-18 18:57:13 -04:00
Thomas Grainger 6e8ecd161b add utf8mb4 recommendation 2015-03-18 11:47:17 +00:00
Thomas Grainger 5794b777cb map MySQL encodings to python encodings fixes #2771 2015-03-18 11:45:24 +00:00
Mike Bayer d6a6cbaf99 b2 now 2015-03-17 13:53:36 -04:00
Mike Bayer b7e151ac5c - The "auto close" for :class:.ResultProxy is now a "soft" close.
That is, after exhausing all rows using the fetch methods, the
DBAPI cursor is released as before and the object may be safely
discarded, but the fetch methods may continue to be called for which
they will return an end-of-result object (None for fetchone, empty list
for fetchmany and fetchall).   Only if :meth:`.ResultProxy.close`
is called explicitly will these methods raise the "result is closed"
error.
fixes #3330 fixes #3329
2015-03-17 12:32:33 -04:00
Julien Castets edfe2deffb Accept unicode in CascadeOptions 2015-03-16 16:23:14 +01:00
Mike Bayer 3f23e65dab - remove now-misleading comment that SQLite doesn't support MATCH,
since they've apparently added something for it
2015-03-14 10:17:12 -04:00
INADA Naoki 69dadc88e0 Add mention about mysqlclient 2015-03-14 05:35:11 +09:00
Mike Bayer 64b7a50cbd - call this 1.0.0b1 2015-03-13 16:23:12 -04:00
Mike Bayer 4077e99f3f - tweaks regarding the use_alter update 2015-03-13 16:22:01 -04:00
Mike Bayer a54b783c49 - ensure as_declarative is part of __all__ here 2015-03-12 16:23:43 -04:00
Mike Bayer dcbedfd61a - fix a get call here, we should figure this out since we dont want
to be using getattr
2015-03-12 13:34:43 -04:00
Mike Bayer f211ad254d - try to document how to get columns from constraints.
unfortunately Sphinx refuses to work correctly for the columns
attribute so we just add a lame message to contains_column().
2015-03-12 10:14:52 -04:00
Mike Bayer e3b46bd624 - Added a new extension suite :mod:sqlalchemy.ext.baked. This
simple but unusual system allows for a dramatic savings in Python
overhead for the construction and processing of orm :class:`.Query`
objects, from query construction up through rendering of a string
SQL statement.
fixes #3054
2015-03-11 20:31:11 -04:00
Mike Bayer b815e94833 - Added a new entry `"entity"` to the dictionaries returned by
:attr:`.Query.column_descriptions`.  This refers to the primary ORM
mapped class or aliased class that is referred to by the expression.
Compared to the existing entry for ``"type"``, it will always be
a mapped entity, even if extracted from a column expression, or
None if the given expression is a pure core expression.
references #3320
2015-03-11 14:46:52 -04:00
Mike Bayer 71b8df2e53 - The Postgresql :class:.postgresql.ENUM type will emit a
DROP TYPE instruction when a plain ``table.drop()`` is called,
assuming the object is not associated directly with a
:class:`.MetaData` object.   In order to accomodate the use case of
an enumerated type shared between multiple tables, the type should
be associated directly with the :class:`.MetaData` object; in this
case the type will only be created at the metadata level, or if
created directly.  The rules for create/drop of
Postgresql enumerated types have been highly reworked in general.
fixes #3319
2015-03-11 11:41:52 -04:00
Mike Bayer 710021d22e - Added a new event suite :class:.QueryEvents. The
:meth:`.QueryEvents.before_compile` event allows the creation
of functions which may place additional modifications to
:class:`.Query` objects before the construction of the SELECT
statement.   It is hoped that this event be made much more
useful via the advent of a new inspection system that will
allow for detailed modifications to be made against
:class:`.Query` objects in an automated fashion.
fixes #3317
2015-03-10 19:56:59 -04:00
Mike Bayer 201ba16fc8 - The subquery wrapping which occurs when joined eager loading
is used with a one-to-many query that also features LIMIT,
OFFSET, or DISTINCT has been disabled in the case of a one-to-one
relationship, that is a one-to-many with
:paramref:`.relationship.uselist` set to False.  This will produce
more efficient queries in these cases.
fixes #3249
2015-03-10 18:23:23 -04:00
Mike Bayer 66fa5b50a5 - Fixed bug where the session attachment error "object is already
attached to session X" would fail to prevent the object from
also being attached to the new session, in the case that execution
continued after the error raise occurred.
fixes #3301
2015-03-10 17:51:35 -04:00
Mike Bayer 95e53d0b60 - Fixed bug where using an `__abstract__` mixin in the middle
of a declarative inheritance hierarchy would prevent attributes
and configuration being correctly propagated from the base class
to the inheriting class.
fixes #3219 fixes #3240
2015-03-10 17:21:46 -04:00
Mike Bayer a4a826021f - keep this as 100 2015-03-10 16:57:48 -04:00
Mike Bayer 50866d2f85 - copyright 2015 2015-03-10 15:24:28 -04:00
Mike Bayer ff846286f2 - repair doclevel 2015-03-10 15:16:02 -04:00
Mike Bayer 5d1206c10a - changelog and docs for pullreq bitbucket:45 2015-03-10 15:05:27 -04:00