]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
6 years agodoc grammar updates 4565/head
Mengxi Zhang [Wed, 22 May 2019 19:46:16 +0000 (12:46 -0700)] 
doc grammar updates

6 years agoExpand joins when calculating PostgreSQL "WITH FOR UPDATE OF"
raylu [Wed, 20 Mar 2019 21:22:19 +0000 (17:22 -0400)] 
Expand joins when calculating PostgreSQL "WITH FOR UPDATE OF"

Modified the :paramref:`.Select.with_for_update.of` parameter so that if a
join or other composed selectable is passed, the individual :class:`.Table`
objects will be filtered from it, allowing one to pass a join() object to
the parameter, as occurs normally when using joined table inheritance with
the ORM.  Pull request courtesy Raymond Lu.

Fixes: #4550
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Closes: #4551
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4551
Pull-request-sha: 452da77d154a4087d530456db1c9af207d65cef4

Change-Id: If4b7c231f7b71190d7245543959fb5c3351125a1

6 years agoChanged urllib.quote_plus to urllib.parse.quote_plus (Python 3 versio…
ericdeansanchez [Mon, 18 Mar 2019 14:51:26 +0000 (10:51 -0400)] 
Changed urllib.quote_plus to urllib.parse.quote_plus (Python 3 versio…

Fixes: #4542
Closes: #4546
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4546
Pull-request-sha: 95d905cdcc33f44ff21d13e411e4a17843e6b54a

Change-Id: Ibaf0852822e281e79770763e7e3550270d26cf66

6 years agoClarify that declarative string resolution does not imply imports are implicit
Antony Gelberg [Sat, 16 Mar 2019 21:34:12 +0000 (17:34 -0400)] 
Clarify that declarative string resolution does not imply imports are implicit

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Closes: #4545
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4545
Pull-request-sha: c25221838d726f316dc04102b6b2002cec6b3a6c

Change-Id: Ic38621f7deb3cb25e250aab61c5b2b02d633b187

6 years agoMerge "Clone internals for Select._correlate_except collection as well as _correlate"
mike bayer [Mon, 11 Mar 2019 14:49:23 +0000 (14:49 +0000)] 
Merge "Clone internals for Select._correlate_except collection as well as _correlate"

6 years agoClone internals for Select._correlate_except collection as well as _correlate
Mike Bayer [Mon, 11 Mar 2019 03:34:33 +0000 (23:34 -0400)] 
Clone internals for Select._correlate_except collection as well as _correlate

Fixed bug where use of :func:`.with_polymorphic` or other aliased construct
would not properly adapt when the aliased target were used as the
:meth:`.Select.correlate_except` target of a subquery used inside of a
:func:`.column_property`.  This required a fix to the clause adaption
mechanics to properly handle a selectable that shows up in the "correlate
except" list, in a similar manner as which occurs for selectables that show
up in the "correlate" list.  This is ultimately a fairly fundamental bug
that has lasted for a long time but it is hard to come across it.

Fixes: #4537
Change-Id: Ibb97d4eea18b3c452aad519dd14919bfb84d422f

6 years agoVersion 1.3.2 placeholder
Mike Bayer [Sat, 9 Mar 2019 19:38:14 +0000 (14:38 -0500)] 
Version 1.3.2 placeholder

6 years ago- 1.3.1 rel_1_3_1
Mike Bayer [Sat, 9 Mar 2019 19:32:32 +0000 (14:32 -0500)] 
- 1.3.1

6 years agoCommit transaction after SNAPSHOT isolation change
Mike Bayer [Fri, 8 Mar 2019 23:36:33 +0000 (18:36 -0500)] 
Commit transaction after SNAPSHOT isolation change

A commit() is emitted after an isolation level change to SNAPSHOT, as both
pyodbc and pymssql open an implicit transaction which blocks subsequent SQL
from being emitted in the current transaction.

Fixes: #4536
Change-Id: If3ba70f495bce2a35a873a3a72d1b30406e678c8

6 years agoblack reformatting
Mike Bayer [Sat, 9 Mar 2019 04:45:02 +0000 (23:45 -0500)] 
black reformatting

Change-Id: Idc48f1c80867cd953f9d611719d1d5b5d244ae38

6 years agoRemove convert_unicode nodes and add version for deprecation
Mike Bayer [Fri, 8 Mar 2019 19:42:24 +0000 (14:42 -0500)] 
Remove convert_unicode nodes and add version for deprecation

Fixes: #4535
Change-Id: Ic5b1991ecef3b258573e1c59f5106a534f92a813

6 years agoUpdate the mysql-connector-python docs for now
Mike Bayer [Fri, 8 Mar 2019 14:54:58 +0000 (09:54 -0500)] 
Update the mysql-connector-python docs for now

mysql-connector-python still seems to have issues with binary datatypes
but the other issues here, with the possible exception of the deadlock
still being investigated, seem to have been resolved in the recent
8.x series of mysql-connector-python.   The driver is still not
recommended due to these issues however we don't need a special
class of warnings at this point.

Change-Id: I2d59e76df5e84b34e318a24b468626900c39da46
References: #4531

6 years agoAdd documentation section for cascade_scalar_deletes
Mike Bayer [Thu, 7 Mar 2019 14:54:45 +0000 (09:54 -0500)] 
Add documentation section for cascade_scalar_deletes

Change-Id: I56825652e0608862472bc594fc6c2b12ed5cc16f
References: #4534

6 years agoMerge "Ensure association proxy works over synonym"
mike bayer [Wed, 6 Mar 2019 16:38:49 +0000 (16:38 +0000)] 
Merge "Ensure association proxy works over synonym"

6 years agoMerge "Fix large_resultsets performance example field name"
mike bayer [Wed, 6 Mar 2019 16:11:36 +0000 (16:11 +0000)] 
Merge "Fix large_resultsets performance example field name"

6 years agoMerge "Ensure scale param not sent to float types"
mike bayer [Wed, 6 Mar 2019 15:47:01 +0000 (15:47 +0000)] 
Merge "Ensure scale param not sent to float types"

6 years agoFix large_resultsets performance example field name
Matt Schuchhardt [Wed, 6 Mar 2019 15:28:48 +0000 (10:28 -0500)] 
Fix large_resultsets performance example field name

Fixed bug in large_resultsets example case where a re-named "id" variable
due to code reformatting caused the test to fail.  Pull request courtesy
Matt Schuchhardt.

Fixes: #4528
Closes: #4529
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4529
Pull-request-sha: 8f52f10422114c397254db9e6f940d042708e0bd

Change-Id: Iaca6fd06ec0ede8ff1745d627708ba492a2114c8

6 years agoEnsure association proxy works over synonym
Mike Bayer [Tue, 5 Mar 2019 18:28:54 +0000 (13:28 -0500)] 
Ensure association proxy works over synonym

Fixed regression where an association proxy linked to a synonym would no
longer work, both at instance level and at class level.

Fixes: #4522
Change-Id: I949079229ef87c12736c362df35444f6e30c8038

6 years agoLoosen SingletonThreadPoolTest
Mike Bayer [Wed, 6 Mar 2019 13:18:26 +0000 (08:18 -0500)] 
Loosen SingletonThreadPoolTest

This test is non-critical as the SingletonThreadPool is
not production-level robust under multithreaded scenarios in
any case.

Fixes: #4527
Change-Id: Ie19ebd69438c97b2d8adb571f8f1b2c56894f7fb

6 years agoEnsure scale param not sent to float types
Mike Bayer [Wed, 6 Mar 2019 14:05:23 +0000 (09:05 -0500)] 
Ensure scale param not sent to float types

Fixed regression in SQL Server reflection due to :ticket:`4393` where the
removal of open-ended ``**kw`` from the :class:`.Float` datatype caused
reflection of this type to fail due to a "scale" argument being passed.

Fixes: #4525
Change-Id: Ief8bb535778055eff2ab0d71660f81e3676390a1

6 years agorun a black run
Mike Bayer [Wed, 6 Mar 2019 01:29:05 +0000 (20:29 -0500)] 
run a black run

fix some pep8s that snuck in

Change-Id: Ied282007df30a52d232b1ba88659f2a123ff380f

6 years agoFix pooling typo
Mike Bayer [Wed, 6 Mar 2019 00:42:41 +0000 (19:42 -0500)] 
Fix pooling typo

eng -> engine

Fixes: #4526
Change-Id: If117099b8521e15887ae916a5dbfcfa0b7cd594b

6 years agoMerge remote-tracking branch 'origin/pr/4520'
Mike Bayer [Tue, 5 Mar 2019 17:39:07 +0000 (12:39 -0500)] 
Merge remote-tracking branch 'origin/pr/4520'

Change-Id: I3ca8e33c361ea088323e83437d6817ba02737de7

6 years agoAdd a note that the truncation logic also raises an exception for
Mike Bayer [Tue, 5 Mar 2019 17:08:16 +0000 (12:08 -0500)] 
Add a note that the truncation logic also raises an exception for
too-long names.

Change-Id: I8291a56235171827f5c41361b74118ba9c28c4c5

6 years ago- repair param inject to work around code examples to some degree
Mike Bayer [Tue, 5 Mar 2019 16:34:03 +0000 (11:34 -0500)] 
- repair param inject to work around code examples to some degree
- link to correct text() construct for CheckConstraint

Change-Id: Ic46d1f79670a532f33bd9feb7f568dc3d1d6e38a

6 years agoVersion 1.3.1 placeholder
Mike Bayer [Mon, 4 Mar 2019 21:50:17 +0000 (16:50 -0500)] 
Version 1.3.1 placeholder

6 years agoAdd missing attribute in hybrid.py docs 4520/head
Daniel Demmel [Mon, 4 Mar 2019 18:10:22 +0000 (18:10 +0000)] 
Add missing attribute in hybrid.py docs

6 years ago- 1.3.0 rel_1_3_0
Mike Bayer [Mon, 4 Mar 2019 18:05:44 +0000 (13:05 -0500)] 
- 1.3.0

6 years agoMerge "Use basepython 3.7 for flake8 tests"
mike bayer [Mon, 4 Mar 2019 17:40:31 +0000 (17:40 +0000)] 
Merge "Use basepython 3.7 for flake8 tests"

6 years agoUse basepython 3.7 for flake8 tests
Mike Bayer [Mon, 4 Mar 2019 17:22:07 +0000 (12:22 -0500)] 
Use basepython 3.7 for flake8 tests

this to prevent flake8 from running with python 2 as we have
py3k-specific checks

Change-Id: I456c4b64c5bc04a81cd43de7dac1e803346f1245

6 years agoMerge "Add port comparison in __eq__() and __ne__() method to URL"
mike bayer [Mon, 4 Mar 2019 15:45:53 +0000 (15:45 +0000)] 
Merge "Add port comparison in __eq__() and __ne__() method to URL"

6 years agoAdd port comparison in __eq__() and __ne__() method to URL
Sanjana [Thu, 28 Feb 2019 15:16:13 +0000 (10:16 -0500)] 
Add port comparison in __eq__() and __ne__() method to URL

Comparing two objects of :class:`.URL` using ``__eq__()`` did not take port
number into consideration, two objects differing only by port number were
considered equal. Port comparison is now added in ``__eq__()`` method of
:class:`.URL`, objects differing by port number are now not equal.
Additionally, ``__ne__()`` was not implemented for :class:`.URL` which
caused unexpected result when ``!=`` was used in Python2, since there are no
implied relationships among the comparison operators in Python2.

Fixes: #4406
Closes: #4515
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4515
Pull-request-sha: 0f15b805f07e7fca1f82ca6c3aad98d50ea705b8

Change-Id: Iba7d224f1282dc3f4b884d1a746f2d46669f551e

6 years agoAdd resolve_fks=False option for reflection
Mike Bayer [Thu, 28 Feb 2019 15:59:41 +0000 (10:59 -0500)] 
Add resolve_fks=False option for reflection

Added new parameters :paramref:`.Table.resolve_fks` and
:paramref:`.MetaData.reflect.resolve_fks` which when set to False will
disable the automatic reflection of related tables encountered in
:class:`.ForeignKey` objects, which can both reduce SQL overhead for omitted
tables as well as avoid tables that can't be reflected for database-specific
reasons.  Two :class:`.Table` objects present in the same :class:`.MetaData`
collection can still refer to each other even if the reflection of the two
tables occurred separately.

Fixes: #4517
Change-Id: I623baed42042a16c5109e4c8af6b2f64d2d00f95

6 years agolink to PyHive as a dialect 4516/head
Aidan Feldman [Wed, 27 Feb 2019 21:01:04 +0000 (16:01 -0500)] 
link to PyHive as a dialect

6 years agoIgnore Pipenv* and .idea 4514/head
Ville Brofeldt [Sat, 23 Feb 2019 16:02:42 +0000 (18:02 +0200)] 
Ignore Pipenv* and .idea

6 years agoMerge "Add test to as_interface when no cls or methods"
mike bayer [Fri, 22 Feb 2019 00:33:55 +0000 (00:33 +0000)] 
Merge "Add test to as_interface when no cls or methods"

6 years agoMerge "Prevent __init__ from being called for Alias, subclasses"
mike bayer [Fri, 22 Feb 2019 00:33:31 +0000 (00:33 +0000)] 
Merge "Prevent __init__ from being called for Alias, subclasses"

6 years agoAdd test to as_interface when no cls or methods
Toni Karppi [Thu, 21 Feb 2019 19:22:48 +0000 (14:22 -0500)] 
Add test to as_interface when no cls or methods

Fixes #4511

### Description
The `as_interface` function requires that an argument be provided for at least one of the parameters `cls` or `methods`. There was no test that tested the case when neither of these arguments were provided.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #4512
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4512
Pull-request-sha: 156f6af95ede730d2e1a9d2c935c830cf3cfc96e

Change-Id: Ifa23dbe1dbe9a824fe680e4947b81c96a50c133f

6 years agoMerge "Add support for key-word based get()"
mike bayer [Thu, 21 Feb 2019 19:19:49 +0000 (19:19 +0000)] 
Merge "Add support for key-word based get()"

6 years agoPrevent __init__ from being called for Alias, subclasses
Mike Bayer [Wed, 20 Feb 2019 20:00:09 +0000 (15:00 -0500)] 
Prevent __init__ from being called for Alias, subclasses

The :class:`.Alias` class and related subclasses :class:`.CTE`,
:class:`.Lateral` and :class:`.TableSample` have been reworked so that it is
not possible for a user to construct the objects directly.  These constructs
require that the standalone construction function or selectable-bound method
be used to instantiate new objects.

Fixes: #4509
Change-Id: I74ae4786cb3ae625dab33b00bfd6bdc4e1219139

6 years agoMerge "Include newlines in StatementError formatting"
mike bayer [Thu, 21 Feb 2019 15:52:29 +0000 (15:52 +0000)] 
Merge "Include newlines in StatementError formatting"

6 years agoInclude newlines in StatementError formatting
Nate Clark [Wed, 20 Feb 2019 17:58:18 +0000 (12:58 -0500)] 
Include newlines in StatementError formatting

Revised the formatting for :class:`.StatementError` when stringified. Each
error detail is broken up over multiple newlines instead of spaced out on a
single line.  Additionally, the SQL representation now stringifies the SQL
statement rather than using ``repr()``, so that newlines are rendered as is.
Pull request courtesy Nate Clark.

Fixes: #4500
Closes: #4501
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4501
Pull-request-sha: 60cc0ee68dc96b8f483a60d37bcb26b6c6d53efe

Change-Id: I79d8418b7495e5691c9a56f41e79495c26a967ff

6 years agoAdd support for key-word based get()
sanjana [Wed, 20 Feb 2019 04:07:12 +0000 (23:07 -0500)] 
Add support for key-word based get()

The :meth:`.Query.get` method can now accept a dictionary of attribute keys
and values as a means of indicating the primary key value to load; is
particularly useful for composite primary keys.  Pull request courtesy
Sanjana S.

Fixes: #4316
Closes: #4505
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4505
Pull-request-sha: cfa8297ad2490be9eae24ec8b1a691e43cd75868

Change-Id: Ib19e7d51599a36f4878119c2f801c5c694793422

6 years agoRemove inadvertent test_schema.db commit
Mike Bayer [Wed, 20 Feb 2019 18:06:20 +0000 (13:06 -0500)] 
Remove inadvertent test_schema.db commit

also revise .gitignore

Change-Id: I93d900287fe35441db827203b9fdf63eb681ca69

6 years agoMerge "Add NCHAR to Oracle dialect"
mike bayer [Wed, 20 Feb 2019 17:54:07 +0000 (17:54 +0000)] 
Merge "Add NCHAR to Oracle dialect"

6 years agorevise timestamp correction scheme
Mike Bayer [Wed, 20 Feb 2019 17:52:40 +0000 (12:52 -0500)] 
revise timestamp correction scheme

For very slow CI this test still fails so establish the date
as being between the range of what the operation took

Change-Id: I9204cd1915777ebc58bd598065b9015befb93345

6 years agoEnsure _simple_lazy_clause bind names are fixed before cloning
Mike Bayer [Wed, 20 Feb 2019 00:46:17 +0000 (19:46 -0500)] 
Ensure _simple_lazy_clause bind names are fixed before cloning

Fixed a regression in 1.2 due to the introduction of baked queries for
relationship lazy loaders, where a race condition is created during the
generation of the "lazy clause" which occurs within a memoized attribute. If
two threads initialize the memoized attribute concurrently, the baked query
could be generated with bind parameter keys that are then replaced with new
keys by the next run, leading to a lazy load query that specifies the
related criteria as ``None``. The fix establishes that the parameter names
are fixed before the new clause and parameter objects are generated, so that
the names are the same every time.

Fixes: #4507
Change-Id: I605b824e028c87bc20ca8c2577227cdf6a591064

6 years agoAdd NCHAR to Oracle dialect
Mike Bayer [Tue, 19 Feb 2019 17:13:04 +0000 (12:13 -0500)] 
Add NCHAR to Oracle dialect

Added support for reflection of the :class:`.NCHAR` datatype to the Oracle
dialect, and added :class:`.NCHAR` to the list of types exported by the
Oracle dialect.

Fixes: #4506
Change-Id: I3a120b9ad714cbd0ebd8064519f43cf57e99d920

6 years agocherry-pick changelog update for 1.2.19
Mike Bayer [Fri, 15 Feb 2019 18:08:58 +0000 (13:08 -0500)] 
cherry-pick changelog update for 1.2.19

6 years agocherry-pick changelog from 1.2.18
Mike Bayer [Fri, 15 Feb 2019 18:08:57 +0000 (13:08 -0500)] 
cherry-pick changelog from 1.2.18

6 years ago- formatting fix
Mike Bayer [Fri, 15 Feb 2019 17:38:49 +0000 (12:38 -0500)] 
- formatting fix

Change-Id: I93126865ffb5cc6486464402ed7ef17027441886

6 years agoMerge "Adding setter to should_evaluate_none property"
mike bayer [Thu, 14 Feb 2019 15:40:06 +0000 (15:40 +0000)] 
Merge "Adding setter to should_evaluate_none property"

6 years agoAdding setter to should_evaluate_none property
sanjana [Wed, 13 Feb 2019 15:17:46 +0000 (10:17 -0500)] 
Adding setter to should_evaluate_none property

Fixed issue where the :class:`.JSON` type had a read-only
:attr:`.JSON.should_evaluate_none` attribute, which would cause failures
when making use of the :meth:`.TypeEngine.evaluates_none` method in
conjunction with this type.  Pull request courtesy Sanjana S.

Fixes: #4485
Closes: #4496
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4496
Pull-request-sha: 044beb23982d411be6fe640716b1b693df0f7189

Change-Id: I1f3e1d7dec9d2ceb6ccaaa8cac158a062cf02710

6 years agoSet IDENTITY_INSERT for insert.values({column: expr})
Mike Bayer [Wed, 13 Feb 2019 16:26:54 +0000 (11:26 -0500)] 
Set IDENTITY_INSERT for insert.values({column: expr})

Fixed bug where the SQL Server "IDENTITY_INSERT" logic that allows an INSERT
to proceed with an explicit value on an IDENTITY column was not detecting
the case where :meth:`.Insert.values` were used with a dictionary that
contained a :class:`.Column` as key and a SQL expression as a value.

Fixes: #4499
Change-Id: Ia61cd6524b030b40a665db9c20771f0c5aa5fcd7

6 years agoMerge "Allow SQL expression for ORM primary keys"
mike bayer [Wed, 13 Feb 2019 01:35:15 +0000 (01:35 +0000)] 
Merge "Allow SQL expression for ORM primary keys"

6 years agoAllow SQL expression for ORM primary keys
Mike Bayer [Mon, 11 Feb 2019 22:00:47 +0000 (17:00 -0500)] 
Allow SQL expression for ORM primary keys

A SQL expression can now be assigned to a primary key attribute for an ORM
flush in the same manner as ordinary attributes as described in
:ref:`flush_embedded_sql_expressions` where the expression will be evaulated
and then returned to the ORM using RETURNING, or in the case of pysqlite,
works using the cursor.lastrowid attribute.Requires either a database that
supports RETURNING (e.g. Postgresql, Oracle, SQL Server) or pysqlite.

Fixes: #3133
Fixes: #4494
Change-Id: I83da8357354de002cb04fa4a553f2a2f90c5157d

6 years agoMerge "Add complete coverage and fix lower() for MySQL 88718 workaround"
mike bayer [Mon, 11 Feb 2019 20:22:27 +0000 (20:22 +0000)] 
Merge "Add complete coverage and fix lower() for MySQL 88718 workaround"

6 years agoAdd complete coverage and fix lower() for MySQL 88718 workaround
Mike Bayer [Mon, 11 Feb 2019 14:07:03 +0000 (09:07 -0500)] 
Add complete coverage and fix lower() for MySQL 88718 workaround

Fixed a second regression caused by :ticket:`4344` (the first was
:ticket:`4361`), which works around MySQL issue 88718, where the lower
casing function used was not correct for Python 2 with OSX/Windows casing
conventions, which would then raise ``TypeError``.  Full coverage has been
added to this logic so that every codepath is exercised in a mock style for
all three casing conventions on all versions of Python. MySQL 8.0 has
meanwhile fixed issue 88718 so the workaround is only applies to a
particular span of MySQL 8.0 versions.

Fixes: #4492
Change-Id: I14e7237e0be4a9c21c58c921066304ae99ac4dc6

6 years agoMerge "Don't run pending_to_persistent for non-new objects"
mike bayer [Sun, 10 Feb 2019 03:57:10 +0000 (03:57 +0000)] 
Merge "Don't run pending_to_persistent for non-new objects"

6 years agoDon't run pending_to_persistent for non-new objects
Mike Bayer [Sat, 9 Feb 2019 06:46:06 +0000 (01:46 -0500)] 
Don't run pending_to_persistent for non-new objects

Fixed fairly simple but critical issue where the
:meth:`.SessionEvents.pending_to_persistent` event would be invoked for
objects not just when they move from pending to persistent, but when they
were also already persistent and just being updated, thus causing the event
to be invoked for all objects on every update.

Fixes: #4489
Change-Id: Ibe147020aa62f7d605cb1029b7f3b776f42e6b43

6 years agoNote for history methods that history is reset per-flush.
Mike Bayer [Sat, 9 Feb 2019 17:22:39 +0000 (12:22 -0500)] 
Note for history methods that history is reset per-flush.

Change-Id: I9bc4d0ddfa93f13e6717b89fa9934f1b8052147f

6 years agomention no_autoflush in the flush section of the docs
Mike Bayer [Fri, 8 Feb 2019 22:48:51 +0000 (17:48 -0500)] 
mention no_autoflush in the flush section of the docs

also remove link to wiki which is obsolete

Change-Id: I9ebd578923c3eba6e35f3b6203c01ba003dd4115

6 years agoVersion 1.3.0 placeholder
Mike Bayer [Fri, 8 Feb 2019 20:19:40 +0000 (15:19 -0500)] 
Version 1.3.0 placeholder

6 years ago- 1.3.0b3 rel_1_3_0b3
Mike Bayer [Fri, 8 Feb 2019 20:12:18 +0000 (15:12 -0500)] 
- 1.3.0b3

6 years agoAdd type stubs link to the docs
Ivan Levkivskyi [Fri, 8 Feb 2019 19:10:19 +0000 (19:10 +0000)] 
Add type stubs link to the docs

Moved by Mike to be a sidebar in the Declarative docs, as
the plugin appears to be specific to Declarative.  These docs will
eventually be moved out of the "extension" section and merged
into the primary narrative documentation.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Idba4c13ffc920b1140b5e51d206ab02f19015e8e

6 years agoUse declarative mapping for the embedded SQL expressions example
Mike Bayer [Thu, 7 Feb 2019 15:19:08 +0000 (10:19 -0500)] 
Use declarative mapping for the embedded SQL expressions example

Change-Id: I1e778409f2d6e50dfba40bafc58e56f3625e7a27
(cherry picked from commit 7816476cdd0a6c83cdd0eeab8698c2469aa0197b)

6 years agoMerge "Remove all remaining text() coercions and ensure identifiers are safe"
mike bayer [Thu, 7 Feb 2019 03:54:44 +0000 (03:54 +0000)] 
Merge "Remove all remaining text() coercions and ensure identifiers are safe"

6 years agoRemove all remaining text() coercions and ensure identifiers are safe
Mike Bayer [Mon, 4 Feb 2019 20:50:29 +0000 (15:50 -0500)] 
Remove all remaining text() coercions and ensure identifiers are safe

Fully removed the behavior of strings passed directly as components of a
:func:`.select` or :class:`.Query` object being coerced to :func:`.text`
constructs automatically; the warning that has been emitted is now an
ArgumentError or in the case of order_by() / group_by() a CompileError.
This has emitted a warning since version 1.0 however its presence continues
to create concerns for the potential of mis-use of this behavior.

Note that public CVEs have been posted for order_by() / group_by() which
are resolved by this commit:  CVE-2019-7164  CVE-2019-7548

Added "SQL phrase validation" to key DDL phrases that are accepted as plain
strings, including :paramref:`.ForeignKeyConstraint.on_delete`,
:paramref:`.ForeignKeyConstraint.on_update`,
:paramref:`.ExcludeConstraint.using`,
:paramref:`.ForeignKeyConstraint.initially`, for areas where a series of SQL
keywords only are expected.Any non-space characters that suggest the phrase
would need to be quoted will raise a :class:`.CompileError`.   This change
is related to the series of changes committed as part of :ticket:`4481`.

Fixed issue where using an uppercase name for an index type (e.g. GIST,
BTREE, etc. ) or an EXCLUDE constraint would treat it as an identifier to
be quoted, rather than rendering it as is. The new behavior converts these
types to lowercase and ensures they contain only valid SQL characters.

Quoting is applied to :class:`.Function` names, those which are usually but
not necessarily generated from the :attr:`.sql.func` construct,  at compile
time if they contain illegal characters, such as spaces or punctuation. The
names are as before treated as case insensitive however, meaning if the
names contain uppercase or mixed case characters, that alone does not
trigger quoting. The case insensitivity is currently maintained for
backwards compatibility.

Fixes: #4481
Fixes: #4473
Fixes: #4467
Change-Id: Ib22a27d62930e24702e2f0f7c74a0473385a08eb

6 years agoRemove all occurrences of the word "password" from all examples and tutorials
Mike Bayer [Tue, 5 Feb 2019 23:24:29 +0000 (18:24 -0500)] 
Remove all occurrences of the word "password" from all examples and tutorials

Fixes: #4484
Change-Id: I97e8cbd9f4906332ac0a4fe9c8496a0147fc9a9b

6 years agoMerge "Improve support for with_polymorphic in mapper options"
mike bayer [Mon, 4 Feb 2019 19:27:31 +0000 (19:27 +0000)] 
Merge "Improve support for with_polymorphic in mapper options"

6 years agoImprove support for with_polymorphic in mapper options
Mike Bayer [Sun, 27 Jan 2019 00:49:44 +0000 (19:49 -0500)] 
Improve support for with_polymorphic in mapper options

Improved the behavior of :func:`.orm.with_polymorphic` in conjunction with
loader options, in particular wildcard operations as well as
:func:`.orm.load_only`.  The polymorphic object will be more accurately
targeted so that column-level options on the entity will correctly take
effect.The issue is a continuation of the same kinds of things fixed in
:ticket:`4468`.

The path logic when using chained mapper options is improved
to be more accurate in terms of the entities being linked
in the path; when using :func:`.with_polymorphic`, mapper
options against this entity need to specify attributes
in terms of the with_polymorphic() object and not against the
base mappings.  New error conditions are raised which were previously
more than likely silenty failures.

Fixes: #4469
Change-Id: Ie8d802879663b4ff6f6ac1438c885c06d78ae2a0

6 years agoAdd bulk_replace to AssociationSet, AssociationDict
Mike Bayer [Sun, 3 Feb 2019 18:29:06 +0000 (13:29 -0500)] 
Add bulk_replace to AssociationSet, AssociationDict

Implemented a more comprehensive assignment operation (e.g. "bulk replace")
when using association proxy with sets or dictionaries.  Fixes the problem
of redundant proxy objects being created to replace the old ones, which
leads to excessive events and SQL and in the case of unique constraints
will cause the flush to fail.

Fixes: #2642
Change-Id: I57ab27dd9feba057e539267722cce92254fca777

6 years agoRepair incorrect issue number
Mike Bayer [Sun, 3 Feb 2019 17:50:09 +0000 (12:50 -0500)] 
Repair incorrect issue number

This reopens #4406 inadvertently closed and fixes #4464, already
released in 1.3.0b2.

Fixes: #4464
Change-Id: I82f3dbdff01fe24ea51a4dda0608c0a284320a57

6 years agoMerge "Remove Nose support"
mike bayer [Sun, 3 Feb 2019 17:45:28 +0000 (17:45 +0000)] 
Merge "Remove Nose support"

6 years agoRemove Nose support
Parth Shandilya [Fri, 1 Feb 2019 04:24:29 +0000 (23:24 -0500)] 
Remove Nose support

The test system has removed support for Nose, which is unmaintained for
several years and is producing warnings under Python 3. The test suite is
currently standardized on Pytest.  Pull request courtesy Parth Shandilya.

Fixes: #4460
Closes: #4476
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4476
Pull-request-sha: e857af9c7d07355e52841149ee2e5d4448409e1e

Change-Id: I76516fae1cf0eb58f2e9fc9f692e591e0fcf39a4

6 years agoRender parenthesis around sqlite expression defaults
Bartlomiej Biernacki [Thu, 31 Jan 2019 14:33:01 +0000 (09:33 -0500)] 
Render parenthesis around sqlite expression defaults

Fixed bug in SQLite DDL where using an expression as a server side default
required that it be contained within parenthesis to be accepted by the
sqlite parser.  Pull request courtesy Bartlomiej Biernacki.

Fixes: #4474
Closes: #4475
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4475
Pull-request-sha: 0af3238c69c2610333cf62082c12047d45c31ce0

Change-Id: I888c69bfba5a5ab8ffa420f512557ac311a36b31
(cherry picked from commit f7ce37e9dd493d4b60b3156f08ef4c98fd63904d)

6 years agorepair F632 issue
Mike Bayer [Sat, 2 Feb 2019 02:34:53 +0000 (21:34 -0500)] 
repair F632 issue

in b8f9517cddf41dbb47ae4ad120141c7ab1a29ac5 we disabled this new error
coming up, but it's just this one line in a test that is in fact wrong.

Change-Id: I4e3612596e9735c7db066832d13ccb454c93808f

6 years agoMerge "Add informative failure modes to _DeferredMapperConfig"
mike bayer [Thu, 31 Jan 2019 16:09:41 +0000 (16:09 +0000)] 
Merge "Add informative failure modes to _DeferredMapperConfig"

6 years agoAdded a link for Candidate Keys
Ben Brumm [Wed, 30 Jan 2019 19:05:01 +0000 (06:05 +1100)] 
Added a link for Candidate Keys

(cherry picked from commit 4421688162302af2c90ed7d1daf17161daded1e6)

Change-Id: Ifb74aec34c4db27cd496f081c8fd6d872b9addd4

6 years agoAdd informative failure modes to _DeferredMapperConfig
Mike Bayer [Wed, 30 Jan 2019 05:53:10 +0000 (23:53 -0600)] 
Add informative failure modes to _DeferredMapperConfig

Added some helper exceptions that invoke when a mapping based on
:class:`.AbstractConcreteBase`, :class:`.DeferredReflection`, or
:class:`.AutoMap` is used before the mapping is ready to be used, which
contain descriptive information on the class, rather than falling through
into other failure modes that are less informative.

Fixes: #4470
Change-Id: I9bc51697f63cedaa7809a0adb17b2398c209e289

6 years agoAdd F632 another issue that just popped up
Mike Bayer [Thu, 31 Jan 2019 03:04:47 +0000 (21:04 -0600)] 
Add F632 another issue that just popped up

Change-Id: I4658615f450ed670bbde39e085e1b1f913e3736f

6 years agoadd F821 which for some reason is some new thing flake8 wants to complain about
Mike Bayer [Thu, 31 Jan 2019 03:00:36 +0000 (21:00 -0600)] 
add F821 which for some reason is some new thing flake8 wants to complain about

Change-Id: I27df129ae883d75217ec07ff6d0139447444cc60

6 years agoFix typo: issue is #4442, not #4222 4471/head
Ville Brofeldt [Tue, 29 Jan 2019 10:50:43 +0000 (12:50 +0200)] 
Fix typo: issue is #4442, not #4222

6 years agoremove py36 from test profiles
Mike Bayer [Sun, 27 Jan 2019 05:55:54 +0000 (00:55 -0500)] 
remove py36 from test profiles

Since we aren't regenerating for py36 we need to take the
obsolete numbers out also.

Change-Id: I67c4268bcec63d7d3a03ab757674780ee8693677

6 years agoMerge "Ensure of_type subclass taken into account with wildcards"
mike bayer [Sat, 26 Jan 2019 22:21:46 +0000 (22:21 +0000)] 
Merge "Ensure of_type subclass taken into account with wildcards"

6 years agoEnsure of_type subclass taken into account with wildcards
Mike Bayer [Sat, 26 Jan 2019 19:53:45 +0000 (14:53 -0500)] 
Ensure of_type subclass taken into account with wildcards

Fixed a regression in 1.2 where a wildcard/load_only loader option would
not work correctly against a loader path where of_type() were used to limit
to a particular subclass.  The fix only works for of_type() of a simple
subclass so far, not a with_polymorphic entity which will be addressed in a
separate issue; it is unlikely this latter case was working previously.

Since we ensure that the entity is broken out into its superclasses
when a wilcard is encountered, we can limit the entity path to the
specific entity given in this case.

Within this issue some additional issues with with_polymorphic()
loaders were found which will be addressed in #4469.

Fixes: #4468
Change-Id: Ie91ec27b49104e019636f870776e294321586a9e

6 years agoVersion 1.3.0b3 placeholder
Mike Bayer [Sat, 26 Jan 2019 02:51:35 +0000 (21:51 -0500)] 
Version 1.3.0b3 placeholder

6 years ago- 1.3.0b2 rel_1_3_0b2
Mike Bayer [Sat, 26 Jan 2019 02:40:01 +0000 (21:40 -0500)] 
- 1.3.0b2

6 years agoVersion 1.2.18 placeholder
Mike Bayer [Sat, 26 Jan 2019 02:32:00 +0000 (21:32 -0500)] 
Version 1.2.18 placeholder

(cherry picked from commit d196c49918ee1e7fbce12e228aa7db33d098908f)

6 years ago- 1.2.17
Mike Bayer [Sat, 26 Jan 2019 02:16:56 +0000 (21:16 -0500)] 
- 1.2.17

(cherry picked from commit 47c245b90cd3cfe76bc0cf078f740d12bf7ba2d1)

6 years agoFix timeout method doc to be for QueuePool
Mike Bayer [Sat, 26 Jan 2019 02:30:55 +0000 (21:30 -0500)] 
Fix timeout method doc to be for QueuePool

Change-Id: I14d4e623a5761963e10bb8f5d99a8ca3684db61b

6 years agoImprove error messages in the area of loader options
Mike Bayer [Wed, 9 Jan 2019 07:01:16 +0000 (02:01 -0500)] 
Improve error messages in the area of loader options

Improved error messages emitted by the ORM in the area of loader option
traversal.  This includes early detection of mis-matched loader strategies
along with a clearer explanation why these strategies don't match.

Fixes: #4433
Change-Id: I3351b64241f7f62ca141a0be95085e6ef8ca6d32

6 years agoFix some long lines that sneaked in with the spelling fixes change
Mike Bayer [Fri, 25 Jan 2019 20:13:48 +0000 (15:13 -0500)] 
Fix some long lines that sneaked in with the spelling fixes change

Change-Id: Icc6d8e564c9d31da2adc39d060e077c3d4811186

6 years agoFix many spell glitches
Lele Gaifax [Mon, 14 Jan 2019 16:26:33 +0000 (11:26 -0500)] 
Fix many spell glitches

This affects mostly docstrings, except in orm/events.py::dispose_collection()
where one parameter gets renamed: given that the method is
empty, it seemed reasonable to me to fix that too.

Closes: #4440
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4440
Pull-request-sha: 779ed75acb6142e1f1daac467b5b14134529bb4b

Change-Id: Ic0553fe97853054b09c2453af76d96363de6eb0e

6 years agoMerge "Add getters for all execution_options"
mike bayer [Fri, 25 Jan 2019 19:55:25 +0000 (19:55 +0000)] 
Merge "Add getters for all execution_options"

6 years agoMerge "Fix mssql quote schema warning"
mike bayer [Fri, 25 Jan 2019 19:54:14 +0000 (19:54 +0000)] 
Merge "Fix mssql quote schema warning"

6 years agoMerge "Implement relationship to AliasedClass; deprecate non primary mappers"
mike bayer [Fri, 25 Jan 2019 16:58:08 +0000 (16:58 +0000)] 
Merge "Implement relationship to AliasedClass; deprecate non primary mappers"

6 years agoFix mssql quote schema warning
Mike Bayer [Fri, 25 Jan 2019 16:36:54 +0000 (11:36 -0500)] 
Fix mssql quote schema warning

The deprecations review didn't include tests of identifier_preparer.quote.force
for backends, so MSSQL slipped through.  We have to fully reimplement
the deprecation warning here so that it passes tests which are now
enabled for all backends.

Change-Id: I9d07e6766e16b5a35b7f7566f1daf94b04346270

6 years agoAdd getters for all execution_options
Daniel Lister [Thu, 24 Jan 2019 21:35:16 +0000 (16:35 -0500)] 
Add getters for all execution_options

Added accessors for execution options to Core and ORM, via
:meth:`.Query.get_execution_options`,
:meth:`.Connection.get_execution_options`,
:meth:`.Engine.get_execution_options`, and
:meth:`.Executable.get_execution_options`.  PR courtesy Daniel Lister.

Fixes: #4406
Closes: #4465
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4465
Pull-request-sha: 9674688bb5e80471a6a421bac06f995c2e64f8f7

Change-Id: I93ba51d7a2d687e255edd6938db15615e56dd237

6 years agoMerge "Use pg_get_constraintdef for CHECK constraint reflection"
mike bayer [Fri, 25 Jan 2019 14:30:54 +0000 (14:30 +0000)] 
Merge "Use pg_get_constraintdef for CHECK constraint reflection"