[Python-modules-commits] [sqlalchemy] 01/05: Import sqlalchemy_1.1.5+ds1.orig.tar.gz
Piotr Ożarowski
piotr at moszumanska.debian.org
Sun Jan 22 14:55:10 UTC 2017
This is an automated email from the git hooks/post-receive script.
piotr pushed a commit to branch master
in repository sqlalchemy.
commit 961e6451915821774fc13e8fb28c642ce2681836
Author: Piotr Ożarowski <piotr at debian.org>
Date: Sun Jan 22 15:49:39 2017 +0100
Import sqlalchemy_1.1.5+ds1.orig.tar.gz
---
LICENSE | 2 +-
PKG-INFO | 2 +-
doc/build/changelog/changelog_10.rst | 22 ++
doc/build/changelog/changelog_11.rst | 191 +++++++++++++++++
doc/build/conf.py | 6 +-
doc/build/copyright.rst | 2 +-
doc/build/orm/session_basics.rst | 2 +-
doc/build/orm/tutorial.rst | 15 +-
doc/build/orm/versioning.rst | 4 +-
examples/versioned_history/history_meta.py | 5 +
examples/versioned_history/test_versioning.py | 46 ++++-
lib/sqlalchemy/__init__.py | 4 +-
lib/sqlalchemy/cextension/processors.c | 2 +-
lib/sqlalchemy/cextension/resultproxy.c | 2 +-
lib/sqlalchemy/cextension/utils.c | 2 +-
lib/sqlalchemy/connectors/__init__.py | 2 +-
lib/sqlalchemy/connectors/mxodbc.py | 4 +-
lib/sqlalchemy/connectors/pyodbc.py | 4 +-
lib/sqlalchemy/connectors/zxJDBC.py | 2 +-
lib/sqlalchemy/databases/__init__.py | 2 +-
lib/sqlalchemy/dialects/__init__.py | 2 +-
lib/sqlalchemy/dialects/firebird/__init__.py | 2 +-
lib/sqlalchemy/dialects/firebird/base.py | 13 +-
lib/sqlalchemy/dialects/firebird/fdb.py | 2 +-
lib/sqlalchemy/dialects/firebird/kinterbasdb.py | 4 +-
lib/sqlalchemy/dialects/mssql/__init__.py | 2 +-
lib/sqlalchemy/dialects/mssql/adodbapi.py | 2 +-
lib/sqlalchemy/dialects/mssql/base.py | 5 +-
.../dialects/mssql/information_schema.py | 2 +-
lib/sqlalchemy/dialects/mssql/mxodbc.py | 2 +-
lib/sqlalchemy/dialects/mssql/pymssql.py | 2 +-
lib/sqlalchemy/dialects/mssql/pyodbc.py | 6 +-
lib/sqlalchemy/dialects/mssql/zxjdbc.py | 2 +-
lib/sqlalchemy/dialects/mysql/__init__.py | 2 +-
lib/sqlalchemy/dialects/mysql/base.py | 29 ++-
lib/sqlalchemy/dialects/mysql/cymysql.py | 4 +-
lib/sqlalchemy/dialects/mysql/enumerated.py | 2 +-
lib/sqlalchemy/dialects/mysql/gaerdbms.py | 2 +-
lib/sqlalchemy/dialects/mysql/json.py | 2 +-
lib/sqlalchemy/dialects/mysql/mysqlconnector.py | 2 +-
lib/sqlalchemy/dialects/mysql/mysqldb.py | 4 +-
lib/sqlalchemy/dialects/mysql/oursql.py | 4 +-
lib/sqlalchemy/dialects/mysql/pymysql.py | 2 +-
lib/sqlalchemy/dialects/mysql/pyodbc.py | 2 +-
lib/sqlalchemy/dialects/mysql/reflection.py | 3 +-
lib/sqlalchemy/dialects/mysql/types.py | 2 +-
lib/sqlalchemy/dialects/mysql/zxjdbc.py | 4 +-
lib/sqlalchemy/dialects/oracle/__init__.py | 2 +-
lib/sqlalchemy/dialects/oracle/base.py | 4 +-
lib/sqlalchemy/dialects/oracle/cx_oracle.py | 2 +-
lib/sqlalchemy/dialects/oracle/zxjdbc.py | 2 +-
lib/sqlalchemy/dialects/postgresql/__init__.py | 2 +-
lib/sqlalchemy/dialects/postgresql/array.py | 2 +-
lib/sqlalchemy/dialects/postgresql/base.py | 128 +++++++++---
lib/sqlalchemy/dialects/postgresql/dml.py | 6 +-
lib/sqlalchemy/dialects/postgresql/ext.py | 4 +-
lib/sqlalchemy/dialects/postgresql/hstore.py | 2 +-
lib/sqlalchemy/dialects/postgresql/json.py | 2 +-
lib/sqlalchemy/dialects/postgresql/pg8000.py | 2 +-
lib/sqlalchemy/dialects/postgresql/psycopg2.py | 2 +-
lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py | 2 +-
lib/sqlalchemy/dialects/postgresql/pygresql.py | 2 +-
lib/sqlalchemy/dialects/postgresql/pypostgresql.py | 2 +-
lib/sqlalchemy/dialects/postgresql/ranges.py | 2 +-
lib/sqlalchemy/dialects/postgresql/zxjdbc.py | 2 +-
lib/sqlalchemy/dialects/sqlite/__init__.py | 2 +-
lib/sqlalchemy/dialects/sqlite/base.py | 34 ++--
lib/sqlalchemy/dialects/sqlite/pysqlcipher.py | 2 +-
lib/sqlalchemy/dialects/sqlite/pysqlite.py | 6 +-
lib/sqlalchemy/dialects/sybase/__init__.py | 2 +-
lib/sqlalchemy/dialects/sybase/base.py | 2 +-
lib/sqlalchemy/dialects/sybase/mxodbc.py | 2 +-
lib/sqlalchemy/dialects/sybase/pyodbc.py | 2 +-
lib/sqlalchemy/dialects/sybase/pysybase.py | 2 +-
lib/sqlalchemy/engine/__init__.py | 2 +-
lib/sqlalchemy/engine/base.py | 18 +-
lib/sqlalchemy/engine/default.py | 7 +-
lib/sqlalchemy/engine/interfaces.py | 6 +-
lib/sqlalchemy/engine/reflection.py | 18 +-
lib/sqlalchemy/engine/result.py | 2 +-
lib/sqlalchemy/engine/strategies.py | 2 +-
lib/sqlalchemy/engine/threadlocal.py | 4 +-
lib/sqlalchemy/engine/url.py | 4 +-
lib/sqlalchemy/engine/util.py | 2 +-
lib/sqlalchemy/event/__init__.py | 2 +-
lib/sqlalchemy/event/api.py | 2 +-
lib/sqlalchemy/event/attr.py | 2 +-
lib/sqlalchemy/event/base.py | 2 +-
lib/sqlalchemy/event/legacy.py | 2 +-
lib/sqlalchemy/event/registry.py | 2 +-
lib/sqlalchemy/events.py | 16 +-
lib/sqlalchemy/exc.py | 2 +-
lib/sqlalchemy/ext/__init__.py | 2 +-
lib/sqlalchemy/ext/associationproxy.py | 4 +-
lib/sqlalchemy/ext/automap.py | 10 +-
lib/sqlalchemy/ext/baked.py | 2 +-
lib/sqlalchemy/ext/compiler.py | 8 +-
lib/sqlalchemy/ext/declarative/__init__.py | 2 +-
lib/sqlalchemy/ext/declarative/api.py | 4 +-
lib/sqlalchemy/ext/declarative/base.py | 2 +-
lib/sqlalchemy/ext/declarative/clsregistry.py | 2 +-
lib/sqlalchemy/ext/horizontal_shard.py | 2 +-
lib/sqlalchemy/ext/hybrid.py | 22 +-
lib/sqlalchemy/ext/indexable.py | 2 +-
lib/sqlalchemy/ext/mutable.py | 8 +-
lib/sqlalchemy/ext/orderinglist.py | 2 +-
lib/sqlalchemy/ext/serializer.py | 2 +-
lib/sqlalchemy/inspection.py | 2 +-
lib/sqlalchemy/interfaces.py | 2 +-
lib/sqlalchemy/log.py | 2 +-
lib/sqlalchemy/orm/__init__.py | 6 +-
lib/sqlalchemy/orm/attributes.py | 4 +-
lib/sqlalchemy/orm/base.py | 2 +-
lib/sqlalchemy/orm/collections.py | 2 +-
lib/sqlalchemy/orm/dependency.py | 2 +-
lib/sqlalchemy/orm/deprecated_interfaces.py | 2 +-
lib/sqlalchemy/orm/descriptor_props.py | 4 +-
lib/sqlalchemy/orm/dynamic.py | 2 +-
lib/sqlalchemy/orm/evaluator.py | 2 +-
lib/sqlalchemy/orm/events.py | 6 +-
lib/sqlalchemy/orm/exc.py | 2 +-
lib/sqlalchemy/orm/identity.py | 2 +-
lib/sqlalchemy/orm/instrumentation.py | 2 +-
lib/sqlalchemy/orm/interfaces.py | 18 +-
lib/sqlalchemy/orm/loading.py | 2 +-
lib/sqlalchemy/orm/mapper.py | 8 +-
lib/sqlalchemy/orm/path_registry.py | 2 +-
lib/sqlalchemy/orm/persistence.py | 2 +-
lib/sqlalchemy/orm/properties.py | 4 +-
lib/sqlalchemy/orm/query.py | 225 ++++++++++-----------
lib/sqlalchemy/orm/relationships.py | 2 +-
lib/sqlalchemy/orm/scoping.py | 4 +-
lib/sqlalchemy/orm/session.py | 19 +-
lib/sqlalchemy/orm/state.py | 2 +-
lib/sqlalchemy/orm/strategies.py | 25 ++-
lib/sqlalchemy/orm/strategy_options.py | 16 +-
lib/sqlalchemy/orm/sync.py | 2 +-
lib/sqlalchemy/orm/unitofwork.py | 2 +-
lib/sqlalchemy/orm/util.py | 20 +-
lib/sqlalchemy/pool.py | 8 +-
lib/sqlalchemy/processors.py | 8 +-
lib/sqlalchemy/schema.py | 2 +-
lib/sqlalchemy/sql/__init__.py | 2 +-
lib/sqlalchemy/sql/annotation.py | 2 +-
lib/sqlalchemy/sql/base.py | 2 +-
lib/sqlalchemy/sql/compiler.py | 16 +-
lib/sqlalchemy/sql/crud.py | 6 +-
lib/sqlalchemy/sql/ddl.py | 4 +-
lib/sqlalchemy/sql/default_comparator.py | 2 +-
lib/sqlalchemy/sql/dml.py | 28 +--
lib/sqlalchemy/sql/elements.py | 52 ++---
lib/sqlalchemy/sql/expression.py | 4 +-
lib/sqlalchemy/sql/functions.py | 10 +-
lib/sqlalchemy/sql/naming.py | 2 +-
lib/sqlalchemy/sql/operators.py | 26 ++-
lib/sqlalchemy/sql/schema.py | 48 +++--
lib/sqlalchemy/sql/selectable.py | 71 +++----
lib/sqlalchemy/sql/sqltypes.py | 56 ++++-
lib/sqlalchemy/sql/type_api.py | 5 +-
lib/sqlalchemy/sql/util.py | 4 +-
lib/sqlalchemy/sql/visitors.py | 2 +-
lib/sqlalchemy/testing/__init__.py | 2 +-
lib/sqlalchemy/testing/assertions.py | 2 +-
lib/sqlalchemy/testing/assertsql.py | 2 +-
lib/sqlalchemy/testing/config.py | 2 +-
lib/sqlalchemy/testing/engines.py | 2 +-
lib/sqlalchemy/testing/entities.py | 2 +-
lib/sqlalchemy/testing/exclusions.py | 2 +-
lib/sqlalchemy/testing/fixtures.py | 2 +-
lib/sqlalchemy/testing/mock.py | 2 +-
lib/sqlalchemy/testing/pickleable.py | 2 +-
lib/sqlalchemy/testing/plugin/noseplugin.py | 2 +-
lib/sqlalchemy/testing/plugin/plugin_base.py | 2 +-
lib/sqlalchemy/testing/profiling.py | 2 +-
lib/sqlalchemy/testing/requirements.py | 2 +-
lib/sqlalchemy/testing/runner.py | 2 +-
lib/sqlalchemy/testing/schema.py | 2 +-
lib/sqlalchemy/testing/suite/test_insert.py | 50 +++++
lib/sqlalchemy/testing/suite/test_reflection.py | 40 +++-
lib/sqlalchemy/testing/suite/test_types.py | 59 +++++-
lib/sqlalchemy/testing/util.py | 2 +-
lib/sqlalchemy/testing/warnings.py | 9 +-
lib/sqlalchemy/types.py | 2 +-
lib/sqlalchemy/util/__init__.py | 2 +-
lib/sqlalchemy/util/_collections.py | 2 +-
lib/sqlalchemy/util/compat.py | 68 ++++---
lib/sqlalchemy/util/deprecations.py | 2 +-
lib/sqlalchemy/util/langhelpers.py | 6 +-
lib/sqlalchemy/util/queue.py | 2 +-
lib/sqlalchemy/util/topological.py | 2 +-
setup.cfg | 2 +-
setup.py | 4 +-
test/dialect/mysql/test_compiler.py | 8 +
test/dialect/mysql/test_reflection.py | 12 ++
test/dialect/postgresql/test_compiler.py | 47 ++++-
test/dialect/postgresql/test_on_conflict.py | 41 +++-
test/dialect/postgresql/test_types.py | 6 +-
test/dialect/test_oracle.py | 23 ---
test/dialect/test_sqlite.py | 6 +-
test/engine/test_execute.py | 6 +-
test/engine/test_logging.py | 20 +-
test/engine/test_reflection.py | 48 ++++-
test/engine/test_transaction.py | 4 +-
test/ext/declarative/test_clsregistry.py | 4 +-
test/ext/test_associationproxy.py | 4 +-
test/orm/inheritance/test_basic.py | 59 ------
test/orm/inheritance/test_relationship.py | 72 ++++++-
test/orm/inheritance/test_single.py | 170 ++++++++++++++--
test/orm/test_composites.py | 4 +-
test/orm/test_events.py | 12 +-
test/orm/test_instrumentation.py | 8 +-
test/orm/test_joins.py | 8 +-
test/orm/test_query.py | 6 +-
test/orm/test_relationships.py | 8 +-
test/orm/test_session.py | 19 +-
test/orm/test_subquery_relations.py | 121 ++++++++++-
test/orm/test_transaction.py | 14 +-
test/orm/test_unitofworkv2.py | 30 +--
test/requirements.py | 4 +
test/sql/test_compiler.py | 54 ++++-
test/sql/test_insert.py | 33 ++-
test/sql/test_metadata.py | 6 +-
test/sql/test_query.py | 2 +-
test/sql/test_resultset.py | 2 +-
test/sql/test_returning.py | 2 +-
test/sql/test_text.py | 14 +-
test/sql/test_types.py | 22 +-
test/sql/test_update.py | 4 +-
tox.ini | 3 +-
229 files changed, 1955 insertions(+), 816 deletions(-)
diff --git a/LICENSE b/LICENSE
index 12dbfc6..b6e074b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
This is the MIT license: http://www.opensource.org/licenses/mit-license.php
-Copyright (c) 2005-2016 the SQLAlchemy authors and contributors <see AUTHORS file>.
+Copyright (c) 2005-2017 the SQLAlchemy authors and contributors <see AUTHORS file>.
SQLAlchemy is a trademark of Michael Bayer.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
diff --git a/PKG-INFO b/PKG-INFO
index 5e328a1..93cb008 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SQLAlchemy
-Version: 1.1.4
+Version: 1.1.5
Summary: Database Abstraction Library
Home-page: http://www.sqlalchemy.org
Author: Mike Bayer
diff --git a/doc/build/changelog/changelog_10.rst b/doc/build/changelog/changelog_10.rst
index 4ae8a8f..c33b43a 100644
--- a/doc/build/changelog/changelog_10.rst
+++ b/doc/build/changelog/changelog_10.rst
@@ -16,6 +16,28 @@
:start-line: 5
.. changelog::
+ :version: 1.0.17
+ :released: January 17, 2017
+
+ .. change::
+ :tags: bug, py3k
+ :tickets: 3886
+ :versions: 1.1.5
+
+ Fixed Python 3.6 DeprecationWarnings related to escaped strings without
+ the 'r' modifier, and added test coverage for Python 3.6.
+
+ .. change::
+ :tags: bug, orm
+ :tickets: 3884
+ :versions: 1.1.5
+
+ Fixed bug involving joined eager loading against multiple entities
+ when polymorphic inheritance is also in use which would throw
+ "'NoneType' object has no attribute 'isa'". The issue was introduced
+ by the fix for :ticket:`3611`.
+
+.. changelog::
:version: 1.0.16
:released: November 15, 2016
diff --git a/doc/build/changelog/changelog_11.rst b/doc/build/changelog/changelog_11.rst
index 701f30e..c44e781 100644
--- a/doc/build/changelog/changelog_11.rst
+++ b/doc/build/changelog/changelog_11.rst
@@ -19,6 +19,197 @@
:start-line: 5
.. changelog::
+ :version: 1.1.5
+ :released: January 17, 2017
+
+ .. change:: mysql_index_prefix
+ :tags: feature, mysql
+
+ Added a new parameter ``mysql_prefix`` supported by the :class:`.Index`
+ construct, allows specification of MySQL-specific prefixes such as
+ "FULLTEXT". Pull request courtesy Joseph Schorr.
+
+ .. change:: 3854
+ :tags: bug, orm
+ :tickets: 3854
+
+ Fixed bug in subquery loading where an object encountered as an
+ "existing" row, e.g. already loaded from a different path in the
+ same query, would not invoke subquery loaders for unloaded attributes
+ that specified this loading. This issue is in the same area
+ as that of :ticket:`3431`, :ticket:`3811` which involved
+ similar issues with joined loading.
+
+ .. change:: 3888
+ :tags: bug, postgresql
+ :tickets: 3888
+
+ Fixed bug in new "ON CONFLICT DO UPDATE" feature where the "set"
+ values for the UPDATE clause would not be subject to type-level
+ processing, as normally takes effect to handle both user-defined
+ type level conversions as well as dialect-required conversions, such
+ as those required for JSON datatypes. Additionally, clarified that
+ the keys in the set_ dictionary should match the "key" of the column,
+ if distinct from the column name. A warning is emitted
+ for remaining column names that don't match column keys; for
+ compatibility reasons, these are emitted as they were previously.
+
+ .. change:: 3872
+ :tags: bug, examples
+ :tickets: 3872
+
+ Fixed two issues with the versioned_history example, one is that
+ the history table now gets autoincrement=False to avoid 1.1's new
+ errors regarding composite primary keys with autoincrement; the other
+ is that the sqlite_autoincrement flag is now used to ensure on SQLite,
+ unique identifiers are used for the lifespan of a table even if
+ some rows are deleted. Pull request courtesy Carlos García Montoro.
+
+ .. change:: 3882
+ :tags: bug, sql
+ :tikets: 3882
+
+ Fixed bug originally introduced in 0.9 via :ticket:`1068` where
+ order_by(<some Label()>) would order by the label name based on name
+ alone, that is, even if the labeled expression were not at all the same
+ expression otherwise present, implicitly or explicitly, in the
+ selectable. The logic that orders by label now ensures that the
+ labeled expression is related to the one that resolves to that name
+ before ordering by the label name; additionally, the name has to
+ resolve to an actual label explicit in the expression elsewhere, not
+ just a column name. This logic is carefully kept separate from the
+ order by(textual name) feature that has a slightly different purpose.
+
+ .. change:: try_finally_for_noautoflush
+ :tags: bug, orm
+
+ The :attr:`.Session.no_autoflush` context manager now ensures that
+ the autoflush flag is reset within a "finally" block, so that if
+ an exception is raised within the block, the state still resets
+ appropriately. Pull request courtesy Emin Arakelian.
+
+ .. change:: 3878
+ :tags: bug, sql
+ :tickets: 3878
+
+ Fixed 1.1 regression where "import *" would not work for
+ sqlalchemy.sql.expression, due to mis-spelled "any_" and "all_"
+ functions.
+
+ .. change:: 3880
+ :tags: bg, sql
+ :tickets: 3880
+
+ Fixed bug where literal_binds compiler flag was not honored by the
+ :class:`.Insert` construct for the "multiple values" feature; the
+ subsequent values are now rendered as literals.
+
+ .. change:: 3877
+ :tags: bug, oracle, postgresql
+ :tickets: 3877
+
+ Fixed bug where an INSERT from SELECT where the source table contains
+ an autoincrementing Sequence would fail to compile correctly.
+
+ .. change:: 3876
+ :tags: bug, mssql
+ :tickets: 3876
+
+ Fixed bug where SQL Server dialects would attempt to select the
+ last row identity for an INSERT from SELECT, failing in the case when
+ the SELECT has no rows. For such a statement,
+ the inline flag is set to True indicating no last primary key
+ should be fetched.
+
+ .. change:: 3875
+ :tags: bug, oracle
+ :tickets: 3875
+
+ Fixed bug where the "COMPRESSION" keyword was used in the ALL_TABLES
+ query on Oracle 9.2; even though Oracle docs state table compression
+ was introduced in 9i, the actual column is not present until
+ 10.1.
+
+ .. change:: 3874
+ :tags: bug, orm
+ :tickets: 3874
+
+ Fixed bug where the single-table inheritance query criteria would not
+ be inserted into the query in the case that the :class:`.Bundle`
+ construct were used as the selection criteria.
+
+ .. change:: repr_for_url_reflect
+ :tags: bug, sql
+
+ The engine URL embedded in the exception for "could not reflect"
+ in :meth:`.MetaData.reflect` now conceals the password; also
+ the ``__repr__`` for :class:`.TLEngine` now acts like that of
+ :class:`.Engine`, concealing the URL password. Pull request courtesy
+ Valery Yundin.
+
+ .. change:: 3867
+ :tags: bug, mysql
+ :tickets: 3867
+
+ The MySQL dialect now will not warn when a reflected column has a
+ "COMMENT" keyword on it, but note however the comment is not yet
+ reflected; this is on the roadmap for a future release. Pull request
+ courtesy Lele Long.
+
+ .. change:: pg_timestamp_zero_prec
+ :tags: bug, postgresql
+
+ The :class:`.postgresql.TIME` and :class:`.postgresql.TIMESTAMP`
+ datatypes now support a setting of zero for "precision"; previously
+ a zero would be ignored. Pull request courtesy Ionuț Ciocîrlan.
+
+ .. change:: 3861
+ :tags: bug, engine
+ :tickets: 3861
+
+ The "extend_existing" option of :class:`.Table` reflection would
+ cause indexes and constraints to be doubled up in the case that the parameter
+ were used with :meth:`.MetaData.reflect` (as the automap extension does)
+ due to tables being reflected both within the foreign key path as well
+ as directly. A new de-duplicating set is passed through within the
+ :meth:`.MetaData.reflect` sequence to prevent double reflection in this
+ way.
+
+ .. change:: 3859
+ :tags: bug, sql
+ :tickets: 3859
+
+ Fixed issue in :class:`.Variant` where the "right hand coercion" logic,
+ inherited from :class:`.TypeDecorator`, would
+ coerce the right-hand side into the :class:`.Variant` itself, rather than
+ what the default type for the :class:`.Variant` would do. In the
+ case of :class:`.Variant`, we want the type to act mostly like the base
+ type so the default logic of :class:`.TypeDecorator` is now overridden
+ to fall back to the underlying wrapped type's logic. Is mostly relevant
+ for JSON at the moment.
+
+ .. change:: 3856
+ :tags: bug, orm
+ :tickets: 3856
+
+ Fixed bug related to :ticket:`3177`, where a UNION or other set operation
+ emitted by a :class:`.Query` would apply "single-inheritance" criteria
+ to the outside of the union (also referencing the wrong selectable),
+ even though this criteria is now expected to
+ be already present on the inside subqueries. The single-inheritance
+ criteria is now omitted once union() or another set operation is
+ called against :class:`.Query` in the same way as :meth:`.Query.from_self`.
+
+ .. change:: 3548
+ :tags: bug, firebird
+ :tickets: 3548
+
+ Ported the fix for Oracle quoted-lowercase names to Firebird, so that
+ a table name that is quoted as lower case can be reflected properly
+ including when the table name comes from the get_table_names()
+ inspection function.
+
+.. changelog::
:version: 1.1.4
:released: November 15, 2016
diff --git a/doc/build/conf.py b/doc/build/conf.py
index 992657b..e4477e4 100644
--- a/doc/build/conf.py
+++ b/doc/build/conf.py
@@ -98,7 +98,7 @@ master_doc = 'contents'
# General information about the project.
project = u'SQLAlchemy'
-copyright = u'2007-2016, the SQLAlchemy authors and contributors'
+copyright = u'2007-2017, the SQLAlchemy authors and contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -107,9 +107,9 @@ copyright = u'2007-2016, the SQLAlchemy authors and contributors'
# The short X.Y version.
version = "1.1"
# The full version, including alpha/beta/rc tags.
-release = "1.1.4"
+release = "1.1.5"
-release_date = "November 15, 2016"
+release_date = "January 17, 2017"
site_base = os.environ.get("RTD_SITE_BASE", "http://www.sqlalchemy.org")
site_adapter_template = "docs_adapter.mako"
diff --git a/doc/build/copyright.rst b/doc/build/copyright.rst
index e5ec969..354686c 100644
--- a/doc/build/copyright.rst
+++ b/doc/build/copyright.rst
@@ -6,7 +6,7 @@ Appendix: Copyright
This is the MIT license: `<http://www.opensource.org/licenses/mit-license.php>`_
-Copyright (c) 2005-2016 Michael Bayer and contributors.
+Copyright (c) 2005-2017 Michael Bayer and contributors.
SQLAlchemy is a trademark of Michael Bayer.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
diff --git a/doc/build/orm/session_basics.rst b/doc/build/orm/session_basics.rst
index 198603b..18610d3 100644
--- a/doc/build/orm/session_basics.rst
+++ b/doc/build/orm/session_basics.rst
@@ -88,7 +88,7 @@ be set up as in the example above, using the ``bind`` argument.
When you write your application, place the
:class:`.sessionmaker` factory at the global level. This
factory can then
-be used by the rest of the applcation as the source of new :class:`.Session`
+be used by the rest of the application as the source of new :class:`.Session`
instances, keeping the configuration for how :class:`.Session` objects
are constructed in one place.
diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst
index 6a7d75f..91c6202 100644
--- a/doc/build/orm/tutorial.rst
+++ b/doc/build/orm/tutorial.rst
@@ -759,13 +759,26 @@ Here's a rundown of some of the most common operators used in
query.filter(User.name.like('%ed%'))
+ .. note:: :meth:`.ColumnOperators.like` renders the LIKE operator, which
+ is case insensitive on some backends, and case sensitive
+ on others. For guaranteed case-insensitive comparisons, use
+ :meth:`.ColumnOperators.ilike`.
+
+* :meth:`ILIKE <.ColumnOperators.ilike>` (case-insensitive LIKE)::
+
+ query.filter(User.name.ilike('%ed%'))
+
+ .. note:: most backends don't support ILIKE directly. For those,
+ the :meth:`.ColumnOperators.ilike` operator renders an expression
+ combining LIKE with the LOWER SQL function applied to each operand.
+
* :meth:`IN <.ColumnOperators.in_>`::
query.filter(User.name.in_(['ed', 'wendy', 'jack']))
# works with query objects too:
query.filter(User.name.in_(
- session.query(User.name).filter(User.name.like('%ed%'))
+ session.query(User.name).filter(User.name.like('%ed%'))
))
* :meth:`NOT IN <.ColumnOperators.notin_>`::
diff --git a/doc/build/orm/versioning.rst b/doc/build/orm/versioning.rst
index a2f1635..5631856 100644
--- a/doc/build/orm/versioning.rst
+++ b/doc/build/orm/versioning.rst
@@ -142,12 +142,14 @@ which provides UPDATE versioning. We can make use
of the PostgreSQL ``xmin`` column to version our ``User``
class as follows::
+ from sqlalchemy import FetchedValue
+
class User(Base):
__tablename__ = 'user'
id = Column(Integer, primary_key=True)
name = Column(String(50), nullable=False)
- xmin = Column("xmin", Integer, system=True)
+ xmin = Column("xmin", Integer, system=True, server_default=FetchedValue())
__mapper_args__ = {
'version_id_col': xmin,
diff --git a/examples/versioned_history/history_meta.py b/examples/versioned_history/history_meta.py
index 866f2d4..bad60a3 100644
--- a/examples/versioned_history/history_meta.py
+++ b/examples/versioned_history/history_meta.py
@@ -41,6 +41,7 @@ def _history_mapper(local_mapper):
orig.info['history_copy'] = col
col.unique = False
col.default = col.server_default = None
+ col.autoincrement = False
return col
properties = util.OrderedDict()
@@ -157,6 +158,10 @@ class Versioned(object):
return mp
return map
+ __table_args__ = {'sqlite_autoincrement': True}
+ """Use sqlite_autoincrement, to ensure unique integer values
+ are used for new rows even for rows taht have been deleted."""
+
def versioned_objects(iter):
for obj in iter:
diff --git a/examples/versioned_history/test_versioning.py b/examples/versioned_history/test_versioning.py
index 3ea240e..37ef739 100644
--- a/examples/versioned_history/test_versioning.py
+++ b/examples/versioned_history/test_versioning.py
@@ -8,7 +8,7 @@ from sqlalchemy import create_engine, Column, Integer, String, \
ForeignKey, Boolean, select
from sqlalchemy.orm import clear_mappers, Session, deferred, relationship, \
column_property
-from sqlalchemy.testing import AssertsCompiledSQL, eq_, assert_raises
+from sqlalchemy.testing import AssertsCompiledSQL, eq_, assert_raises, ne_
from sqlalchemy.testing.entities import ComparableEntity
from sqlalchemy.orm import exc as orm_exc
import warnings
@@ -679,3 +679,47 @@ class TestVersioning(TestCase, AssertsCompiledSQL):
self.assertEqual(v1.id, v2.id)
self.assertEqual(v2.description_, 'Bar')
self.assertEqual(v1.description_, 'Foo')
+
+ def test_unique_identifiers_across_deletes(self):
+ """Ensure unique integer values are used for the primary table.
+
+ Checks whether the database assigns the same identifier twice
+ within the span of a table. SQLite will do this if
+ sqlite_autoincrement is not set (e.g. SQLite's AUTOINCREMENT flag).
+
+ """
+
+ class SomeClass(Versioned, self.Base, ComparableEntity):
+ __tablename__ = 'sometable'
+
+ id = Column(Integer, primary_key=True)
+ name = Column(String(50))
+
+ self.create_tables()
+ sess = self.session
+ sc = SomeClass(name='sc1')
+ sess.add(sc)
+ sess.commit()
+
+ sess.delete(sc)
+ sess.commit()
+
+ sc2 = SomeClass(name='sc2')
+ sess.add(sc2)
+ sess.commit()
+
+ SomeClassHistory = SomeClass.__history_mapper__.class_
+
+ # only one entry should exist in the history table; one()
+ # ensures that
+ scdeleted = sess.query(SomeClassHistory).one()
+
+ # If sc2 has the same id that deleted sc1 had,
+ # it will fail when modified or deleted
+ # because of the violation of the uniqueness of the primary key on
+ # sometable_history
+ ne_(sc2.id, scdeleted.id)
+
+ # If previous assertion fails, this will also fail:
+ sc2.name = 'sc2 modified'
+ sess.commit()
diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py
index ab787d5..78d53f4 100644
--- a/lib/sqlalchemy/__init__.py
+++ b/lib/sqlalchemy/__init__.py
@@ -1,5 +1,5 @@
# sqlalchemy/__init__.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -128,7 +128,7 @@ from .schema import (
from .inspection import inspect
from .engine import create_engine, engine_from_config
-__version__ = '1.1.4'
+__version__ = '1.1.5'
def __go(lcls):
diff --git a/lib/sqlalchemy/cextension/processors.c b/lib/sqlalchemy/cextension/processors.c
index 5b7527c..0ed2288 100644
--- a/lib/sqlalchemy/cextension/processors.c
+++ b/lib/sqlalchemy/cextension/processors.c
@@ -1,6 +1,6 @@
/*
processors.c
-Copyright (C) 2010-2016 the SQLAlchemy authors and contributors <see AUTHORS file>
+Copyright (C) 2010-2017 the SQLAlchemy authors and contributors <see AUTHORS file>
Copyright (C) 2010-2011 Gaetan de Menten gdementen at gmail.com
This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/cextension/resultproxy.c b/lib/sqlalchemy/cextension/resultproxy.c
index 170278c..a53c9fc 100644
--- a/lib/sqlalchemy/cextension/resultproxy.c
+++ b/lib/sqlalchemy/cextension/resultproxy.c
@@ -1,6 +1,6 @@
/*
resultproxy.c
-Copyright (C) 2010-2016 the SQLAlchemy authors and contributors <see AUTHORS file>
+Copyright (C) 2010-2017 the SQLAlchemy authors and contributors <see AUTHORS file>
Copyright (C) 2010-2011 Gaetan de Menten gdementen at gmail.com
This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/cextension/utils.c b/lib/sqlalchemy/cextension/utils.c
index 208f328..fb6a0f5 100644
--- a/lib/sqlalchemy/cextension/utils.c
+++ b/lib/sqlalchemy/cextension/utils.c
@@ -1,6 +1,6 @@
/*
utils.c
-Copyright (C) 2012-2016 the SQLAlchemy authors and contributors <see AUTHORS file>
+Copyright (C) 2012-2017 the SQLAlchemy authors and contributors <see AUTHORS file>
This module is part of SQLAlchemy and is released under
the MIT License: http://www.opensource.org/licenses/mit-license.php
diff --git a/lib/sqlalchemy/connectors/__init__.py b/lib/sqlalchemy/connectors/__init__.py
index d72c390..5cf06d8 100644
--- a/lib/sqlalchemy/connectors/__init__.py
+++ b/lib/sqlalchemy/connectors/__init__.py
@@ -1,5 +1,5 @@
# connectors/__init__.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/connectors/mxodbc.py b/lib/sqlalchemy/connectors/mxodbc.py
index d49ca4b..32e7e18 100644
--- a/lib/sqlalchemy/connectors/mxodbc.py
+++ b/lib/sqlalchemy/connectors/mxodbc.py
@@ -1,5 +1,5 @@
# connectors/mxodbc.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -123,7 +123,7 @@ class MxODBCConnector(Connector):
# of what we're doing here
dbapi_con = connection.connection
version = []
- r = re.compile('[.\-]')
+ r = re.compile(r'[.\-]')
# 18 == pyodbc.SQL_DBMS_VER
for n in r.split(dbapi_con.getinfo(18)[1]):
try:
diff --git a/lib/sqlalchemy/connectors/pyodbc.py b/lib/sqlalchemy/connectors/pyodbc.py
index 6478de5..ee8445d 100644
--- a/lib/sqlalchemy/connectors/pyodbc.py
+++ b/lib/sqlalchemy/connectors/pyodbc.py
@@ -1,5 +1,5 @@
# connectors/pyodbc.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -187,7 +187,7 @@ class PyODBCConnector(Connector):
# queries.
dbapi_con = connection.connection
version = []
- r = re.compile('[.\-]')
+ r = re.compile(r'[.\-]')
for n in r.split(dbapi_con.getinfo(self.dbapi.SQL_DBMS_VER)):
try:
version.append(int(n))
diff --git a/lib/sqlalchemy/connectors/zxJDBC.py b/lib/sqlalchemy/connectors/zxJDBC.py
index e7b2dc9..8a5b749 100644
--- a/lib/sqlalchemy/connectors/zxJDBC.py
+++ b/lib/sqlalchemy/connectors/zxJDBC.py
@@ -1,5 +1,5 @@
# connectors/zxJDBC.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/databases/__init__.py b/lib/sqlalchemy/databases/__init__.py
index 0bfc937..3fb659d 100644
--- a/lib/sqlalchemy/databases/__init__.py
+++ b/lib/sqlalchemy/databases/__init__.py
@@ -1,5 +1,5 @@
# databases/__init__.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/__init__.py b/lib/sqlalchemy/dialects/__init__.py
index bf9c6d3..44051f0 100644
--- a/lib/sqlalchemy/dialects/__init__.py
+++ b/lib/sqlalchemy/dialects/__init__.py
@@ -1,5 +1,5 @@
# dialects/__init__.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/firebird/__init__.py b/lib/sqlalchemy/dialects/firebird/__init__.py
index f27bdc0..8dd9d11 100644
--- a/lib/sqlalchemy/dialects/firebird/__init__.py
+++ b/lib/sqlalchemy/dialects/firebird/__init__.py
@@ -1,5 +1,5 @@
# firebird/__init__.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/firebird/base.py b/lib/sqlalchemy/dialects/firebird/base.py
index 16e2c55..7d4aca5 100644
--- a/lib/sqlalchemy/dialects/firebird/base.py
+++ b/lib/sqlalchemy/dialects/firebird/base.py
@@ -1,11 +1,11 @@
# firebird/base.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""
+r"""
.. dialect:: firebird
:name: Firebird
@@ -55,13 +55,13 @@ extends that to deletes and updates. This is generically exposed by
the SQLAlchemy ``returning()`` method, such as::
# INSERT..RETURNING
- result = table.insert().returning(table.c.col1, table.c.col2).\\
+ result = table.insert().returning(table.c.col1, table.c.col2).\
values(name='foo')
print result.fetchall()
# UPDATE..RETURNING
- raises = empl.update().returning(empl.c.id, empl.c.salary).\\
- where(empl.c.sales>100).\\
+ raises = empl.update().returning(empl.c.id, empl.c.salary).\
+ where(empl.c.sales>100).\
values(dict(salary=empl.c.salary * 1.1))
print raises.fetchall()
@@ -77,6 +77,7 @@ from sqlalchemy import exc, types as sqltypes, sql, util
from sqlalchemy.sql import expression
from sqlalchemy.engine import base, default, reflection
from sqlalchemy.sql import compiler
+from sqlalchemy.sql.elements import quoted_name
from sqlalchemy.types import (BIGINT, BLOB, DATE, FLOAT, INTEGER, NUMERIC,
SMALLINT, TEXT, TIME, TIMESTAMP, Integer)
@@ -439,6 +440,8 @@ class FBDialect(default.DefaultDialect):
elif name.upper() == name and \
not self.identifier_preparer._requires_quotes(name.lower()):
return name.lower()
+ elif name.lower() == name:
+ return quoted_name(name, quote=True)
else:
return name
diff --git a/lib/sqlalchemy/dialects/firebird/fdb.py b/lib/sqlalchemy/dialects/firebird/fdb.py
index aff8cff..d590df7 100644
--- a/lib/sqlalchemy/dialects/firebird/fdb.py
+++ b/lib/sqlalchemy/dialects/firebird/fdb.py
@@ -1,5 +1,5 @@
# firebird/fdb.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/firebird/kinterbasdb.py b/lib/sqlalchemy/dialects/firebird/kinterbasdb.py
index 3df9f73..b7c1563 100644
--- a/lib/sqlalchemy/dialects/firebird/kinterbasdb.py
+++ b/lib/sqlalchemy/dialects/firebird/kinterbasdb.py
@@ -1,5 +1,5 @@
# firebird/kinterbasdb.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -160,7 +160,7 @@ class FBDialect_kinterbasdb(FBDialect):
def _parse_version_info(self, version):
m = match(
- '\w+-V(\d+)\.(\d+)\.(\d+)\.(\d+)( \w+ (\d+)\.(\d+))?', version)
+ r'\w+-V(\d+)\.(\d+)\.(\d+)\.(\d+)( \w+ (\d+)\.(\d+))?', version)
if not m:
raise AssertionError(
"Could not determine version from string '%s'" % version)
diff --git a/lib/sqlalchemy/dialects/mssql/__init__.py b/lib/sqlalchemy/dialects/mssql/__init__.py
index 8c9e858..6b70df3 100644
--- a/lib/sqlalchemy/dialects/mssql/__init__.py
+++ b/lib/sqlalchemy/dialects/mssql/__init__.py
@@ -1,5 +1,5 @@
# mssql/__init__.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/mssql/adodbapi.py b/lib/sqlalchemy/dialects/mssql/adodbapi.py
index a85ce5a..221bf50 100644
--- a/lib/sqlalchemy/dialects/mssql/adodbapi.py
+++ b/lib/sqlalchemy/dialects/mssql/adodbapi.py
@@ -1,5 +1,5 @@
# mssql/adodbapi.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index 19558a2..3e16e6e 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -1,5 +1,5 @@
# mssql/base.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -1022,7 +1022,8 @@ class MSExecutionContext(default.DefaultExecutionContext):
else:
self._enable_identity_insert = False
- self._select_lastrowid = insert_has_sequence and \
+ self._select_lastrowid = not self.compiled.inline and \
+ insert_has_sequence and \
not self.compiled.returning and \
not self._enable_identity_insert and \
not self.executemany
diff --git a/lib/sqlalchemy/dialects/mssql/information_schema.py b/lib/sqlalchemy/dialects/mssql/information_schema.py
index e2c0a46..625479b 100644
--- a/lib/sqlalchemy/dialects/mssql/information_schema.py
+++ b/lib/sqlalchemy/dialects/mssql/information_schema.py
@@ -1,5 +1,5 @@
# mssql/information_schema.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/mssql/mxodbc.py b/lib/sqlalchemy/dialects/mssql/mxodbc.py
index e968920..41729b7 100644
--- a/lib/sqlalchemy/dialects/mssql/mxodbc.py
+++ b/lib/sqlalchemy/dialects/mssql/mxodbc.py
@@ -1,5 +1,5 @@
# mssql/mxodbc.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/mssql/pymssql.py b/lib/sqlalchemy/dialects/mssql/pymssql.py
index 380418b..57ca8ab 100644
--- a/lib/sqlalchemy/dialects/mssql/pymssql.py
+++ b/lib/sqlalchemy/dialects/mssql/pymssql.py
@@ -1,5 +1,5 @@
# mssql/pymssql.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
+# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py
index 5c6dd4c..c6368f9 100644
--- a/lib/sqlalchemy/dialects/mssql/pyodbc.py
+++ b/lib/sqlalchemy/dialects/mssql/pyodbc.py
@@ -1,11 +1,11 @@
# mssql/pyodbc.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
... 6600 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sqlalchemy.git
More information about the Python-modules-commits
mailing list