Mike Bayer [Thu, 1 Oct 2015 13:37:53 +0000 (09:37 -0400)]
- remove ambiguous use of the phrase "joined together by AND" as this
may be construed as the Python "and" keyword
- add notes to ORM tutorial for beginners that Python "and" keyword
is not to be used
fixes #3545
Docs: use the base layout when mako_layout=='epub'
- https://readthedocs.org/projects/sqlalchemy/downloads/epub/latest/ renders with the full template which is unreadable on e-readers
- in the makefile the template-variable mako_layout is set for target: epub which makes mako use only the base layout.
- this is the more elegant solution as proposed to #133
Mike Bayer [Mon, 14 Jul 2014 23:02:20 +0000 (19:02 -0400)]
- Added statement encoding to the "SET IDENTITY_INSERT"
statements which operate when an explicit INSERT is being
interjected into an IDENTITY column, to support non-ascii table
identifiers on drivers such as pyodbc + unix + py2k that don't
support unicode statements.
ref #3091 as this fix is also in that issue's patch, but is
a different issue.
Mike Bayer [Mon, 14 Jul 2014 22:54:23 +0000 (18:54 -0400)]
- In the SQL Server pyodbc dialect, repaired the implementation
for the ``description_encoding`` dialect parameter, which when
not explicitly set was preventing cursor.description from
being parsed correctly in the case of result sets that
contained names in alternate encodings. This parameter
shouldn't be needed going forward.
fixes #3091
Mike Bayer [Sun, 13 Jul 2014 22:55:18 +0000 (18:55 -0400)]
- Fixed bug in :class:`.Enum` and other :class:`.SchemaType`
subclasses where direct association of the type with a
:class:`.MetaData` would lead to a hang when events
(like create events) were emitted on the :class:`.MetaData`.
fixes #3124
Mike Bayer [Fri, 27 Jun 2014 20:08:42 +0000 (16:08 -0400)]
- 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
Mike Bayer [Fri, 27 Jun 2014 19:52:40 +0000 (15:52 -0400)]
- 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
Mike Bayer [Wed, 18 Jun 2014 14:56:23 +0000 (10:56 -0400)]
- 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
Mike Bayer [Fri, 30 May 2014 19:36:13 +0000 (15:36 -0400)]
- The ``__mapper_args__`` dictionary is copied from a declarative
mixin or abstract class when accessed, so that modifications made
to this dictionary by declarative itself won't conflict with that
of other mappings. The dictionary is modified regarding the
``version_id_col`` and ``polymorphic_on`` arguments, replacing the
column within with the one that is officially mapped to the local
class/table. fixes #3062
Mike Bayer [Thu, 29 May 2014 16:28:19 +0000 (12:28 -0400)]
- disable the scrolling layout, anchors for code/params are not working,
and the current approach used for sections is not able to work for fine-grained
anchors like these, another approach needs to be taken.
Mike Bayer [Wed, 28 May 2014 14:56:52 +0000 (10:56 -0400)]
- a rework of doc layout and nav:
- reduce the real estate for the top nav; move the search box
into the top yellow box, close in space
- use a new CSS/js approach such that the top toolbar freezes from
scrolling at the top of the page. The left nav scrolls independently
of the content pane so that the local contents remain visible regardless
of scrolling. this approach is disabled on mobile where the dual scrollbars
may be cumbersome (overall the site is not well designed for mobile).
Mike Bayer [Sun, 25 May 2014 17:58:08 +0000 (13:58 -0400)]
- Added the ``hashable=False`` flag to the PG :class:`.HSTORE` type, which
is needed to allow the ORM to skip over trying to "hash" an ORM-mapped
HSTORE column when requesting it in a mixed column/entity list.
Patch courtesy Gunnlaugur Þór Briem. Fixes #3053
Mike Bayer [Sun, 25 May 2014 17:45:32 +0000 (13:45 -0400)]
- Fixed bug in subquery eager loading where a long chain of
eager loads across a polymorphic-subclass boundary in conjunction
with polymorphic loading would fail to locate the subclass-link in the
chain, erroring out with a missing property name on an
:class:`.AliasedClass`. fixes #3055
- adjust the test from 1.0/0.9 to not use chained eager load style
Mike Bayer [Sat, 24 May 2014 13:54:20 +0000 (09:54 -0400)]
- hyperlink all the column operators listed in the ORM tutorial common filter operators section
- add language to MATCH explicitly stating this operator varies by backend and is not available
on SQLite, as the tutorial defaults to SQLite to start with, fix #3059
- on the actual match() documentation fix this up to be more accurate, list some example renderings
for different backends. again mention SQLite not supported
Mike Bayer [Fri, 16 May 2014 15:53:12 +0000 (11:53 -0400)]
- add lots more to the profiling section
- add the query profiling recipe, fix it with a stack as we now nest those
calls occasionally
- tabs to spaces
Matthias Urlichs [Sun, 11 May 2014 14:49:56 +0000 (16:49 +0200)]
Documentation fix-up: "its" vs. "it's"
Removed ungrammatical apostrophes from documentation, replacing
"it's" with "its" where appropriate (but in a few cases with "it is"
when that read better).
While doing that, I also fixed a couple of minor typos etc.
as I noticed them.
Mike Bayer [Sun, 11 May 2014 03:26:09 +0000 (23:26 -0400)]
- Fixed ORM bug where the :func:`.class_mapper` function would mask
AttributeErrors or KeyErrors that should raise during mapper
configuration due to user errors. The catch for attribute/keyerror
has been made more specific to not include the configuration step.
fixes #3047
Mike Bayer [Fri, 9 May 2014 02:44:06 +0000 (22:44 -0400)]
- Fixed bug where :meth:`.Table.update` and :meth:`.Table.delete`
would produce an empty WHERE clause when an empty :func:`.and_()`
or :func:`.or_()` or other blank expression were applied. This is
now consistent with that of :func:`.select`.
fixes #3045
Mike Bayer [Fri, 11 Apr 2014 19:42:36 +0000 (15:42 -0400)]
- Added a new "disconnect" message "connection has been closed unexpectedly".
This appears to be related to newer versions of SSL.
Pull request courtesy Antti Haapala.
Mike Bayer [Wed, 2 Apr 2014 22:11:11 +0000 (18:11 -0400)]
- reverse order of columns in sample CTEs as this is a UNION and the cols need to line up
- alter this in the unit tests as well as these queries were just copied from the tests
- remove the included_parts.join(parts) from the core CTE doc (also just copied from the
test, where we want to make sure joins don't get screwed up with the CTE) as it doesn't
contribute to the query itself
fixes #3014
Mike Bayer [Fri, 28 Mar 2014 21:42:55 +0000 (17:42 -0400)]
- revert part of c01558ae7f4a for now as we also test that a DELETE of two rows
where one is to be deleted from ON DELETE CASCADE succeeds; the check here makes that fail.
We will need to add an option to enable/disable this check per mapping, will likely
do this in next version
Mike Bayer [Fri, 28 Mar 2014 20:32:11 +0000 (16:32 -0400)]
- Fixed ORM bug where changing the primary key of an object, then marking
it for DELETE would fail to target the correct row for DELETE.
Then to compound matters, basic "number of rows matched" checks were
not being performed. Both issues are fixed, however note that the
"rows matched" check requires so-called "sane multi-row count"
functionality; the DBAPI's executemany() method must count up the
rows matched by individual statements and SQLAlchemy's dialect must
mark this feature as supported, currently applies to some mysql dialects,
psycopg2, sqlite only. fixes #3006
- Enabled "sane multi-row count" checking for the psycopg2 DBAPI, as
this seems to be supported as of psycopg2 2.0.9.
Mike Bayer [Tue, 25 Mar 2014 16:26:42 +0000 (12:26 -0400)]
- Fixed regression caused by release 0.8.5 / 0.9.3's compatibility
enhancements where index reflection on Postgresql versions specific
to only the 8.1, 8.2 series again
broke, surrounding the ever problematic int2vector type. While
int2vector supports array operations as of 8.1, apparently it only
supports CAST to a varchar as of 8.3.
fix #3000
Mike Bayer [Sat, 22 Mar 2014 23:55:00 +0000 (19:55 -0400)]
- Fixed regression from 0.8.3 as a result of :ticket:`2818`
where :meth:`.Query.exists` wouldn't work on a query that only
had a :meth:`.Query.select_from` entry but no other entities.
re: #2818 fixes #2995
Mike Bayer [Sat, 22 Mar 2014 21:31:50 +0000 (17:31 -0400)]
- Adjusted ``setup.py`` file to support the possible future
removal of the ``setuptools.Feature`` extension from setuptools.
If this keyword isn't present, the setup will still succeed
with setuptools rather than falling back to distutils. C extension
building can be disabled now also by setting the
DISABLE_SQLALCHEMY_CEXT environment variable. This variable works
whether or not setuptools is even available. fixes #2986
- using platform.python_implementation() in setup.py to detect CPython.
I've tested this function on OSX and linux on Python 2.6 through 3.4,
including 3.1, 3.2, 3.3.
Unfortunately, on OSX + 3.2 only, it seems to segfault. I've tried
installing 3.2.5 from the python.org .dmg, building it from source,
and also blew away the whole 3.2 directory, something seems to be wrong
with the "platform" module on that platform only, and there's also no
issue on bugs.python.org; however, I'm going with
it anyway. If someone is using 3.2 on OSX they really should be upgrading.
- adjusted the logic for platform_implementation(), apparently "platform"
is there in python 2.5, so we are doing a version check.
Conflicts:
doc/build/intro.rst
setup.py
Mike Bayer [Fri, 21 Mar 2014 02:46:23 +0000 (22:46 -0400)]
- reword the paragraph which talks about web framework integration for sessions:
1. fix the typo in the paragraph, fixes #2998
2. as zope-sqlalchemy only provides transaction integration and not session scoping,
dial back the language here as people are probably using scoped_session with pyramid anyway
3. as I'm going to again start recommending people don't cling to flask-sqlalchemy so hard,
take out the word "strongly" from the recommendation.
4. as flask is the only framework I can think of that actually has an explicit SQLAlchemy
layer that handles setting up scoped_session, take out the word "most", now it's "some web frameworks"
(by which it means "only flask...and flask-sqlalchemy is probably not worth using anyway")
Mike Bayer [Wed, 19 Mar 2014 15:09:38 +0000 (11:09 -0400)]
- Fixed bug in mutable extension as well as
:func:`.attributes.flag_modified` where the change event would not be
propagated if the attribute had been reassigned to itself.
fixes #2997
Mike Bayer [Mon, 17 Mar 2014 20:25:51 +0000 (16:25 -0400)]
- Improved an error message which would occur if a query() were made
against a non-selectable, such as a :func:`.literal_column`, and then
an attempt was made to use :meth:`.Query.join` such that the "left"
side would be determined as ``None`` and then fail. This condition
is now detected explicitly.
Mike Bayer [Fri, 28 Feb 2014 00:54:49 +0000 (19:54 -0500)]
- Fixed bug in :func:`.tuple_` construct where the "type" of essentially
the first SQL expression would be applied as the "comparison type"
to a compared tuple value; this has the effect in some cases of an
inappropriate "type coersion" occurring, such as when a tuple that
has a mix of String and Binary values improperly coerces target
values to Binary even though that's not what they are on the left
side. :func:`.tuple_` now expects heterogeneous types within its
list of values.
fixes #2977
Mike Bayer [Thu, 27 Feb 2014 00:27:22 +0000 (19:27 -0500)]
- Removed stale names from ``sqlalchemy.orm.interfaces.__all__`` and
refreshed with current names, so that an ``import *`` from this
module again works.
fixes #2975
Mike Bayer [Thu, 20 Feb 2014 00:22:17 +0000 (19:22 -0500)]
- Added an additional message to psycopg2 disconnect detection,
"could not send data to server", which complements the existing
"could not receive data from server" and has been observed by users,
fixes #2936
Mike Bayer [Tue, 18 Feb 2014 23:35:23 +0000 (18:35 -0500)]
- Support has been improved for Postgresql reflection behavior on very old
(pre 8.1) versions of Postgresql, and potentially other PG engines
such as Redshift (assuming Redshift reports the version as < 8.1).
The query for "indexes" as well as "primary keys" relies upon inspecting
a so-called "int2vector" datatype, which refuses to coerce to an array
prior to 8.1 causing failures regarding the "ANY()" operator used
in the query. Extensive googling has located the very hacky, but
recommended-by-PG-core-developer query to use when PG version < 8.1
is in use, so index and primary key constraint reflection now work
on these versions.
Mike Bayer [Wed, 19 Feb 2014 20:49:37 +0000 (15:49 -0500)]
- Added new MySQL-specific :class:`.mysql.DATETIME` which includes
fractional seconds support; also added fractional seconds support
to :class:`.mysql.TIMESTAMP`. DBAPI support is limited, though
fractional seconds are known to be supported by MySQL Connector/Python.
Patch courtesy Geert JM Vanderkelen. #2941