]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
6 years agoUpdate index.rst - Added link to Drill dialect. 4432/head
Charles S. Givre [Tue, 8 Jan 2019 19:45:19 +0000 (14:45 -0500)] 
Update index.rst - Added link to Drill dialect.

Added link to Apache Drill dialect.

6 years agoPost black reformatting
Mike Bayer [Sun, 6 Jan 2019 06:19:47 +0000 (01:19 -0500)] 
Post black reformatting

Applied on top of a pure run of black -l 79 in
I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9,  this set of changes
resolves all remaining flake8 conditions for those codes
we have enabled in setup.cfg.

Included are resolutions for all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.

Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe

6 years agoRun black -l 79 against all source files
Mike Bayer [Sun, 6 Jan 2019 06:14:26 +0000 (01:14 -0500)] 
Run black -l 79 against all source files

This is a straight reformat run using black as is, with no edits
applied at all.

The black run will format code consistently, however in
some cases that are prevalent in SQLAlchemy code it produces
too-long lines.   The too-long lines will be resolved in the
following commit that will resolve all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.

Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9

6 years agoAssorted pre-Black fixes
Mike Bayer [Sun, 6 Jan 2019 03:42:08 +0000 (22:42 -0500)] 
Assorted pre-Black fixes

Fixes to the test suite, a few errant imports, and setup.py:

- mysql and postgresql have unused 'json' imports; remove
- postgresql is exporting the 'json' symbol, remove
- make sure setup.py can find __version__ using " or '
- retry logic in provision create database for postgresql fixed
- refactor test_magazine to use cls.tables rather than globals
- remove unused class in test_scoping
- add a comment to test_deprecations that this test suite itself
  is deprecated
- don't use mapper() and orm_mapper() in test_unitofwork, just
  use mapper()
- remove dupe test_scalar_set_None test in test_attributes
- Python 2.7 and above includes unittest.SkipTest, remove pre-2.7
  fallback
- use imported SkipTest in profiling
- declarative test_reflection tests with "reflectable_autoincrement"
  already don't run on oracle or firebird; remove conditional logic
  for these, which also removes an "id" symbol
- clean up test in test_functions, remove print statement
- remove dupe test_literal_processor_coercion_native_int_out_of_range
  in test/sql/test_types.py
- fix psycopg2_hstore ref

Change-Id: I7b3444f8546aac82be81cd1e7b6d8b2ad6834fe6

6 years agoPrep for flake8 refactoring
Mike Bayer [Fri, 4 Jan 2019 03:28:09 +0000 (22:28 -0500)] 
Prep for flake8 refactoring

a few code changes ahead of time to handle some __all__
issues better.  also include new flake8 rules, since the
existing flake8 doesn't pass in any case.

Change-Id: I1efdf75124ae7bcac719c22e505bb5b13db06c04

6 years agorework the exclusions spec expression
Mike Bayer [Mon, 31 Dec 2018 03:02:12 +0000 (22:02 -0500)] 
rework the exclusions spec expression

The expression was expecting spaces which means we were skipping
Postgresql window function tests and possibly other things.

Change-Id: I57c4aed558f4011f2f7b882a2d9b1fee210f9eaf

6 years agocommit 1b774808c926665047bf353222ecd191679a95d1
Lele Gaifax [Mon, 31 Dec 2018 02:16:11 +0000 (21:16 -0500)] 
commit 1b774808c926665047bf353222ecd191679a95d1
Author: Lele Gaifax <lele@metapensiero.it>
Date:   Tue Dec 25 12:35:41 2018 +0100

    Consistently use "PostgreSQL", fixing also a few doc glitches

commit 0e382aaee4427193926f0dc10ad29056bc12c85e
Author: Lele Gaifax <lele@metapensiero.it>
Date:   Tue Dec 25 12:08:49 2018 +0100

    Remove duplicated words

Change-Id: Iaa586b9412f46a50fe6ff3bbb92e07d6cb1905c8

6 years agoMerge "Check collection less than two items remaining before firing scalar backref...
mike bayer [Sat, 29 Dec 2018 07:59:58 +0000 (07:59 +0000)] 
Merge "Check collection less than two items remaining before firing scalar backref remove"

6 years agoMerge "Call __del() before remove()"
mike bayer [Sat, 29 Dec 2018 07:58:21 +0000 (07:58 +0000)] 
Merge "Call __del() before remove()"

6 years agoAdd missing disambiguation to non-primary mapper example
Mike Bayer [Fri, 28 Dec 2018 14:33:07 +0000 (09:33 -0500)] 
Add missing disambiguation to non-primary mapper example

The mapping to B over a join defines an alternate primary key
based on all the primary key columns in the join unless we
re-define it explicitly.   Similarly, people expect that
``.id`` looks the same.  make sure these line up with the
old mapping.

Change-Id: I1ab064c57019e79c34293f6588d1e033f7083974

6 years agoCheck collection less than two items remaining before firing scalar backref remove
Mike Bayer [Sun, 23 Dec 2018 00:16:50 +0000 (19:16 -0500)] 
Check collection less than two items remaining before firing scalar backref remove

Fixed long-standing issue where duplicate collection members would cause a
backref to delete the association between the member and its parent object
when one of the duplicates were removed, as occurs as a side effect of
swapping two objects in one statement.

Fixes: #1103
Change-Id: Ic12877f7bd5a4eb688091725a78410748e7fdf16

6 years agoCall __del() before remove()
Mike Bayer [Fri, 28 Dec 2018 03:10:45 +0000 (22:10 -0500)] 
Call __del() before remove()

The "remove" event for collections is now called before the item is removed
in the case of the ``collection.remove()`` method, as is consistent with the
behavior for most other forms of collection item removal (such as
``__delitem__``, replacement under ``__setitem__``).  The ``pop()`` methods
are now the only exception as the target item is not available until after
the pop operation proceeds.

This allows ``remove()`` to be consistent in its behavior with all
the other collection operations, allows the "before_delete" hook
to be local to "pop()" operations only, and removes some method overhead.

We are also looking here to gain some more predictability in terms
of the fix for #1103.

Change-Id: I4fdea911517d65cc300fae0e9c351a471e52e4ab

6 years agoImplement SynonymProperty.get_history()
Mike Bayer [Thu, 27 Dec 2018 17:39:15 +0000 (12:39 -0500)] 
Implement SynonymProperty.get_history()

Implemented the ``.get_history()`` method, which also implies availability
of :attr:`.AttributeState.history`, for :func:`.synonym` attributes.
Previously, trying to access attribute history via a synonym would raise an
``AttributeError``.

Fixes: #3777
Change-Id: I20810a8b1a1bf630dbcb6622193c13cf4236b94a

6 years ago- remove non-working dialects some of which are 404's
Mike Bayer [Mon, 24 Dec 2018 05:07:22 +0000 (00:07 -0500)] 
- remove non-working dialects some of which are 404's
- put the five major dialect names on the front page
- remove old change messages

Change-Id: Ibf1dc2c499f10f98efb6c97d6c53e442e7746200

6 years agoMerge "Add before_mapper_configured event"
mike bayer [Sun, 23 Dec 2018 15:44:37 +0000 (15:44 +0000)] 
Merge "Add before_mapper_configured event"

6 years agoMerge "Maintain compiled_params / replacement_expressions within expanding IN"
mike bayer [Sat, 22 Dec 2018 13:54:11 +0000 (13:54 +0000)] 
Merge "Maintain compiled_params / replacement_expressions within expanding IN"

6 years agoMaintain compiled_params / replacement_expressions within expanding IN
Mike Bayer [Fri, 21 Dec 2018 22:35:12 +0000 (17:35 -0500)] 
Maintain compiled_params / replacement_expressions within expanding IN

Fixed issue in "expanding IN" feature where using the same bound parameter
name more than once in a query would lead to a KeyError within the process
of rewriting the parameters in the query.

Fixes: #4394
Change-Id: Ibcadce9fefbcb060266d9447c2044ee6efeccf5a

6 years agoMerge "Handle PostgreSQL enums in remote schemas"
mike bayer [Fri, 21 Dec 2018 22:23:07 +0000 (22:23 +0000)] 
Merge "Handle PostgreSQL enums in remote schemas"

6 years agoadd pull request template
Mike Bayer [Fri, 21 Dec 2018 19:13:41 +0000 (14:13 -0500)] 
add pull request template

Change-Id: I850c246e4f0feb62dca083909e5d010ce8288a3d

6 years agoHandle PostgreSQL enums in remote schemas
Mike Bayer [Fri, 21 Dec 2018 16:04:14 +0000 (11:04 -0500)] 
Handle PostgreSQL enums in remote schemas

Fixed issue where a :class:`.postgresql.ENUM` or a custom domain present
in a remote schema would not be recognized within column reflection if
the name of the enum/domain or the name of the schema required quoting.
A new parsing scheme now fully parses out quoted or non-quoted tokens
including support for SQL-escaped quotes.

Fixed issue where multiple :class:`.postgresql.ENUM` objects referred to
by the same :class:`.MetaData` object would fail to be created if
multiple objects had the same name under different schema names.  The
internal memoization the Postgresql dialect uses to track if it has
created a particular :class:`.postgresql.ENUM` in the database during
a DDL creation sequence now takes schema name into account.

Fixes: #4416
Change-Id: I8cf03069e10b12f409e9b6796e24fc5850979955

6 years agoRewrite the convert_unicode docs and add tons of dragons
Mike Bayer [Fri, 21 Dec 2018 17:13:13 +0000 (12:13 -0500)] 
Rewrite the convert_unicode docs and add tons of dragons

These flags will all be going away as Python 3 has solved
all of this.

Change-Id: I4f581d8dd7826dd823b671d0d8e72250284236c8

6 years agoMerge "Fix the "greatest" example."
mike bayer [Thu, 20 Dec 2018 15:32:12 +0000 (15:32 +0000)] 
Merge "Fix the "greatest" example."

6 years agoMerge "Omit include of no longer existing files"
mike bayer [Thu, 20 Dec 2018 15:29:34 +0000 (15:29 +0000)] 
Merge "Omit include of no longer existing files"

6 years agoOmit include of no longer existing files
Michael Howitz [Mon, 17 Dec 2018 16:04:44 +0000 (11:04 -0500)] 
Omit include of no longer existing files

Warnings are generated during setup.py install such as:

```
Getting distribution for 'SQLAlchemy==1.2.15'.
warning: no files found matching '*.jpg' under directory 'doc'
warning: no files found matching '*.mako' under directory 'doc'
warning: no files found matching 'distribute_setup.py'
warning: no files found matching 'sa2to3.py'
warning: no files found matching 'ez_setup.py'
```

This change removes those expressions from MANIFEST.in.

Closes: #4408
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4408
Pull-request-sha: 448b3a9dc8f25d841f20bcd67130acaea68cb745

Change-Id: Id6373611fb384e230427f87b9e75672d78483000

6 years agoFix the "greatest" example.
Konstantin Tretyakov [Mon, 17 Dec 2018 22:21:03 +0000 (17:21 -0500)] 
Fix the "greatest" example.

The current example code does not pass `**kw` down to the `compiler.process` calls, thus the example does not work when invoked with, `literal_binds=True`.

Besides, the calls to `process` each argument twice are wasteful, and reusing the built-in `case` expression instead of hard-coding the SQL statements is slightly nicer overall, isn't it?

Closes: #4402
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4402
Pull-request-sha: 24ee93f63e21fccae6cbc1cc1c154dd56f1e1963

Change-Id: I02424d9eb2b35abd5cdec5c2cd5d464a56e7fae6

6 years agoMerge "Add missing parameter to docstring"
mike bayer [Mon, 17 Dec 2018 21:22:58 +0000 (21:22 +0000)] 
Merge "Add missing parameter to docstring"

6 years agoAdd missing parameter to docstring
Agam Rafaeli [Mon, 17 Dec 2018 17:58:19 +0000 (12:58 -0500)] 
Add missing parameter to docstring

Closes: #4410
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4410
Pull-request-sha: 070a0f44f3a6ce651e6b8e9dcc84d2d507d00845

Change-Id: I7a026bf6a2041e7686d90d5f155b88d8001f2ba8

6 years agoSet a reading order to the compatibility import file
Agam Rafaeli [Mon, 17 Dec 2018 16:20:09 +0000 (11:20 -0500)] 
Set a reading order to the compatibility import file

The order is as follows:
1. Imports, in the same format of "import X"
2. Members denoting versions of python
3. Members of imports that are shadowed for usage across the system
4. Global variables
5. If conditions of imports. (internally organized by this order)
6. Function definitions

Closes: #4409
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4409
Pull-request-sha: a7eb52d39f9758572e6a3314865bb633260aa8e1

Change-Id: I2fa44d1aebd7575df968f2e3f3fc7d474fa3c6d7

6 years agoDocument and support nested composites
Mike Bayer [Wed, 12 Dec 2018 17:51:20 +0000 (12:51 -0500)] 
Document and support nested composites

Composites can behave in a "nested" fashion by defining the
class in that way.   To make the constructor more convenient,
a callable can be passed to :func:`.composite` instead of the
class itself.  This works now, so add a test to ensure this
pattern remains available.

Change-Id: Ia009f274fca7269f41d6d824e0f70b6fb0ada081

6 years agocherry-pick changelog update for 1.2.16
Mike Bayer [Tue, 11 Dec 2018 21:56:37 +0000 (16:56 -0500)] 
cherry-pick changelog update for 1.2.16

6 years agocherry-pick changelog from 1.2.15
Mike Bayer [Tue, 11 Dec 2018 21:56:37 +0000 (16:56 -0500)] 
cherry-pick changelog from 1.2.15

6 years agoAdd before_mapper_configured event
Chris Wilson [Mon, 10 Dec 2018 21:37:51 +0000 (16:37 -0500)] 
Add before_mapper_configured event

This event is intended to allow a specific mapper to be skipped during the
configure step, by returning a value of `.orm.interfaces.EXT_SKIP` which means
the mapper will be skipped within this configure run. The "new mappers" flag
will remain set in this case and the configure operation will occur again.

This event, and its return value, make it possible to query one base while a
different one still needs configuration, which cannot be completed at this
time.

Fixes: #4397
Change-Id: I122e556f6a4ff842ad15315dcf39e19bb7f9a744
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4403

6 years agoMerge "Refer to existing of_type when resolving string attribute name"
mike bayer [Sat, 8 Dec 2018 14:19:28 +0000 (14:19 +0000)] 
Merge "Refer to existing of_type when resolving string attribute name"

6 years agoMerge "Take instance into account when determining AssociationProxyInstance"
mike bayer [Sat, 8 Dec 2018 14:18:53 +0000 (14:18 +0000)] 
Merge "Take instance into account when determining AssociationProxyInstance"

6 years agoTake instance into account when determining AssociationProxyInstance
Mike Bayer [Fri, 7 Dec 2018 18:08:29 +0000 (13:08 -0500)] 
Take instance into account when determining AssociationProxyInstance

Fixed a regression in 1.3.0b1 caused by :ticket:`3423` where association
proxy objects that access an attribute that's only present on a polymorphic
subclass would raise an ``AttributeError`` even though the actual instance
being accessed was an instance of that subclass.

Fixes: #4401
Change-Id: Ie62c48aa9142adff45cbf9a297184987c72f30f3

6 years agoRefer to existing of_type when resolving string attribute name
Mike Bayer [Fri, 7 Dec 2018 21:01:04 +0000 (16:01 -0500)] 
Refer to existing of_type when resolving string attribute name

Fixed bug where chaining of mapper options using
:meth:`.RelationshipProperty.of_type` in conjunction with a chained option
that refers to an attribute name by string only would fail to locate the
attribute.

Fixes: #4400
Change-Id: I01bf449ec4d8f56bb8c34e25153c1c9b31ff8012

6 years agoAdd versioned_update_old_row example
Mike Bayer [Fri, 7 Dec 2018 19:01:23 +0000 (14:01 -0500)] 
Add versioned_update_old_row example

A modification to the "turn UPDATE into INSERT" recipe that
also UPDATEs the previous row.  The example is using timestamps
to maintain a relationship between two objects.

Change-Id: Ifdb8ee73616190384263bbe88c71d9278d616f6b

6 years ago- fix formatting on examples to list the description first, some flake8
Mike Bayer [Fri, 7 Dec 2018 17:17:59 +0000 (12:17 -0500)] 
- fix formatting on examples to list the description first, some flake8

Change-Id: I57144a559f20abab02e745d052be5ff84edec7f8

6 years agoFixed typo in docs
adriennefranke [Thu, 6 Dec 2018 00:57:50 +0000 (18:57 -0600)] 
Fixed typo in docs

Fixes: #4166
Fixes: #4399
Change-Id: I49494209463089114e77dfc737c811837d49ea20

6 years agoRemoved the leading underscore for visitor_iterator property
Agam Rafaeli [Wed, 5 Dec 2018 21:12:59 +0000 (16:12 -0500)] 
Removed the leading underscore for visitor_iterator property

A leading underscore usually denotes a private member. Since this
is a property and it is used in Query I removed the leading underscore

Change-Id: I8a35c09fd6d20ee0a13568ed7257a08b7bee2a08
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4398

6 years agoMerge "Move CRUDTest, InlineDefaultTest from test_compiler"
mike bayer [Tue, 4 Dec 2018 14:28:10 +0000 (14:28 +0000)] 
Merge "Move CRUDTest, InlineDefaultTest from test_compiler"

6 years agoAll sphinx dependencies move under the github sqlalchemy organization
Mike Bayer [Mon, 3 Dec 2018 22:02:23 +0000 (17:02 -0500)] 
All sphinx dependencies move under the github sqlalchemy organization

Change-Id: I7a0dc1ef320b6abad0eeac8b24c20f821e5b8c81

6 years agoMerge "Fix PostgreSQL reflection of domains expressed as arrays"
mike bayer [Mon, 3 Dec 2018 02:35:11 +0000 (02:35 +0000)] 
Merge "Fix PostgreSQL reflection of domains expressed as arrays"

6 years ago"left" -> "accidentally placed at"
Mike Bayer [Sun, 2 Dec 2018 23:54:40 +0000 (18:54 -0500)] 
"left" -> "accidentally placed at"

since "left" is kind of ambiguous, use more explicit terminology
here.

Also update the test to use a positive assertion that the
warning is emitted; quote the attribute name.

Change-Id: Ic2284c200a26b32b2da063cfaf6d59547309d587
References: https://github.com/zzzeek/sqlalchemy/pull/488

6 years agoMove CRUDTest, InlineDefaultTest from test_compiler
Mike Bayer [Sat, 1 Dec 2018 19:28:57 +0000 (14:28 -0500)] 
Move CRUDTest, InlineDefaultTest from test_compiler

test_compiler is mostly related to SELECT statements as well
as smaller SQL elements.  While it still has some DDL related
tests, move out all the remaining insert/update tests into
the already present test_insert.py, test_update.py

Fixes: #2630
Change-Id: I4167618543fd1235d12d1717c8c629d2374b325a

6 years agoFix PostgreSQL reflection of domains expressed as arrays
Jakub Synowiec [Sat, 1 Dec 2018 18:26:43 +0000 (13:26 -0500)] 
Fix PostgreSQL reflection of domains expressed as arrays

Fixed issue where reflection of a PostgreSQL domain that is expressed as an
array would fail to be recognized.  Pull request courtesy Jakub Synowiec.

Fixes: #4377
Change-Id: I252c79ca435b87d4d9172b1c84e0e74e789ef676
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4380

6 years agoMerge "Apply path generation for superclasses to Load._set_path_strategy()"
mike bayer [Sat, 1 Dec 2018 16:52:22 +0000 (16:52 +0000)] 
Merge "Apply path generation for superclasses to Load._set_path_strategy()"

6 years agoApply path generation for superclasses to Load._set_path_strategy()
Mike Bayer [Fri, 30 Nov 2018 19:36:20 +0000 (14:36 -0500)] 
Apply path generation for superclasses to Load._set_path_strategy()

Extended the fix first made as part of :ticket:`3287`, where a loader option
made against a subclass using a wildcard would extend itself to include
application of the wildcard to attributes on the super classes as well, to a
"bound" loader option as well, e.g. in an expression like
``Load(SomeSubClass).load_only('foo')``.  Columns that are part of the
parent class of ``SomeSubClass`` will also be excluded in the same way as if
the unbound option ``load_only('foo')`` were used.

Fixes: #4373
Change-Id: I2eee0e587c34323a77df077b9cb699da370c403d

6 years agoMerge "Add __clause_element__ to ColumnProperty"
mike bayer [Fri, 30 Nov 2018 18:12:02 +0000 (18:12 +0000)] 
Merge "Add __clause_element__ to ColumnProperty"

6 years agoMerge "Add the write_timeout option for mysql."
mike bayer [Fri, 30 Nov 2018 18:11:06 +0000 (18:11 +0000)] 
Merge "Add the write_timeout option for mysql."

6 years agoMerge "Allow optional *args with base AnsiFunction"
mike bayer [Fri, 30 Nov 2018 15:18:44 +0000 (15:18 +0000)] 
Merge "Allow optional *args with base AnsiFunction"

6 years agoAdd the write_timeout option for mysql.
jun923.gu [Fri, 30 Nov 2018 05:21:29 +0000 (00:21 -0500)] 
Add the write_timeout option for mysql.

As MySQLdb support read_timeout and write_timeout option, and
sqlalchemy just support read_timeout option. So sqlalchemy need to add
write_timeout option.

Fixes: #4381
Change-Id: I2bea80bdd6f20fafc72b48fa0e5d795626d9d9b9
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4385

6 years agoAllow optional *args with base AnsiFunction
Mike Bayer [Thu, 29 Nov 2018 15:13:03 +0000 (10:13 -0500)] 
Allow optional *args with base AnsiFunction

Amended the :class:`.AnsiFunction` class, the base of common SQL
functions like ``CURRENT_TIMESTAMP``, to accept positional arguments
like a regular ad-hoc function.  This to suit the case that many of
these functions on specific backends accept arguments such as
"fractional seconds" precision and such.  If the function is created
with arguments, it renders the the parenthesis and the arguments.  If
no arguents are present, the compiler generates the non-parenthesized form.

Fixes: #4386
Change-Id: Ic492ef177e4987cec99ec4d95f55292be8daa087

6 years agotypo 4388/head
Raphael [Fri, 30 Nov 2018 00:11:24 +0000 (19:11 -0500)] 
typo

typo

6 years agoMerge remote-tracking branch 'origin/pr/4382'
Mike Bayer [Wed, 28 Nov 2018 17:32:24 +0000 (12:32 -0500)] 
Merge remote-tracking branch 'origin/pr/4382'

Change-Id: I957a13fa77be659a1ce2371342af4e33b1c5a304

6 years agoAdd a test harness for MySQL connect args
Mike Bayer [Wed, 28 Nov 2018 16:27:46 +0000 (11:27 -0500)] 
Add a test harness for MySQL connect args

This is to assist with #4381.

Change-Id: I5ebfc0da906a13edc4fb3f0ca7ab2d843d43bb00

6 years agoprint() is a function in Python 3 4382/head
cclauss [Wed, 28 Nov 2018 09:38:57 +0000 (10:38 +0100)] 
print() is a function in Python 3

6 years agoAdd __clause_element__ to ColumnProperty
Mike Bayer [Thu, 22 Nov 2018 15:39:29 +0000 (10:39 -0500)] 
Add __clause_element__ to ColumnProperty

Added a ``__clause_element__()`` method to :class:`.ColumnProperty` which
can allow the usage of a not-fully-declared column or deferred attribute in
a declarative mapped class slightly more friendly when it's used in a
constraint or other column-oriented scenario within the class declaration,
though this still can't work in open-ended expressions; prefer to call the
:attr:`.ColumnProperty.expression` attribute if receiving ``TypeError``.

Fixes: #4372
Change-Id: I5d3d1adb9c77de0566298bc2c46e9001d314b0c7

6 years agoMerge "Warn for lower-case column attribute on declarative"
mike bayer [Tue, 27 Nov 2018 07:54:43 +0000 (07:54 +0000)] 
Merge "Warn for lower-case column attribute on declarative"

6 years agoMove links etc. to github, new alembic links
Mike Bayer [Tue, 27 Nov 2018 03:58:50 +0000 (22:58 -0500)] 
Move links etc. to github, new alembic links

Change-Id: I59392d355a216ae59552a04c5508f548b901aa7b

6 years agoWarn for lower-case column attribute on declarative
Mike Bayer [Mon, 26 Nov 2018 05:59:01 +0000 (00:59 -0500)] 
Warn for lower-case column attribute on declarative

A warning is emitted in the case that a :func:`.column` object is applied to
a declarative class, as it seems likely this intended to be a
:class:`.Column` object.

Fixes: #4374
Change-Id: I2e617ef65547162e3ba6587c168548ad0cf6203d

6 years ago- remove @HEAD indicator from docs requirements, fixes #4375
Mike Bayer [Mon, 26 Nov 2018 04:54:44 +0000 (23:54 -0500)] 
- remove @HEAD indicator from docs requirements, fixes #4375

Change-Id: I50b1622c2c2236bf9e436f61c7eea31faaeaa3e1

6 years agoVersion 1.3.0b2 placeholder
Mike Bayer [Sat, 17 Nov 2018 04:13:08 +0000 (23:13 -0500)] 
Version 1.3.0b2 placeholder

6 years ago- 1.3.0b1 rel_1_3_0b1
Mike Bayer [Sat, 17 Nov 2018 04:04:42 +0000 (23:04 -0500)] 
- 1.3.0b1

6 years ago- edits
Mike Bayer [Sat, 17 Nov 2018 03:46:20 +0000 (22:46 -0500)] 
- edits

Change-Id: Ia8e1b5b51acc2b249499796ac36a7a3b68c941a1

6 years ago- edits for 1.3 migration notes
Mike Bayer [Fri, 16 Nov 2018 23:52:42 +0000 (18:52 -0500)] 
- edits for 1.3 migration notes

Change-Id: Id2065053088481df5a703c63bfc88799a9943a5e

6 years ago- we don't have a separate contributors doc anymore...
Mike Bayer [Fri, 16 Nov 2018 23:51:35 +0000 (18:51 -0500)] 
- we don't have a separate contributors doc anymore...

Change-Id: I0d09d3aa386336263829a98aeb1237caab78b789

6 years agoMerge "Modernize cx_Oracle parameters"
mike bayer [Fri, 16 Nov 2018 03:14:54 +0000 (03:14 +0000)] 
Merge "Modernize cx_Oracle parameters"

6 years ago- fix spacing
Mike Bayer [Fri, 16 Nov 2018 00:51:03 +0000 (19:51 -0500)] 
- fix spacing

Change-Id: I460d873b4c6a250594e291b5f47fff5a06280817

6 years agoRepair tutorial code example to be deterministic
Mike Bayer [Fri, 16 Nov 2018 00:48:45 +0000 (19:48 -0500)] 
Repair tutorial code example to be deterministic

A few queries featured an aggregate without a GROUP BY
or a complete ordering, causing the doctests to fail
with recent versions of SQLite.  The queries are now made
to include a GROUP BY as well as ORDER BY both columns.

Fixes: #4370
Change-Id: I904bddb4372224158fcecff9f0dbbbe7c1bf36b3

6 years agoModernize cx_Oracle parameters
Mike Bayer [Thu, 15 Nov 2018 17:11:12 +0000 (12:11 -0500)] 
Modernize cx_Oracle parameters

Updated the parameters that can be sent to the cx_Oracle DBAPI to both allow
for all current parameters as well as for future parameters not added yet.
In addition, removed unused parameters that were deprecated in version 1.2,
and additionally we are now defaulting "threaded" to False.

Fixes: #4369
Change-Id: I599668960e7b2d5bd1f5e6850e10b5b3ec215ed3

6 years agoModernize cx_oracle connect documentation
Mike Bayer [Thu, 15 Nov 2018 17:52:33 +0000 (12:52 -0500)] 
Modernize cx_oracle connect documentation

in preparation for #4369, however the documentation was
also inaccurate in that it did not mention connect_args.

Change-Id: I992e5f53ce16cc9c72d2c893a3ca798a9c2b4d07

6 years agoMerge "Add secondary selectable to FROM clauses for correlated exists"
mike bayer [Thu, 15 Nov 2018 15:17:59 +0000 (15:17 +0000)] 
Merge "Add secondary selectable to FROM clauses for correlated exists"

6 years agoMerge "Allow join() to pick the best candidate from multiple froms/entities"
mike bayer [Thu, 15 Nov 2018 15:05:11 +0000 (15:05 +0000)] 
Merge "Allow join() to pick the best candidate from multiple froms/entities"

6 years agoAllow join() to pick the best candidate from multiple froms/entities
Mike Bayer [Mon, 12 Nov 2018 23:27:34 +0000 (18:27 -0500)] 
Allow join() to pick the best candidate from multiple froms/entities

Refactored :meth:`.Query.join` to further clarify the individual components
of structuring the join. This refactor adds the ability for
:meth:`.Query.join` to determine the most appropriate "left" side of the
join when there is more than one element in the FROM list or the query is
against multiple entities.  In particular this targets the regression we
saw in :ticket:`4363` but is also of general use.   The codepaths within
:meth:`.Query.join` are now easier to follow and the error cases are
decided more specifically at an earlier point in the operation.

Fixes: #4365
Change-Id: I403f451243904a020ceab4c3f94bead550c7b2d5

6 years agoAdd secondary selectable to FROM clauses for correlated exists
Mike Bayer [Wed, 14 Nov 2018 16:02:40 +0000 (11:02 -0500)] 
Add secondary selectable to FROM clauses for correlated exists

In continuing with a similar theme as that of very recent :ticket:`4349`,
repaired issue with :meth:`.RelationshipProperty.Comparator.any` and
:meth:`.RelationshipProperty.Comparator.has` where the "secondary"
selectable needs to be explicitly part of the FROM clause in the
EXISTS subquery to suit the case where this "secondary" is a :class:`.Join`
object.

Fixes: #4366
Change-Id: Icd0d0c3871bbd0059f0c9256e2b980edc2c90551

6 years agoMerge "Add new parameters for IDENTITY start/increment in mssql"
mike bayer [Wed, 14 Nov 2018 22:35:19 +0000 (22:35 +0000)] 
Merge "Add new parameters for IDENTITY start/increment in mssql"

6 years agoAdd new parameters for IDENTITY start/increment in mssql
Mike Bayer [Sun, 11 Nov 2018 02:36:18 +0000 (21:36 -0500)] 
Add new parameters for IDENTITY start/increment in mssql

Deprecated the use of :class:`.Sequence` with SQL Server in order to affect
the "start" and "increment" of the IDENTITY value, in favor of new
parameters ``mssql_identity_start`` and ``mssql_identity_increment`` which
set these parameters directly.  :class:`.Sequence` will be used to generate
real ``CREATE SEQUENCE`` DDL with SQL Server in a future release.

Fixes: #4362
Change-Id: I1e69378c5c960ff0bc28137c923589692f1a918f

6 years agoMerge "Deannotate "parententity" in primaryjoin/secondaryjoin"
mike bayer [Wed, 14 Nov 2018 19:22:25 +0000 (19:22 +0000)] 
Merge "Deannotate "parententity" in primaryjoin/secondaryjoin"

6 years agoMerge "Insert primary entity in dynamic "secondary""
mike bayer [Wed, 14 Nov 2018 19:20:30 +0000 (19:20 +0000)] 
Merge "Insert primary entity in dynamic "secondary""

6 years agoDeannotate "parententity" in primaryjoin/secondaryjoin
Mike Bayer [Wed, 14 Nov 2018 16:31:22 +0000 (11:31 -0500)] 
Deannotate "parententity" in primaryjoin/secondaryjoin

Fixed bug where the ORM annotations could be incorrect for the
primaryjoin/secondaryjoin a relationship if one used the pattern
``ForeignKey(SomeClass.id)`` in the declarative mappings.   This pattern
would leak undesired annotations into the join conditions which can break
aliasing operations done within :class:`.Query` that are not supposed to
impact elements in that join condition.  These annotations are now removed
up front if present.

Also add a test suite for has/any into test_query which will
form the basis for new tests to be added in :ticket:`4366`.

Fixes: #4367
Change-Id: I929ef983981bb49bf975f346950ebb0e19c986b8

6 years agoMerge "Add Sequence to StrSQLCompiler"
mike bayer [Tue, 13 Nov 2018 23:37:33 +0000 (23:37 +0000)] 
Merge "Add Sequence to StrSQLCompiler"

6 years agoInsert primary entity in dynamic "secondary"
Mike Bayer [Mon, 12 Nov 2018 20:09:37 +0000 (15:09 -0500)] 
Insert primary entity in dynamic "secondary"

Fixed regression caused by :ticket:`4349` where adding the "secondary"
table to the FROM clause for a dynamic loader would affect the ability of
the :class:`.Query` to make a subsequent join to another entity.   The fix
adds the primary entity as the first element of the FROM list since
:meth:`.Query.join` wants to jump from that.   Version 1.3 will have
a more comprehensive solution to this problem as well (:ticket:`4365`).

Fixes: #4363
Change-Id: I1abbb6207722619dc5369e1fd96de43d60a1ee62

6 years agoConvert to spaces
Mike Bayer [Sun, 11 Nov 2018 02:56:52 +0000 (21:56 -0500)] 
Convert to spaces

Change-Id: I219f7f6ef4f644f64fcb04fed224c6415465df0b

6 years agoAdd Sequence to StrSQLCompiler
Mike Bayer [Sun, 11 Nov 2018 02:10:51 +0000 (21:10 -0500)] 
Add Sequence to StrSQLCompiler

Added :class:`.Sequence` to the "string SQL" system that will render a
meaningful string expression (``"<next sequence value: my_sequence>"``)
when stringifying without a dialect a statement that includes a "sequence
nextvalue" expression, rather than raising a compilation error.

Fixes: #4144
Change-Id: Ia910f0e22008a7cde7597365954ede324101cf4d

6 years agoMerge "Add new "all columns" naming convention tokens"
mike bayer [Sun, 11 Nov 2018 01:58:18 +0000 (01:58 +0000)] 
Merge "Add new "all columns" naming convention tokens"

6 years agoMerge "Modernize deferred callable for many-to-one comparison"
mike bayer [Sun, 11 Nov 2018 01:56:41 +0000 (01:56 +0000)] 
Merge "Modernize deferred callable for many-to-one comparison"

6 years agoModernize deferred callable for many-to-one comparison
Mike Bayer [Wed, 7 Nov 2018 16:21:39 +0000 (11:21 -0500)] 
Modernize deferred callable for many-to-one comparison

Improved the behavior of a relationship-bound many-to-one object expression
such that the retrieval of column values on the related object are now
resilient against the object being detached from its parent
:class:`.Session`, even if the attribute has been expired.  New features
within the :class:`.InstanceState` are used to memoize the last known value
of a particular column attribute before its expired, so that the expression
can still evaluate when the object is detached and expired at the same
time.  Error conditions are also improved using modern attribute state
features to produce more specific messages as needed.

To support the value being mutated while also being resilient towards
expiration, a new feature to InstanceState is added ._last_known_values
which holds onto the expired value when an individual key is expired.
Only takes effect specific to keys and InstanceState objects that
received a special instruction so this does not add to overall
memory/latency.

Fixes: #4359
Change-Id: Iff272e667bf741074549db550bf65348553ca8e7

6 years agoAdd new "all columns" naming convention tokens
Mike Bayer [Mon, 5 Nov 2018 19:52:35 +0000 (14:52 -0500)] 
Add new "all columns" naming convention tokens

Added new naming convention tokens ``column_0N_name``, ``column_0_N_name``,
etc., which will render the names / keys / labels for all columns referenced
by a particular constraint in a sequence.  In order to accommodate for the
length of such a naming convention, the SQL compiler's auto-truncation
feature now applies itself to constraint names as well, which creates a
shortened, deterministically generated name for the constraint that will
apply to a target backend without going over the character limit of that
backend.

Additional notes:

1. the SQLite dialect had a format_index method that was apparently not
used, removed.

2. the naming convention logic has been applying the foreign key
remote column spec to the naming convention, and not the actual
column name.  In the case where the referenced Table object uses
.key inside the columns and these are what ForeignKey() references,
the naming convention was doing the wrong thing.   The patch here
fixes this, however this isn't noted in the migration notes.

Fixes: #3989
Change-Id: Ib24f4754b886676096c480fc54b2e5c2463ac99a

6 years agocherry-pick changelog update for 1.2.15
Mike Bayer [Sat, 10 Nov 2018 20:59:12 +0000 (15:59 -0500)] 
cherry-pick changelog update for 1.2.15

6 years agocherry-pick changelog from 1.2.14
Mike Bayer [Sat, 10 Nov 2018 20:59:12 +0000 (15:59 -0500)] 
cherry-pick changelog from 1.2.14

6 years agoFix typo
Mike Bayer [Sat, 10 Nov 2018 16:26:31 +0000 (11:26 -0500)] 
Fix typo

Change-Id: I411466dc1952cf57f73d1453c73b0ca449842c35

6 years agoUse case insensitive matching on lower_case_table_names=1,2
Mike Bayer [Sat, 10 Nov 2018 04:18:55 +0000 (23:18 -0500)] 
Use case insensitive matching on lower_case_table_names=1,2

Fixed regression caused by :ticket:`4344` released in 1.2.13, where the fix
for MySQL 8.0's case sensitivity problem with referenced column names when
reflecting foreign key referents is worked around using the
``information_schema.columns`` view.  The workaround was failing on OSX /
``lower_case_table_names=2`` which produces non-matching casing for the
``information_schema.columns`` vs. that of ``SHOW CREATE TABLE``, so in
case-insensitive SQL modes case-insensitive matching is now used.

Fixes: #4361
Change-Id: I748549bc4c27fad6394593f8ec93fc22bfd01f6c

6 years agoMerge "Implement SQLite ON CONFLICT for constraints"
mike bayer [Fri, 9 Nov 2018 22:43:20 +0000 (22:43 +0000)] 
Merge "Implement SQLite ON CONFLICT for constraints"

6 years agoImplement SQLite ON CONFLICT for constraints
Denis Kataev [Mon, 12 Mar 2018 15:40:34 +0000 (11:40 -0400)] 
Implement SQLite ON CONFLICT for constraints

Implemented the SQLite ``ON CONFLICT`` clause as understood at the DDL
level, e.g. for primary key, unique, and CHECK constraints as well as
specified on a :class:`.Column` to satisfy inline primary key and NOT NULL.
Pull request courtesy Denis Kataev.

Fixes: #4360
Change-Id: I4cd4bafa8fca41e3101c87dbbfe169741bbda3f4
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/431

6 years agoImprove documentation re: Session.binds and partitioning strategies
Mike Bayer [Tue, 6 Nov 2018 20:13:03 +0000 (15:13 -0500)] 
Improve documentation re: Session.binds and partitioning strategies

Update documentation to include background on arbitrary superclass
usage, add full cross-linking between all related methods and parameters.
De-emphasize "twophase" and document that it is not well-supported
in drivers.

Change-Id: Id99894bb62cc506e896c9aa7c256e9f6e602243e

6 years agoMerge remote-tracking branch 'origin/pr/486'
Mike Bayer [Sat, 3 Nov 2018 16:45:31 +0000 (12:45 -0400)] 
Merge remote-tracking branch 'origin/pr/486'

Change-Id: I90596d4fc238b913146906db0ab700dd767c5615

6 years agoMerge remote-tracking branch 'origin/pr/450'
Mike Bayer [Sat, 3 Nov 2018 16:37:19 +0000 (12:37 -0400)] 
Merge remote-tracking branch 'origin/pr/450'

Change-Id: I50c0dd75199a34f68f9a2fa0f89208a887193969

6 years agoMerge "Deannotate ORM columns in ColumnEntity"
mike bayer [Sat, 3 Nov 2018 16:17:04 +0000 (16:17 +0000)] 
Merge "Deannotate ORM columns in ColumnEntity"

6 years ago- block py.test 3.9.1 and 3.9.2, 3.9.3 is OK
Mike Bayer [Fri, 2 Nov 2018 20:54:21 +0000 (16:54 -0400)] 
- block py.test 3.9.1 and 3.9.2, 3.9.3 is OK

Change-Id: I35ecd78b92ea420ef7909de65f82e005b92bf986