]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
4 years agoAdd complete platform data to profiling data
Federico Caselli [Mon, 27 Jul 2020 19:57:32 +0000 (21:57 +0200)] 
Add complete platform data to profiling data

Initially to distinsuish between arm and x86_64
architecture, expand out the profile key to include
machine, system, python impl in all cases.

For 1.3, also bump cpython version to 3.8 to match CI

Ref: #5436
Change-Id: I7e48f0462ba7d9c680b2dac45ce7b0cf709b9b22
(cherry picked from commit 24a9e6974c177e90d2213080b1f6d8270d78f69b)

4 years agoInclude bulk update/delete in RoutingSession example
Mike Bayer [Fri, 7 Aug 2020 16:32:50 +0000 (12:32 -0400)] 
Include bulk update/delete in RoutingSession example

Fixes: #5407
Change-Id: Ia0965dbc88d744cded5c23021898388f2cf95f8d
(cherry picked from commit 7f52c10357cbc98e467f317128b3fea2018eaf7c)

4 years agobase all_orm_descriptors ordering on cls.__dict__ + cls.__mro__
Mike Bayer [Thu, 6 Aug 2020 19:53:17 +0000 (15:53 -0400)] 
base all_orm_descriptors ordering on cls.__dict__ + cls.__mro__

Adjusted the workings of the :meth:`_orm.Mapper.all_orm_descriptors`
accessor to represent the attributes in the order that they are located in
a deterministic way, assuming the use of Python 3.6 or higher which
maintains the sorting order of class attributes based on how they were
declared.   This sorting is not guaranteed to match the declared order of
attributes in all cases however; see the method documentation for the exact
scheme.

Fixes: #5494
Change-Id: I6ee8d4ace3eb8b3f7c9c0f2a3d7e27b5f62abfd3
(cherry picked from commit 9a3fee2cb6b608eb5c0263cf5a7e9085f74f2e73)

4 years agoFixes for MySQL 8
Mike Bayer [Thu, 6 Aug 2020 00:32:02 +0000 (20:32 -0400)] 
Fixes for MySQL 8

MySQL 8.0.19 has some changes to how it reports on display widths
for int types (seems like it omits it in some cases), and also
no longer cares about the length for YEAR.   Another adjustment
to the ordering of constraints reported in one case also.
At least one CI machine is at 8.0.21 now.

Change-Id: Ie2101bed3ad75dcbb62cd05abe95ef14ad895cf5
(cherry picked from commit 5668fd73ea51bffbccb8b1ae8923ef2d545efacb)

4 years agoAdd MariaDB 1927 to is_disconnect codes
Mike Bayer [Wed, 5 Aug 2020 14:31:21 +0000 (10:31 -0400)] 
Add MariaDB 1927 to is_disconnect codes

Added MariaDB code 1927 to the list of "disconnect" codes, as recent
MariaDB versions apparently use this code when the database server was
stopped.

Fixes: #5493
Change-Id: I63f1d692f36cb0411ead278556e3f8c64ab72ea4
(cherry picked from commit 2a946254023135eddd222974cf300ffaa5583f02)

4 years agofix formatting
Mike Bayer [Tue, 4 Aug 2020 14:40:46 +0000 (10:40 -0400)] 
fix formatting

Change-Id: I8315cfef6e5c4b87d64fc770998a1229cc690870
(cherry picked from commit c813fe1678c4edbce32f0652353ed70f0a14566f)

4 years agoAdd note that fast_executemany uses memory
Mike Bayer [Tue, 4 Aug 2020 14:13:51 +0000 (10:13 -0400)] 
Add note that fast_executemany uses memory

Ideally this would be a per-execution option, or Pyodbc
could perhaps run the data in chunks.

Fixes: #5334
Change-Id: If4a11b312346b8e4c2b8cd38840b3a2ba56dec3b
(cherry picked from commit 64f3c097970dd8f2e141ef9bc71c685b19671267)

4 years agoMerge "Improve github action workflows" into rel_1_3
mike bayer [Sun, 2 Aug 2020 00:11:46 +0000 (00:11 +0000)] 
Merge "Improve github action workflows" into rel_1_3

4 years agoMerge "Consider default FROM DUAL for MySQL" into rel_1_3
mike bayer [Wed, 29 Jul 2020 18:44:40 +0000 (18:44 +0000)] 
Merge "Consider default FROM DUAL for MySQL" into rel_1_3

4 years agoConsider default FROM DUAL for MySQL
Mike Bayer [Tue, 28 Jul 2020 20:46:53 +0000 (16:46 -0400)] 
Consider default FROM DUAL for MySQL

MySQL claims it doesn't require FROM DUAL for no
FROM clause even though the issue at #5481 locates
a case which requires one.  See if FROM DUAL the same
way as Oracle without attempting to guess is potentially
feasible.

Fixes: #5481
Change-Id: I2a28876c10a8ce2d121cd344dcdd837db321d4ab
(cherry picked from commit 59b65b3008de5d6c5e4318846d04e50e5851e957)

4 years agoPassive deletes edits
Mike Bayer [Wed, 29 Jul 2020 17:14:49 +0000 (13:14 -0400)] 
Passive deletes edits

Change-Id: I863df033cae9bda4ce96d446a92984ae82797565
(cherry picked from commit 1ec03c15234f54a4d6387141a99b24bedf3b13c2)

4 years agoRemove errant link
Mike Bayer [Wed, 29 Jul 2020 16:51:29 +0000 (12:51 -0400)] 
Remove errant link

The link to "passive_deletes" has moved in
9e1ee412b8650761af6df993e119906682604728 however the tag
stayed here and caused a self link.

Fixes: #5484
Change-Id: I3ac5970be30504367294b9e9a83eb5a2c579cc71
(cherry picked from commit 4ac56e6ca3bbf5c42e4c187460bf7109e09992a2)

4 years agoImprove github action workflows
Federico Caselli [Mon, 27 Jul 2020 20:31:29 +0000 (22:31 +0200)] 
Improve github action workflows

- in create wheel set minimum versions of setuptools and wheel to avoid
  failure in python 3.5 with metadata configured in setup.cfg
- update action versions
- test also cext in the pull requests

Change-Id: Iaa5e4e4000c7faa688b51f2f41428c7dd7cae9c3
(cherry picked from commit 8e89f040391cddad1bec9002bbb6b3c39f43445e)

4 years agoEnsure is_comparison passed for PG RANGE op() methods
Jim Bosch [Sun, 26 Jul 2020 20:50:14 +0000 (16:50 -0400)] 
Ensure is_comparison passed for PG RANGE op() methods

Fixed issue where the return type for the various RANGE comparison
operators would itself be the same RANGE type rather than BOOLEAN, which
would cause an undesirable result in the case that a
:class:`.TypeDecorator` that defined result-processing behavior were in
use.  Pull request courtesy Jim Bosch.

Fixes: #5476
Closes: #5477
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5477
Pull-request-sha: 925b117e0c91cdd67d9ddbd9d65f5ca3e88af91f

Change-Id: I52ab4d4362d379c8253990f9d328a40990a64520
(cherry picked from commit 07e57a0330fb7b1bbe0c59f442111a34e4b7c960)

4 years agoImprove delete cascade and passive deletes sections
Mike Bayer [Sun, 26 Jul 2020 17:17:56 +0000 (13:17 -0400)] 
Improve delete cascade and passive deletes sections

Add cross linking from Core to ORM and also add new sections
and examples regarding many-to-many.    Move the section
out of "collections" and into the "cascades" chapter
where it's more likely to be found.

Change-Id: If29360e463e5745279bc5335bd12352d50ad8953
(cherry picked from commit 9e1ee412b8650761af6df993e119906682604728)

4 years agoUpdate docs with actual MariaDB JSON support
DefteZ [Fri, 24 Jul 2020 23:45:41 +0000 (01:45 +0200)] 
Update docs with actual MariaDB JSON support

(cherry picked from commit a26b88cd6b2034b7048d5b4729d3fa90ddfb255d)

5 years agoAllow Grouping to pass along proxy_set of element
Mike Bayer [Tue, 21 Jul 2020 16:36:20 +0000 (12:36 -0400)] 
Allow Grouping to pass along proxy_set of element

Repaired an issue where the "ORDER BY" clause rendering a label name rather
than a complete expression, which is particularly important for SQL Server,
would fail to occur if the expression were enclosed in a parenthesized
grouping in some cases.   This case has been added to test support.

Fixes: #5470
Change-Id: Ie0e27c39e5d53be78b32f7810f93d2d0536375e7
(cherry picked from commit 30ec982ba697eb320d804164c6bc965ae239abe8)

5 years agoFix mssql dialect escaping object names containing ']'
Gord Thompson [Sat, 18 Jul 2020 00:06:41 +0000 (18:06 -0600)] 
Fix mssql dialect escaping object names containing ']'

Fixes: #5467
Change-Id: I054ec219717ba62847a9daf1214e215dd6b70633
(cherry picked from commit 547e959157f841f4f6d1e405ceed14755fcbd0bd)

5 years agoAdd requirement for test_get_view_definition
Gord Thompson [Wed, 15 Jul 2020 22:00:56 +0000 (16:00 -0600)] 
Add requirement for test_get_view_definition

Bypass the test if the views are not being created.

Change-Id: I3945acb418575d12e5fe0e4657eb5e3b1c08b90e
(cherry picked from commit 6158fe6cbf69c29d51a8e57aab4e36d6b4598079)

5 years agoRepair doubled "using engines in fork()" section
Mike Bayer [Wed, 15 Jul 2020 23:14:46 +0000 (19:14 -0400)] 
Repair doubled "using engines in fork()" section

This section was written twice in two different ways with
the same recipe.  consolidate into one section and
add additional caveats regading dispose.

Change-Id: I20524935e7c10e3624d561ea2735312fd04e673d
References: #5460
(cherry picked from commit f4aa9def8f35136d1fe3bba81aaeddb72e7772a2)

5 years agoMerge "Add missing function to documentation: cte, Exits" into rel_1_3
mike bayer [Mon, 13 Jul 2020 19:08:46 +0000 (19:08 +0000)] 
Merge "Add missing function to documentation: cte, Exits" into rel_1_3

5 years agotest single and double quote inspection scenarios
Mike Bayer [Mon, 13 Jul 2020 14:49:57 +0000 (10:49 -0400)] 
test single and double quote inspection scenarios

Applied a sweep through all included dialects to ensure names that contain
single or double quotes are properly escaped when querying system tables,
for all :class:`.Inspector` methods that accept object names as an argument
(e.g. table names, view names, etc).   SQLite and MSSQL contained two
quoting issues that were repaired.

Fixes: #5456
Change-Id: I3bc98806f5166f3d82275650079ff561446f2aef
(cherry picked from commit 4351f7183c81bdb64a9a3ba47aa4b9891f42ffdb)

5 years agoMerge "more docs for autocommit isolation level" into rel_1_3
mike bayer [Mon, 13 Jul 2020 03:28:53 +0000 (03:28 +0000)] 
Merge "more docs for autocommit isolation level" into rel_1_3

5 years agomore docs for autocommit isolation level
Mike Bayer [Sun, 12 Jul 2020 23:52:54 +0000 (19:52 -0400)] 
more docs for autocommit isolation level

this concept is not clear that we offer real
DBAPI autocommit everywhere.  backport 1.3 with edits
as well

Change-Id: I2e8328b7fb6e1cdc5453ab29c94276f60c7ca149
(cherry picked from commit 28fbb0cb94ddf92a014adbfe63a15b7d0797ccee)

5 years agoMake call-count profiling tests on osx have their own platform key
Federico Caselli [Sat, 11 Jul 2020 17:03:46 +0000 (19:03 +0200)] 
Make call-count profiling tests on osx have their own platform key

They previously would use the linux profiles, but recently some discrepancies in
the function call count on osx would make the tests fail.

Change-Id: Ifdfdca1676972de4179f59cdaae196f6805d4a21
(cherry picked from commit 2ada9686ffb86d39ea25aa146593dde2340fee03)

5 years agoLimit init_subclass test above python 3.6
Mike Bayer [Wed, 8 Jul 2020 19:48:32 +0000 (15:48 -0400)] 
Limit init_subclass test above python 3.6

The commit for I1654befe9eb1c8b8e7fc0784bdbe64284614f0ea #5357
runs the test on all Python 3 versions, however we need to limit
at least python 3.6 for this.

Change-Id: Ie86b78bbfd8c7bd013ff9aa7f8905328d792c1b3
(cherry picked from commit 43a111e326acae85f4623b8dd507468d99d5ef3a)

5 years agoPropose --nomemory by default
Mike Bayer [Wed, 8 Jul 2020 19:32:38 +0000 (15:32 -0400)] 
Propose --nomemory by default

the memory tests are solely responsible for the largest chunk of
time and CPU energy taken up in running the tests.   Regressions
in this area are nonexistent unless major changes are being
taken up.   Try to revert them to False and see if a single
gerrit job can perhaps run these.

Change-Id: Ibaead2d1c0a76f1339bee63652a8aead689e8b75
(cherry picked from commit e2d4b2e72cb97bc5612fa9d1ec7d0ab15d38efe1)

5 years agoresolves #3757
RamonWill [Sat, 4 Jul 2020 17:17:40 +0000 (18:17 +0100)] 
resolves #3757

(cherry picked from commit cf7bfb79847266148f6add22120479d287a259ab)

5 years agoMerge "Add **kw support to DeclarativeMeta.__init__" into rel_1_3
mike bayer [Tue, 7 Jul 2020 00:18:31 +0000 (00:18 +0000)] 
Merge "Add **kw support to DeclarativeMeta.__init__" into rel_1_3

5 years agoadded semicolon (;) to improve warning message clarity
jonathan vanasco [Tue, 30 Jun 2020 16:31:58 +0000 (12:31 -0400)] 
added semicolon (;) to improve warning message clarity

### Description

Added a semicolon to improve the clarity of warning message.  I actually had a table named `backend`, and thought it was involved!

While updating the code, I noticed no test that directly tests for this warning message. There are tests for the `Can't sort tables for DROP;` prefix of this message and the `exc.CircularDependencyError`; and some tests for the `exc.CircularDependencyError` message itself. I couldn't find any test for this particular message though.  (Just thought I'd bring that up)

No issue created, because this is minor.

Closes: #5431
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5431
Pull-request-sha: 87fb5733ff4fc1a13dd94277716814ea852f654c

Change-Id: I87a504d30a7dd5155c34f7d7f30b2116d0d3cd3f
(cherry picked from commit b421c51b94fdef2bc542b0a40bfb21490b23ca15)

5 years agoAdd **kw support to DeclarativeMeta.__init__
EwenGillies [Sun, 5 Jul 2020 14:50:50 +0000 (10:50 -0400)] 
Add **kw support to DeclarativeMeta.__init__

Added a ``**kw`` argument to the :meth:`.DeclarativeMeta.__init__` method.
This allows a class to support the :pep:`487` metaclass hook
``__init_subclass__``.  Pull request courtesy Ewen Gillies.

Fixes: #5357
Closes: #5363
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5363
Pull-request-sha: 0ad05a768316cba03a4d312ab39d3e8fbca7ac54

Change-Id: I1654befe9eb1c8b8e7fc0784bdbe64284614f0ea
(cherry picked from commit 67504137e96547664754691bdd3269b473a488d1)

5 years agoConsolidate connection customization documentation
Mike Bayer [Mon, 6 Jul 2020 15:11:54 +0000 (11:11 -0400)] 
Consolidate connection customization documentation

1. move all discussion of how to customize connection
to the engines.rst section.   have the section in pooling.rst
point to engines.

2. ensure all of the common use cases for connection modification
are listed out in order of level of modification.   the use
case of modifying an existing connection is separate from that of
modifying how connect is called; ensure that poolevents.connect
is referred to just as prominently as dialectevents.do_connect.

3. completely replace any discussion of create_engine.creator, as this
hook does not offer anything beyond what do_connect() does.
"creator" is more about using a Pool object directly without an
Engine, which is no longer a documented use case.

Change-Id: Ibe366d2a6e63eb420a6136fdc71ce0fb545edf8f
(cherry picked from commit b5c4a4cbe632e7dfa243121377a4a8d73b4da1ab)

5 years agoDocument pyodbc built-in pooling
Mike Bayer [Sun, 5 Jul 2020 14:28:20 +0000 (10:28 -0400)] 
Document pyodbc built-in pooling

PyODBC apparently pools connections by default and this
is a module-wide setting only.    Documenent that this happens
and how to disable it.

Fixes: #5440
Change-Id: I415bda7beb2211c66991b6c804b0ddb4d79e427f
(cherry picked from commit 9204b6610c9667ba2e4f73440339d2f520631777)

5 years agoAdd missing function to documentation: cte, Exits
Federico Caselli [Tue, 30 Jun 2020 19:40:56 +0000 (21:40 +0200)] 
Add missing function to documentation: cte, Exits

Fixes: #5432
Change-Id: I22e4ba3a7131165c551bcba7e377fa45d71d70e0
(cherry picked from commit f2ec52c232dbbe59282e9b9740ede52887f9ee8d)

5 years agoInclude DATETIME / DateTime with the MySQL TIMESTAMP examples
Mike Bayer [Mon, 29 Jun 2020 19:45:20 +0000 (15:45 -0400)] 
Include DATETIME / DateTime with the MySQL TIMESTAMP examples

To eliminate any remaining confusion, clarify that
DATETIME (as well as DateTime) and TIMESTAMP are treated
similarly with the MySQL dialect regarding ON UPDATE.

Change-Id: I222522440706902d5d2d11e670e76f16000438e0
References: #5427
(cherry picked from commit 30f8843e97a49121323a4f75d9341f77c9935312)

5 years agoMerge "Provide example for exists" into rel_1_3
mike bayer [Mon, 29 Jun 2020 19:05:39 +0000 (19:05 +0000)] 
Merge "Provide example for exists" into rel_1_3

5 years agoDocuemnt current workarounds for MySQL TIMESTAMP
Mike Bayer [Mon, 29 Jun 2020 18:35:22 +0000 (14:35 -0400)] 
Docuemnt current workarounds for MySQL TIMESTAMP

MySQL 8 no longer generates the DEFAULT or ON UPDATE
clauses for TIMESTAMP by default, hence users will begin to hit
this regularly.  add warnings that this non-standard SQL is not
accommodated by server_onupdate and docuemnt the workaround
used in issues such as #4652.

Fixes: #5427
Change-Id: Ie048dcc91c648dd0b80ed395208c1d665b6c968b
(cherry picked from commit a2c2dcaf082ecf97c7e06cd23adf5a614b5a4a2b)

5 years agoProvide example for exists
Federico Caselli [Sat, 27 Jun 2020 19:46:28 +0000 (21:46 +0200)] 
Provide example for exists

Fixes: #5423
Change-Id: I716f8de17c49d7eefbbce5ddd9da203bfc9fe47f
(cherry picked from commit 90a97ad9b63d5aa80439a20e7a9db450026d58de)

5 years agoEnsure Oracle < 8 used for python 2 in tox
Mike Bayer [Mon, 29 Jun 2020 15:23:19 +0000 (11:23 -0400)] 
Ensure Oracle < 8 used for python 2 in tox

this is already in master, backporting to 1.3.

the issue of the oracle extras_require in setup.py
is a separate issue as master still has no version
qualification in this area either.

Change-Id: Ib612401aaa2d5d109b26bc18a0fc817a15a98bf8

5 years agoFix a wide variety of typos and broken links
aplatkouski [Thu, 25 Jun 2020 20:38:06 +0000 (16:38 -0400)] 
Fix a wide variety of typos and broken links

Cherry pick from I9c36e8d8804483950db4b42c38ee456e384c59e3

Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com>
Closes: #5416
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5416
Pull-request-sha: 8b742b67285d1fc16323cc23f63d539a6a9ae62e

Change-Id: I85985199858ec881eaea98fc190d12b459aeb733

5 years agoVersion 1.3.19 placeholder
Mike Bayer [Thu, 25 Jun 2020 19:00:50 +0000 (15:00 -0400)] 
Version 1.3.19 placeholder

5 years ago- 1.3.18 rel_1_3_18
Mike Bayer [Thu, 25 Jun 2020 18:33:21 +0000 (14:33 -0400)] 
- 1.3.18

5 years agoUse index name to determine if an index is for the PK
Mike Bayer [Thu, 25 Jun 2020 15:12:40 +0000 (11:12 -0400)] 
Use index name to determine if an index is for the PK

Fixed bug in Oracle dialect where indexes that contain the full set of
primary key columns would be mistaken as the primary key index itself,
which is omitted, even if there were multiples.  The check has been refined
to compare the name of the primary key constraint against the index name
itself, rather than trying to guess based on the columns present in the
index.

Fixes: #5421
Change-Id: I47c2ccdd0b13977cfd9ef249d4de06371c4fb241
(cherry picked from commit ca56d8dc32f939b2bdb1f590986d4c46d280d186)

5 years agoAdd pip list to workflow, update setuptools
Federico Caselli [Mon, 22 Jun 2020 18:01:38 +0000 (20:01 +0200)] 
Add pip list to workflow, update setuptools

Change-Id: I2e32ba315a79dcfc7c5f79ed6517ac0cee4f55e3
(cherry picked from commit 28c13f9092d457d9e476e2987ba9e83ae868407a)

5 years agoApply dialect_options copy fix
Gord Thompson [Sat, 6 Jun 2020 16:04:34 +0000 (10:04 -0600)] 
Apply dialect_options copy fix

Fixes: #5276
Change-Id: Ic608310d4a85934fc9fa4d72daef66323c6e2525
(cherry picked from commit 5d7d96b53ef6b046fcd4d19a42e31f99898d1c81)

5 years agoMerge "Propose black py27 + py35 mode for the rest of Py2K" into rel_1_3
mike bayer [Fri, 19 Jun 2020 21:44:28 +0000 (21:44 +0000)] 
Merge "Propose black py27 + py35 mode for the rest of Py2K" into rel_1_3

5 years agoAdd note indicating order of join() calls are important
Mike Bayer [Fri, 19 Jun 2020 15:06:08 +0000 (11:06 -0400)] 
Add note indicating order of join() calls are important

Fixes: #5406
Change-Id: I186792b32bd156d5ddf256dcd018af32ad5b515e
(cherry picked from commit 332b8b78f6ba728b0994457420cb66e1c9bd5846)

5 years agoPropose black py27 + py35 mode for the rest of Py2K
Mike Bayer [Fri, 19 Jun 2020 14:25:42 +0000 (10:25 -0400)] 
Propose black py27 + py35 mode for the rest of Py2K

py27 mode produces one failure for flake8 which is the
space added between exec and parenthesis.  however apparently
we can add multiple versions to target-versions which allows
the exec() calls to come out in python 3 style.

The issue we want to improve is issues of trailing
commas being added.  I'm not really able to get black to
consistently add or remove these trailing commas in any
case no matter what I set target-version towards.

Change-Id: Iceb9e9aeb5f5e0d317fb877ef06eca0290997fe4
(cherry picked from commit 5850dbca071a565cc00f613618b4fcddd13a5eee)

5 years agoAdd version token to error URL
Mike Bayer [Thu, 11 Jun 2020 18:31:57 +0000 (14:31 -0400)] 
Add version token to error URL

the sqlalche.me redirector now supports the numerical version
code in the URL, e.g. /13/, /14/, /20/, etc., so that we can
redirect to the error codes for the appropriate version
of SQLAlchemy in use without going through the catch-all "latest"
link.   If a particular version of the docs is no longer on the
site, the redirect will revert to falling through the "latest"
link (which ultimately lands on the current release version,
/13/ at the time of this writing).

Change-Id: I3bb463fd6fb6c8767c95a57f3699aba715a9a72d
(cherry picked from commit dbaf82d258cc12d92ef28de4677d147fdb7808fd)

5 years agoAdd 'exists' to SQLite's reserved keywords
Thodoris Sotiropoulos [Thu, 11 Jun 2020 14:50:41 +0000 (10:50 -0400)] 
Add 'exists' to SQLite's reserved keywords

Added "exists" to the list of reserved words for SQLite so that this word
will be quoted when used as a label or column name. Pull request courtesy
Thodoris Sotiropoulos.

Fixes: #5395
Closes: #5396
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5396
Pull-request-sha: 5608317a38db7b63115e3b467d182a3e5cc31580

Change-Id: Ia4769de2dec159dcf282eb4b30c11560da51a5c7
(cherry picked from commit ed4a4896aea7dd77dd5d8a9861302811ac421e47)

5 years agoAdd documentation regarding row constructo in PostgreSQL
Federico Caselli [Mon, 25 May 2020 19:43:58 +0000 (21:43 +0200)] 
Add documentation regarding row constructo in PostgreSQL

Fixes: #5331
Change-Id: Ia795a4d4d8ae4944d8a160d18f8b917177acf0de
(cherry picked from commit 95106a9175741528cebfde8b6d0fd9756f82bd20)

5 years agoMerge "Improve ``Rendering Bound Parameters Inline`` documentation" into rel_1_3
mike bayer [Thu, 11 Jun 2020 03:13:40 +0000 (03:13 +0000)] 
Merge "Improve ``Rendering Bound Parameters Inline`` documentation" into rel_1_3

5 years agoMerge "updated historical terms with modern equivalents" into rel_1_3
mike bayer [Tue, 9 Jun 2020 16:28:08 +0000 (16:28 +0000)] 
Merge "updated historical terms with modern equivalents" into rel_1_3

5 years agoFix capitalization typos in engines.rst
Abraham Sangha [Mon, 8 Jun 2020 16:17:09 +0000 (10:17 -0600)] 
Fix capitalization typos in engines.rst

(cherry picked from commit 6322cb20974b1d702b9fa0cfc07dbef2c549797c)

5 years agoupdated historical terms with modern equivalents
jonathan vanasco [Sat, 6 Jun 2020 01:58:23 +0000 (21:58 -0400)] 
updated historical terms with modern equivalents

### Description
There were a few remnant uses of master/slave in the code and docs. The project previously made a decision to move away from them to use modern and inclusive terminology.

This PR does not cover a bug or necessitate a documented entry into the changelog, so an issue ticket was not created.

### Checklist
This pull request is:

- [x] A documentation / typographical error fix
- [x] A short code fix
- [ ] A new feature implementation

Closes: #5381
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5381
Pull-request-sha: 92597e83d0e1e18960dbb39b604b313e7a1cbb30

Change-Id: I1fb34fe5ab6c19fd7360568d7b51cdea9d271b3b
(cherry picked from commit 3512d51600c250f72911313e3f204552c250ece7)

5 years agoFix connection string escaping for mssql+pyodbc
Gord Thompson [Thu, 4 Jun 2020 18:38:13 +0000 (12:38 -0600)] 
Fix connection string escaping for mssql+pyodbc

Fixes: #5373
Change-Id: Ia41e8f1ef8644c54d23ebfdf3f909c785adf0fb0
(cherry picked from commit 14bc09203a8b5b2bc001f764ad7cce6a184975cc)

5 years agoImprove ``Rendering Bound Parameters Inline`` documentation
Federico Caselli [Thu, 4 Jun 2020 17:53:29 +0000 (19:53 +0200)] 
Improve ``Rendering Bound Parameters Inline`` documentation

This is mainly to make this section more discoverable by users

Change-Id: I58ba19e4a9ae85b227e5b5553ba5c30c01f3e005
(cherry picked from commit 1f244416a01587b7c2ff8a1e42209332b7b821cc)

5 years agoDocument that type_coerce does not currently imply parenthesization
Mike Bayer [Thu, 4 Jun 2020 17:28:21 +0000 (13:28 -0400)] 
Document that type_coerce does not currently imply parenthesization

We've had a few issues where the current solution
is to use the self_group() method, so document that as
the current approach for the parenthesization use case.
Whether or not type_coerce() is changed later, this is
how it works at the moment.

Fixes: #5375
Change-Id: I97414762a87ec8f1fd1adc1b6be5a52e576814ca
References: #5344
(cherry picked from commit a4de30c50eb660a08c8d025c158c54a0bd84f051)

5 years agoMerge "Add default expression to query_expression()" into rel_1_3
mike bayer [Tue, 2 Jun 2020 17:56:40 +0000 (17:56 +0000)] 
Merge "Add default expression to query_expression()" into rel_1_3

5 years agoMerge "Support multiple dotted sections in mssql schema names" into rel_1_3
mike bayer [Mon, 1 Jun 2020 19:43:13 +0000 (19:43 +0000)] 
Merge "Support multiple dotted sections in mssql schema names" into rel_1_3

5 years agoSupport multiple dotted sections in mssql schema names
Mike Bayer [Mon, 1 Jun 2020 00:34:03 +0000 (20:34 -0400)] 
Support multiple dotted sections in mssql schema names

Refined the logic used by the SQL Server dialect to interpret multi-part
schema names that contain many dots, to not actually lose any dots if the
name does not have bracking or quoting used, and additionally to support a
"dbname" token that has many parts including that it may have multiple,
independently-bracketed sections.

This fix addresses #5364 to some degree but probably does not
resolve it fully.

References: #5364
Fixes: #5366
Change-Id: I460cd74ce443efb35fb63b6864f00c6d81422688
(cherry picked from commit 9aff0102813900fd7bc2120df5e1cfa169edb44f)

5 years agoAdd default expression to query_expression()
Haoyu Sun [Fri, 29 May 2020 18:31:07 +0000 (14:31 -0400)] 
Add default expression to query_expression()

Added a new parameter :paramref:`_orm.query_expression.default_expr` to the
:func:`_orm.query_expression` construct, which will be appled to queries
automatically if the :func:`_orm.with_expression` option is not used. Pull
request courtesy Haoyu Sun.

Fixes: #5198
Closes: #5354
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5354
Pull-request-sha: 57dd4922a3ae4e5fe56dcc541d85ce42256b38b9

Change-Id: I3400f2c00b58bf161f31c74c579feb9ac0f03356
(cherry picked from commit 9be0e9e5477cd6a494d9e3b3c13ceed1e50cc5a9)

5 years agoFix is_disconnect false positive for mssql+pyodbc
Gord Thompson [Fri, 29 May 2020 13:20:54 +0000 (07:20 -0600)] 
Fix is_disconnect false positive for mssql+pyodbc

Fixed an issue where the ``is_disconnect`` function in the SQL Server
pyodbc dialect was incorrectly reporting the disconnect state when the
exception messsage had a substring that matched a SQL Server ODBC error
code.

Fixes: #5359
Change-Id: I450c6818405a20f4daee20d58fce2d5ecb33e17f
(cherry picked from commit ddff320473dcbd3cc11d577715f96237276bc685)

5 years agoadd posargs to pep8
Mike Bayer [Fri, 29 May 2020 20:47:29 +0000 (16:47 -0400)] 
add posargs to pep8

we want to be able to specify --output-file

Change-Id: Ib4e992d47587385a50c35ca915bc5adcb2ca49fa
(cherry picked from commit 7ff6cf1eaa84f1387d60d4eb7ba752480a6bf567)

5 years agoMerge "SYBASE: Added offset support" into rel_1_3
mike bayer [Thu, 28 May 2020 16:42:38 +0000 (16:42 +0000)] 
Merge "SYBASE: Added offset support" into rel_1_3

5 years agoFix 'email_address' being typoed as 'email_addres' in two places
Mark Amery [Thu, 28 May 2020 12:37:24 +0000 (13:37 +0100)] 
Fix 'email_address' being typoed as 'email_addres' in two places

(cherry picked from commit 8a6e64323abeb9d08de3f68c63c6401ba1a5f847)

5 years agoRender table hints in generic SQL
Mike Bayer [Wed, 27 May 2020 14:18:33 +0000 (10:18 -0400)] 
Render table hints in generic SQL

Added :meth:`.Select.with_hint` output to the generic SQL string that is
produced when calling ``str()`` on a statement.  Previously, this clause
would be omitted under the assumption that it was dialect specific.
The hint text is presented within brackets to indicate the rendering
of such hints varies among backends.

Fixes: #5353
References: #4667
Change-Id: I01d97d6baa993e495519036ec7ecd5ae62856c16
(cherry picked from commit 7dc411dc63faf59b4e28fa0dea805887821d0d99)

5 years agoUpdates for examples/performance
Mike Bayer [Tue, 26 May 2020 03:24:05 +0000 (23:24 -0400)] 
Updates for examples/performance

added --sort option and also --raw option
from 6b3513f56c2a5d3ba45215b2438c47dba4336740

Change-Id: I42ef2135db08c87f33b51faed9c8bbff510c9e9b

5 years agoMerge "Add with_for_update mysql new functionalities" into rel_1_3
mike bayer [Sun, 24 May 2020 15:19:26 +0000 (15:19 +0000)] 
Merge "Add with_for_update mysql new functionalities" into rel_1_3

5 years agoAdd a docs link to the CockroachDB dialect
Rafi Shamim [Tue, 19 May 2020 17:42:49 +0000 (13:42 -0400)] 
Add a docs link to the CockroachDB dialect

This also increases the width of the table so that it's less likely the
whole table will need to be modified again in the future.

mike's cherry-pick also adds the firebird dialect
(cherry picked from commit 1d12bc1381c7ff6748eb63754405019f0ded29e4)

Change-Id: I85040e2c8f103340dc3f1844c5f8fb51cfb307dd

5 years agoSYBASE: Added offset support
snowman2 [Sat, 9 May 2020 13:17:21 +0000 (09:17 -0400)] 
SYBASE: Added offset support

Fixes: #5294
### Description
Fix for https://github.com/sqlalchemy/sqlalchemy/issues/5294#issue-610311455

I tested it against our database (Adaptive Server Enterprise/16.0 SP02) with `pyodbc+sybase`

### Checklist

This pull request is:

- [x] A short code fix for #5294
- [x] Added tests.

Closes: #5312
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5312
Pull-request-sha: f62c14825f2941fdd54ede17fd8d4f105a052e05

Change-Id: Ic716e17a6f654deef78781cefc3f16333cd725c3
(cherry picked from commit 360583a00abc0bf99a29a40b918bb5f741dc5198)

5 years agoAdd with_for_update mysql new functionalities
RobotScribe [Wed, 29 Apr 2020 19:22:59 +0000 (15:22 -0400)] 
Add with_for_update mysql new functionalities

Fixes: #4860
# Description
Add nowait, skip_lock, of arguments to for_update_clause for mysql

### Checklist

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] 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.
- [x] 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: #5290
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5290
Pull-request-sha: 490e822e73e92ffe63cf45df9c49f3b31af1954d

Change-Id: Ibd2acc47b538c601c69c8fb954776035ecab4c6c
(cherry picked from commit 103260ddb476c5354b3201f92636c474f2a83c35)

5 years agoMerge "Correctly apply self_group in type_coerce element." into rel_1_3
mike bayer [Sat, 23 May 2020 21:21:59 +0000 (21:21 +0000)] 
Merge "Correctly apply self_group in type_coerce element." into rel_1_3

5 years agoMerge "Improve error message when using :meth:`_query.Query.filter_by` in a query...
mike bayer [Sat, 23 May 2020 21:12:07 +0000 (21:12 +0000)] 
Merge "Improve error message when using :meth:`_query.Query.filter_by` in a query where the first entity is not a mapped class." into rel_1_3

5 years agoMerge "Add note re: pymssql not in CI" into rel_1_3
mike bayer [Sat, 23 May 2020 21:11:08 +0000 (21:11 +0000)] 
Merge "Add note re: pymssql not in CI" into rel_1_3

5 years agoMerge "fix typo in reference documentation" into rel_1_3
mike bayer [Sat, 23 May 2020 21:10:41 +0000 (21:10 +0000)] 
Merge "fix typo in reference documentation" into rel_1_3

5 years agoStop converting mssql datetime.time parameters to datetime.datetime
Gord Thompson [Thu, 21 May 2020 22:20:48 +0000 (16:20 -0600)] 
Stop converting mssql datetime.time parameters to datetime.datetime

Fixes: #5339
Change-Id: Ida75422d8c3fdfc7adae68e547d88df49368a693
(cherry picked from commit 9a04c2f65754ac7bf93e0f58f68e59b41e43e67e)

5 years agofix typo in reference documentation
Federico Caselli [Fri, 22 May 2020 22:11:46 +0000 (00:11 +0200)] 
fix typo in reference documentation

Change-Id: I5720635863f0d8a8ebfa4ddc51008bb93c1067b4
(cherry picked from commit 2632a8db05d69607260d412852f7cc5c0ac0f368)

5 years agoCorrectly apply self_group in type_coerce element.
Federico Caselli [Fri, 22 May 2020 21:56:50 +0000 (23:56 +0200)] 
Correctly apply self_group in type_coerce element.

The type coerce element did not correctly apply grouping rules when using
in an expression

Fixes: #5344
Change-Id: Id67b0e60ac54f8992f931aaed62731672f60c96c
(cherry picked from commit d163088de1d68919b6811a25745d3becbbf5b069)

5 years agoMerge "Fix query string escaping in engine URLs" into rel_1_3
mike bayer [Fri, 22 May 2020 20:18:01 +0000 (20:18 +0000)] 
Merge "Fix query string escaping in engine URLs" into rel_1_3

5 years agoMerge "Don't emit pyodbc "no driver" warning for empty URL" into rel_1_3
mike bayer [Fri, 22 May 2020 20:12:54 +0000 (20:12 +0000)] 
Merge "Don't emit pyodbc "no driver" warning for empty URL" into rel_1_3

5 years agoCross reference do_connect() event w/ creator
Mike Bayer [Fri, 22 May 2020 20:04:17 +0000 (16:04 -0400)] 
Cross reference do_connect() event w/ creator

two questions today involving creator / do_connect,
do_connect is not well known enough, ensure docs are present
and prominent.

Change-Id: I85d518b9fc7b9b069a18010969abefa360134fe9
(cherry picked from commit 88ae6a6cdd9f37d65ea212736f1229bb62d677a9)

5 years agoDon't emit pyodbc "no driver" warning for empty URL
Mike Bayer [Fri, 22 May 2020 17:14:58 +0000 (13:14 -0400)] 
Don't emit pyodbc "no driver" warning for empty URL

Fixed an issue in the pyodbc connector such that a warning about pyodbc
"drivername" would be emitted when using a totally empty URL.  Empty URLs
are normal when producing a non-connected dialect object or when using the
"creator" argument to create_engine(). The warning now only emits if the
driver name is missing but other parameters are still present.

Fixes: #5346
Change-Id: I0ee6f5fd5af7faca63bf0d7034410942f40834a8
(cherry picked from commit 29534cf13939c7f7fe59399f12d50df2fcab7a38)

5 years agoFix query string escaping in engine URLs
Miguel Grinberg [Thu, 21 May 2020 09:54:47 +0000 (05:54 -0400)] 
Fix query string escaping in engine URLs

Fixed issue in :class:`.URL` object where stringifying the object
would not URL encode special characters, preventing the URL from being
re-consumable as a real URL.  Pull request courtesy Miguel Grinberg.

Fixes: #5341
Closes: #5342
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5342
Pull-request-sha: 362ca3398336a3a892e8020530f0c68d4f2d1d01

Change-Id: Ief6218122d1ec0c70479eb1a90e1c16433801924
(cherry picked from commit 2644693c0bf5b775f7a7283cdbf566a37872586f)

5 years agoTarget real pypi in the create wheel workflow
Federico Caselli [Wed, 20 May 2020 19:31:16 +0000 (21:31 +0200)] 
Target real pypi in the create wheel workflow

Change-Id: Ic764aae08b9d45011048f21c8ee992222c078bd2
(cherry picked from commit b67548ad788fc0eb8782dfd5a1d2a016dc5c7f78)

5 years agofix table.schema version to 1.3.18
Mike Bayer [Tue, 19 May 2020 22:55:16 +0000 (18:55 -0400)] 
fix table.schema version to 1.3.18

Fixes: #5338
Change-Id: I12ce8021f5627c306c768b74da991ef4af0a5b55
(cherry picked from commit 3d55263c92ee29a0257d823124c353a35246cf31)

5 years agoMerge "SQLite 3.31 added support for computed column." into rel_1_3
mike bayer [Tue, 19 May 2020 20:18:52 +0000 (20:18 +0000)] 
Merge "SQLite 3.31 added support for computed column." into rel_1_3

5 years agoMerge "Introduce :class:`.IdentityOptions` to store common parameters for sequences...
mike bayer [Tue, 19 May 2020 19:47:33 +0000 (19:47 +0000)] 
Merge "Introduce :class:`.IdentityOptions` to store common parameters for sequences and identity columns." into rel_1_3

5 years agoMerge "Use the same create-wheel workflow as in master" into rel_1_3
mike bayer [Tue, 19 May 2020 19:45:19 +0000 (19:45 +0000)] 
Merge "Use the same create-wheel workflow as in master" into rel_1_3

5 years agoSQLite 3.31 added support for computed column.
Federico Caselli [Fri, 1 May 2020 20:22:51 +0000 (22:22 +0200)] 
SQLite 3.31 added support for computed column.

This change enables their support in SQLAlchemy when targeting SQLite.

Fixes: #5297
Change-Id: Ia9f21a49e58fc977e3c669b8176036c95d93b9c8
(cherry picked from commit 40fdcec6dfd6444a85a15e42065ce3a20e82e99f)

5 years agoReword delete-orphan on many error message and document
Mike Bayer [Sat, 16 May 2020 17:05:00 +0000 (13:05 -0400)] 
Reword delete-orphan on many error message and document

For many years we have encountered users making use of the
"single_parent" flag in response to the error message for
"delete-orphan" expressing this as a means to cancel the current
error.   However, the actual issue here is usually a misuse
of the delete-orphan cascade setting.  Reword the error message to
be much more descriptive about what this means and add new
error link sections describing the situation in as much detail
as possible.

Fixes: #5329
Change-Id: I7ba710378b2935479ab22ff9a0a79c692dbf69a6
(cherry picked from commit 0d611b88911217727a174916b83e296e8c7105b1)

5 years agoAdd note re: pymssql not in CI
Gord Thompson [Sat, 16 May 2020 14:57:06 +0000 (08:57 -0600)] 
Add note re: pymssql not in CI

Change-Id: I45f78131ffe1881a3965e8aa41bbc46da7d43a5b
(cherry picked from commit 88bffda3feb83356f8bd6ce0443efea6ef725c24)

5 years agoIntroduce :class:`.IdentityOptions` to store common parameters for
Federico Caselli [Thu, 14 May 2020 20:57:56 +0000 (22:57 +0200)] 
Introduce :class:`.IdentityOptions` to store common parameters for
sequences and identity columns.

References: #5324
Change-Id: I72f7fc1a003456206b004d3d26306940f9c36414
(cherry picked from commit e1d8b15b636793a84f0d2baa7d6213ce7dec8080)

5 years agoMove supports_sane_rowcount_returning = False to dialect level
Gord Thompson [Mon, 11 May 2020 20:44:37 +0000 (14:44 -0600)] 
Move supports_sane_rowcount_returning = False to dialect level

Fixes: #5321
Change-Id: Id83e98e9013818424c133297a850746302633158
(cherry picked from commit cc97dade0de008ce923dbb94db21a8e1ccb5bb22)

5 years agoImprove error message when using :meth:`_query.Query.filter_by` in
Federico Caselli [Thu, 14 May 2020 19:51:59 +0000 (21:51 +0200)] 
Improve error message when using :meth:`_query.Query.filter_by` in
a query where the first entity is not a mapped class.

Fixes: #5260
Change-Id: I18cfccc0f3e587cb3df3e1f5f23b6885d5f2f466
(cherry picked from commit 8c10e29dc7aa2356d0f3f5110b2c9dade9d87096)

5 years agoAdd 'schema' parameter to table
Dylan Modesitt [Wed, 6 May 2020 18:17:23 +0000 (14:17 -0400)] 
Add 'schema' parameter to table

Added a "schema" parameter to the :func:`_expression.table` construct,
allowing ad-hoc table expressions to also include a schema name.
Pull request courtesy Dylan Modesitt.

Fixes: #5309
Closes: #5310
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5310
Pull-request-sha: ce85681050500186678131f948b6ea277a65dc17
Change-Id: I32015d593e1ee1121c7426fbffdcc565d025fad1
(cherry picked from commit 187a3a27cf8303ba332e011a482bd3b21cd3c01c)

5 years agoAdjust documentation wording for firebird and sybase
Gord Thompson [Fri, 15 May 2020 12:07:57 +0000 (06:07 -0600)] 
Adjust documentation wording for firebird and sybase

Change-Id: Ied2cdab1c2dbdee681a5500285a5bcdd4d589afa
(cherry picked from commit 1333f4a31e5870f70855cce310022e004580df40)

5 years agoUse the same create-wheel workflow as in master
Federico Caselli [Thu, 14 May 2020 19:15:56 +0000 (21:15 +0200)] 
Use the same create-wheel workflow as in master

Change-Id: If7cddde3b950978713e22888837163e730c1a938

5 years agoActively unset reset agent in discard transaction
Mike Bayer [Thu, 14 May 2020 14:51:29 +0000 (10:51 -0400)] 
Actively unset reset agent in discard transaction

The assumptions in _discard_transaction from
916e1fea25afcd07fa1d1d2f72043b372cd02223 were too narrow,
assuming that if the given transaction were not our
"current" one, that this would not be the reset agent.  however
as the legacy behvaior is that even a "nested" transaction gets
set as "self._transaction", this did not accommodate for the nested
transaction being thrown away.   We will attempt to refine all of this
logic in #5327 for 1.4 /master assuming this is feasible for the
full suite of current use cases.

Fixes: #5326
Change-Id: I6787e82c9e50c23317f87d0d094122c6a6f066da
(cherry picked from commit 79de84b25e87bbb7fa94f0dd513b4abc76e05a7e)

5 years agoRestore unreleased_XY directories
Mike Bayer [Thu, 14 May 2020 14:40:07 +0000 (10:40 -0400)] 
Restore unreleased_XY directories

these directories were removed in 4e5b7e6e62461d2685c1586dbb4cb1db88ff4ab0
which breaks the documentation builds.

Change-Id: I17aa66bf95c69a075a68e78245fad3bef85dc29e
(cherry picked from commit 6bd171cbc87db8ca55640bd7efd8c88a44d08808)