]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
6 years agoImprove docstrings for AtributeEvents re: propagate flag
Mike Bayer [Wed, 22 May 2019 15:43:01 +0000 (11:43 -0400)] 
Improve docstrings for AtributeEvents re: propagate flag

Make sure the flag is illustrated as well as that every event
has a seealso encouraging the user to look at the top level
listen options.

Fixes: #4691
Change-Id: I137bd74e5d93971bbd04758c7a022a026e13b423
(cherry picked from commit 999bd50753a46785d8031d080af661f608b867c5)

6 years agoAdd .pre-commit-config.yaml
Mike Bayer [Sat, 18 May 2019 14:47:39 +0000 (10:47 -0400)] 
Add .pre-commit-config.yaml

See https://pre-commit.com/ for documentation on how to use
this file.

SQLAlchemy and related projects make use of Black and zimports
for code formatting, this hook allows for automated pre-commit
runs.

Change-Id: I4bbb49747e9f7fb52251dc61ecda98361cd036fd
(cherry picked from commit 69ebf2cc365baf82016c9d1672fe89e39594b523)

6 years agoDocument and test modification of .values in before_compile_update
Mike Bayer [Thu, 16 May 2019 00:27:30 +0000 (20:27 -0400)] 
Document and test modification of .values in before_compile_update

Change-Id: I2a694bcf24b06806dc98651015e7c7a8b090ff65
(cherry picked from commit 89e6beaf46ebdd626e292eb20f7b6ae0c3a9ae5c)

6 years agoFixes typo in core/connections.rst
Michael J Ward [Tue, 23 Apr 2019 20:44:06 +0000 (15:44 -0500)] 
Fixes typo in core/connections.rst

The generated sql was using the incorrect `user_schema` instead
of the correct `user_schema_one` translated table name.

(cherry picked from commit 9bba68a5a70d9e58bbc7490f7313c3b9dc2bb9ba)

6 years ago- fix long line
Mike Bayer [Fri, 10 May 2019 00:32:04 +0000 (20:32 -0400)] 
- fix long line

Change-Id: If44d364ae02da447169a3dc51b6514225578cf82
(cherry picked from commit 3abced7bd2842d41e17f438a65efc15aa71d4bb4)

6 years ago- remove references to nose
Mike Bayer [Thu, 9 May 2019 15:57:12 +0000 (11:57 -0400)] 
- remove references to nose

Change-Id: I970cc257dfb1c69413fa1c5593ba523ffc5070d4
(cherry picked from commit 1a3792c3b3af9b945862686b6d54a855342a5331)

6 years agoAdd documentation for MySQL optimizer hints using prefix_with
Mike Bayer [Wed, 8 May 2019 15:40:12 +0000 (11:40 -0400)] 
Add documentation for MySQL optimizer hints using prefix_with

Fixes: #4667
Change-Id: Iac3345319dc7c5a20bc7a6520492d2f341b64807
(cherry picked from commit c608c3f2f8af0e4cd9e2ffbd3b6f7f487e785282)

6 years agoInclude GenericTypeCompiler in docs
Bjørnar Myrheim [Wed, 1 May 2019 07:39:26 +0000 (09:39 +0200)] 
Include GenericTypeCompiler in docs

Fixes: #4411
Change-Id: Ic60e78555651d05ff0492650bd7647685b867671
Closes: #4651
(cherry picked from commit cdd01a06f7cf5e9ce35544a02c182eca4015992c)

6 years agoremote_attr and local_attr refer to class bound attributes, not MapperProperty
Mike Bayer [Thu, 25 Apr 2019 22:24:27 +0000 (17:24 -0500)] 
remote_attr and local_attr refer to class bound attributes, not MapperProperty

backport from master

Change-Id: If3ffe0945f47010e1ddecabfc27a6e7707031fd9

6 years agoUse "parent object" instead of "primary object"
vpsx [Wed, 17 Apr 2019 23:48:40 +0000 (18:48 -0500)] 
Use "parent object" instead of "primary object"

(cherry picked from commit 6758a459597e5221607a81a693bd98352bb1c94f)

6 years agoVersion 1.2.20 placeholder
Mike Bayer [Mon, 15 Apr 2019 16:29:31 +0000 (12:29 -0400)] 
Version 1.2.20 placeholder

6 years ago- 1.2.19 rel_1_2_19
Mike Bayer [Mon, 15 Apr 2019 16:08:35 +0000 (12:08 -0400)] 
- 1.2.19

6 years agoUpdate link for cx_Oracle
Mike Bayer [Fri, 5 Apr 2019 14:20:08 +0000 (10:20 -0400)] 
Update link for cx_Oracle

Fixes: #4596
Change-Id: I80205d51fe500520030f2c94c06363e1fb6f9c65
(cherry picked from commit 1ec2f7cfd6c1fa8acf9a41330df597af99dcadc7)

6 years agoImprove documentation for connection pool logging
jaskiratsingh [Fri, 5 Apr 2019 13:51:12 +0000 (09:51 -0400)] 
Improve documentation for connection pool logging

Also do a general pass for logging + doc formatting,
add more cross-linking and remove obsolete information such
as "echo_uow"/

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

Change-Id: I03f7354a4ef55fd8b6a51d03a280579f36e8a06c
(cherry picked from commit 2b25827b8455aaaa8c73180d0c26afb3e3187adc)

6 years agoEnhance documentation for string compilation use cases
Mike Bayer [Fri, 5 Apr 2019 01:43:12 +0000 (21:43 -0400)] 
Enhance documentation for string compilation use cases

- Add a web link for UnsupportedCompilationError
- Add new section to errors.rst
- add more detail and cross-linking to the FAQ
- include security caveats for parameter rendering

Fixes: #4595
Change-Id: I31ea57c18d65770cd2a51276bbe2847a9eb72bba
(cherry picked from commit 6845be0927245e47c27f8e160472cf9a55a41dc4)

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
(cherry picked from commit e209df356a38a1885f2b0fdab3c5d7e7d58837d9)

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
(cherry picked from commit cbc31716c2cef29f45506c6227c2154e3093c845)

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
(cherry picked from commit 312d529dbbaa9bb7d8d804280cb39797c6402931)

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
(cherry picked from commit 203de6946ef09b9fed2875491d2ac087a6dbfec6)

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
(cherry picked from commit 66373c58118dc70ef59ff60c0516ef158966c47b)

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

(cherry picked from commit 4f62c23cf3ce667376ceb6b0a50240c4f1c19220)

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
(cherry picked from commit 9268c320bf6ea35696951875df518286dd79ad54)

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

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
(cherry picked from commit a3135c494e510095c938d0e7a08c4ffc0b4bb364)

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
(cherry picked from commit d71f34cb2a28e8dfc410bc5bec68372be6d7c333)

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
(cherry picked from commit 5fe9da55c72effe8f8425be339375dd904277ef2)

6 years agoVersion 1.2.19 placeholder
Mike Bayer [Fri, 15 Feb 2019 18:08:58 +0000 (13:08 -0500)] 
Version 1.2.19 placeholder

6 years ago- 1.2.18 rel_1_2_18
Mike Bayer [Fri, 15 Feb 2019 17:39:47 +0000 (12:39 -0500)] 
- 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
(cherry picked from commit c1b87bc95dbd79cb9e3fb83992295a9189ec7645)

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
(cherry picked from commit 12dad561a77506fe262d791d3135babc0be50e66)

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
(cherry picked from commit 71d642711d26ee8e1e7e8b19d70be8be1eca22eb)

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
(cherry picked from commit 49197c7b36573d91b015019d4635071f9da1c216)

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
(cherry picked from commit b2afef966dcc44e991f22a8fb68de4f1220bd674)

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
(cherry picked from commit 833583458c69e24e797c300c934da0ff04348db5)

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
(cherry picked from commit fcb5dbf39569bcacb70a3fed05f469d73b64f116)

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 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
(cherry picked from commit b956a323cdbd9d4bacd515c0d05487adfba93ab0)

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)
(cherry picked from commit 620bfde695079eeab35467086956764616de037c)

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
(cherry picked from commit 5ae8a54ed381735a88141b8ec5326b21c36e793b)

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
(cherry picked from commit 06d952950975f71d86a43bbc4f2cbd9edccbc7ee)

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
(cherry picked from commit b8f9517cddf41dbb47ae4ad120141c7ab1a29ac5)

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
(cherry picked from commit 1e29997dccd615aed45ed6fee80c9c1d78a16ecf)

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
(cherry picked from commit 29e033f496c28e4d7b9a5bfc46096711f0aa5571)

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

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

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
(cherry picked from commit 66e88d30a86fc37e2eaf7367e988ced3834e3250)

6 years agoUse pg_get_constraintdef for CHECK constraint reflection
Mike Bayer [Thu, 24 Jan 2019 21:56:44 +0000 (16:56 -0500)] 
Use pg_get_constraintdef for CHECK constraint reflection

Revised the query used when reflecting CHECK constraints to make use of the
``pg_get_constraintdef`` function, as the ``consrc`` column is being
deprecated in PG 12.  Thanks to John A Stevenson for the tip.

Fixes: #4463
Change-Id: Ie0ee9bdfddb0635db72b35c2e2e4b27f154162fd
(cherry picked from commit 377f12696bb1af17bb14f676a49ef21428d537d3)

6 years agoAdd QueryEvents before_compile_update / before_compile_delete
Mike Bayer [Wed, 23 Jan 2019 02:49:07 +0000 (21:49 -0500)] 
Add QueryEvents before_compile_update / before_compile_delete

Added new event hooks :meth:`.QueryEvents.before_compile_update` and
:meth:`.QueryEvents.before_compile_delete` which complement
:meth:`.QueryEvents.before_compile` in the case of the :meth:`.Query.update`
and :meth:`.Query.delete` methods.

Fixes: #4461
Change-Id: I47884f0e1f07d7e62870c2a918b15f917f9245ab
(cherry picked from commit bd735eba637cbf2c157046f72dc795a8b2b803e7)

6 years agoDon't use cx_Oracle.NATIVE_INT in output type handlers
Mike Bayer [Sat, 19 Jan 2019 02:30:21 +0000 (21:30 -0500)] 
Don't use cx_Oracle.NATIVE_INT in output type handlers

Fixed regression in integer precision logic due to the refactor of the
cx_Oracle dialect in 1.2.  We now no longer apply the cx_Oracle.NATIVE_INT
type to result columns sending integer values (detected as positive
precision with scale ==0) which encounters integer overflow issues with
values that go beyond the 32 bit boundary.  Instead, the output variable
is left untyped so that cx_Oracle can choose the best option.

Fixes: #4457
Change-Id: I1e3114c2f37bf028fb1f521a3e9789a77e3a7491
(cherry picked from commit 5832f7172907a8151345d95061f93784ce4bb9b1)

6 years agoRegenerate callcounts for mysqlclient 1.4.0
Mike Bayer [Fri, 18 Jan 2019 20:46:41 +0000 (15:46 -0500)] 
Regenerate callcounts for mysqlclient 1.4.0

For 1.2, also bump Python versions to 3.7

Fixes: #4455
Change-Id: I396230f649f6bb5e396798e63339fcecb3b85eaf

6 years agoMerge "Adapt single inh criteria more specifically" into rel_1_2
mike bayer [Fri, 18 Jan 2019 16:31:25 +0000 (16:31 +0000)] 
Merge "Adapt single inh criteria more specifically" into rel_1_2

6 years agoFeature mysqlclient
Mike Bayer [Fri, 18 Jan 2019 06:02:07 +0000 (01:02 -0500)] 
Feature mysqlclient

MySQL-Python hasn't been released in about five years and there
is no reason that it should be listed as a viable DBAPI;
all MySQL / MariaDB users should be using mysqlclient or PyMySQL today.

Change-Id: I2f12babe6e60bc7393398400a125d0592e86dbb8
(cherry picked from commit 894acf7b8eaa166a6ec231d0a139c699239b5008)

6 years agoAdd example of password URL encoding
Mike Bayer [Fri, 18 Jan 2019 05:53:55 +0000 (00:53 -0500)] 
Add example of password URL encoding

Fixes: #4452
Change-Id: I6d6ef36c4a0aa1e7c064b8aed289a1ce79b5120f
(cherry picked from commit 77a932e321ce402a2c4550d4788c5fdeab8aaa9b)

6 years agolink the psycopg2 fast execution document to the Core tutorial executemany section
Mike Bayer [Fri, 18 Jan 2019 05:35:00 +0000 (00:35 -0500)] 
link the psycopg2 fast execution document to the Core tutorial executemany section

Fixes: #4109
Change-Id: I62fcb703b552db842be335c8f9257cc0e8c5cdd5
(cherry picked from commit 5ea803494a8c8fe93474d33758ca64687b275e4d)

6 years agoAdapt single inh criteria more specifically
Mike Bayer [Fri, 18 Jan 2019 01:08:10 +0000 (20:08 -0500)] 
Adapt single inh criteria more specifically

Fixed issue where when using single-table inheritance in conjunction with a
joined inheritance hierarchy that uses "with polymorphic" loading, the
"single table criteria" for that single-table entity could get confused for
that of other entities from the same hierarchy used in the same query.The
adaption of the "single table criteria" is made more specific to the target
entity to avoid it accidentally getting adapted to other tables in the
query.

Change-Id: Ia9f915a4b01e8bb9cee365c4c70e00c626f103c4
Fixes: #4454
(cherry picked from commit c8d7141c79829f36e123bf3e4be1721dd34aaeb4)

6 years agoRepair use of deprecated text() typemap, bindparams parameters
Mike Bayer [Thu, 17 Jan 2019 18:16:04 +0000 (13:16 -0500)] 
Repair use of deprecated text() typemap, bindparams parameters

These will emit a deprecation warning once
If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b is merged, modernize these
ahead of time as this should likely be backported to 1.2 as well.

Change-Id: Iae4426a856d5617e8a325b14d8b6fc22333f2cda
(cherry picked from commit d038f66b2aa31db8fec0883769f6a86bd0353d3b)

6 years ago- pep8 fix
Mike Bayer [Thu, 17 Jan 2019 01:20:45 +0000 (20:20 -0500)] 
- pep8 fix

Change-Id: I5e2e013c3460c035ad80dae7fd08efe5d1676a5d
(cherry picked from commit 313be7c78db070169bd863948f922c74871d7000)

6 years agoConvert most "See also" phrases into .. seealso::
Mike Bayer [Tue, 15 Jan 2019 21:12:39 +0000 (16:12 -0500)] 
Convert most "See also" phrases into .. seealso::

Change-Id: Ie32598b895c1c5f5bce7c8e1573abbcfe9d434a8
(cherry picked from commit e81d3815abb36c52b0019dee6e4f67990e3d1c7d)

6 years agoRemove version directives for 0.6, 0.7, 0.8
Mike Bayer [Tue, 15 Jan 2019 15:49:36 +0000 (10:49 -0500)] 
Remove version directives for 0.6, 0.7, 0.8

- fix a few "seealso"s
- ComparableProprerty's "superseded in 0.7" becomes deprecated in 0.7

Backport to currently maintained doc versions 1.2, 1.1

Change-Id: Ib1fcb2df8673dbe5c4ffc47f3896a60d1dfcb4b2
(cherry picked from commit 885f15a306efc4c907ca82fa13871992ee556466)

6 years agocorrect paramref to property links to refer to creation function
Mike Bayer [Sun, 13 Jan 2019 17:36:21 +0000 (12:36 -0500)] 
correct paramref to property links to refer to creation function

Change-Id: I2c528bd4639863aa7b8a592beed776d53bab3e5c
(cherry picked from commit b229a50c7786d8cbe65a2bf471b57a806f4259e3)

6 years agouse ..deprecated directive w/ version in all cases
Mike Bayer [Tue, 8 Jan 2019 22:46:55 +0000 (17:46 -0500)] 
use ..deprecated directive w/ version in all cases

These changes should be ported from 1.3 back to 1.0 or
possibly 0.9 to the extent they are relevant in each
version. In 1.3 we hope to turn all deprecation documentation
into warnings.

(cherry picked from commit 77e9534673d58f2f4c33d16c0ed4e8671cea48b6)
Change-Id: I205186cde161af9389af513a425c62ce90dd54d8

6 years agoVersion 1.2.17 placeholder
Mike Bayer [Fri, 11 Jan 2019 15:15:39 +0000 (10:15 -0500)] 
Version 1.2.17 placeholder

6 years ago- 1.2.16 rel_1_2_16
Mike Bayer [Fri, 11 Jan 2019 15:09:04 +0000 (10:09 -0500)] 
- 1.2.16

6 years agohappy new year
Mike Bayer [Fri, 11 Jan 2019 15:06:10 +0000 (10:06 -0500)] 
happy new year

Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911
(cherry picked from commit 6f270fb0e344016ce526e0a1ecb3e3de9ffd1e3b)

6 years agoLeave bytestring exception messages as bytestrings
Mike Bayer [Thu, 10 Jan 2019 17:03:40 +0000 (12:03 -0500)] 
Leave bytestring exception messages as bytestrings

Fixed a regression introduced in version 1.2 where a refactor
of the :class:`.SQLAlchemyError` base exception class introduced an
inappropriate coercion of a plain string message into Unicode under
python 2k, which is not handled by the Python interpreter for characters
outside of the platform's encoding (typically ascii).  The
:class:`.SQLAlchemyError` class now passes a bytestring through under
Py2K for ``__str__()`` as is the behavior of exception objects in general
under Py2K, does a safe coercion to unicode utf-8 with
backslash fallback for ``__unicode__()``.  For Py3K the message is
typically unicode already, but if not is again safe-coerced with utf-8
with backslash fallback for the ``__str__()`` method.

Fixes: #4429
Change-Id: I2289da3f2c45c7d0041fa43d838958f7614defc3
(cherry picked from commit 2db54ee92ebd0970f52b271e152a6df9b563693f)

6 years agoSkip expression-based index reflection for SQLite
Mike Bayer [Wed, 9 Jan 2019 16:42:02 +0000 (11:42 -0500)] 
Skip expression-based index reflection for SQLite

Reflection of an index based on SQL expressions are now skipped with a
warning, in the same way as that of the Postgresql dialect, where we currently
do not support reflecting indexes that have SQL expressions within them.
Previously, an index with columns of None were produced which would break
tools like Alembic.

Fixes: #4431
Change-Id: I1363ade912d206b42669331e2be2bb6f444b65a2
(cherry picked from commit 08994cb97c501a3cf984fd827eba9aa9614b9dd3)

6 years agoRender correct DDL for unsetting table comments
Mike Bayer [Wed, 9 Jan 2019 16:18:02 +0000 (11:18 -0500)] 
Render correct DDL for unsetting table comments

Fixed issue where the DDL emitted for :class:`.DropTableComment`, which
will be used by an upcoming version of Alembic, was incorrect for the MySQL
and Oracle databases.

Fixes: #4436
Change-Id: I196de09495a37adface4caa9dcbc29a6d0ad159a
(cherry picked from commit 2a840c147e49d833f8a11de3964a0a8588d72508)

6 years agoUpdate index.rst - Added link to Drill dialect.
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.

(cherry picked from commit 86f243a8747c28f87dce5d34fb42501ddfb5d387)

6 years agoPost black reformatting
Mike Bayer [Sun, 6 Jan 2019 06:32:41 +0000 (01:32 -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 ago Run black -l 79 against all source files
Mike Bayer [Sun, 6 Jan 2019 06:31:01 +0000 (01:31 -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
(cherry picked from commit 404e69426b05a82d905cbb3ad33adafccddb00dd)

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
(cherry picked from commit d229360a8d4071c2f150558897f37e13eb09f430)

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
(cherry picked from commit 1eaf9dc7776b9833a9fb62fe630b4b9ac63a31f4)

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
(cherry picked from commit c0f9708fde39175c8695fdd87873464f516fdf98)

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
(cherry picked from commit 16f08cbed5ff4f0f0b08dbd0dbd6e49aaee79163)

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
(cherry picked from commit eae62d00049a24c028ba95e13b5199cfa59a1180)

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
(cherry picked from commit c495769751e8b19d54fb92388ced587b5d13b85d)

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
(cherry picked from commit 0b0a4c8ba2465fce5fa1954a0d31b44840f1b4b8)

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
(cherry picked from commit 7f12f63c3a8c77715135126aac88ac6055b279c0)

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
(cherry picked from commit b1e4b597811768378d964e16bd142e8ee8c448d8)

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
(cherry picked from commit d4a130bb1b92869efe33675262c7b1fde364e477)

6 years agoVersion 1.2.16 placeholder
Mike Bayer [Tue, 11 Dec 2018 21:56:37 +0000 (16:56 -0500)] 
Version 1.2.16 placeholder

6 years ago- 1.2.15 rel_1_2_15
Mike Bayer [Tue, 11 Dec 2018 21:49:28 +0000 (16:49 -0500)] 
- 1.2.15

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
(cherry picked from commit 099f3fd812ff4424f90f3c2b41ddce7049a54022)

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
(cherry picked from commit 5851bf113821af6ce2e61484f103a44f4fabe430)

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
(cherry picked from commit c89729cf67f441359da8289104050b01eb53160b)

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
(cherry picked from commit 09856b911ba52befc330676ad831d7829f88ef20)

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

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
(cherry picked from commit 89f95e9badb260b78a7f1f7487feb6f9811ae06b)

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

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
(cherry picked from commit eacb31a89fe883edd0ada7f2724239c1f8c5b685)

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
(cherry picked from commit 87cdda008673e01e2c32049f103e9cdebd2a5d77)

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
(cherry picked from commit 46f9c3c7d4d2c31f3f1627dcf777bd3215e13e3d)

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

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

typo

(cherry picked from commit 0a0b36686d5da0e7d04974c8df0ece574b71f3cb)

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
(cherry picked from commit 6a8454ded311010927af04db30a57d683cf67dd4)

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
(cherry picked from commit 6837e875a3367b466e2ce04ca16c7bff8fa5c575)

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

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
(cherry picked from commit 50417cf758508e970f3fccc99af6a501ceac8eb2)

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
(cherry picked from commit 6ec40eca1a03a9156ee82f3ce75850778220b39e)